18 #include <boost/python.hpp>
28 using namespace boost::python;
37 std::auto_ptr<ObserverWrap>,
40 "The base class for classes that can be targets of Observable\n"
47 "The base class for classes that can be target of an Observer\n"
55 using namespace hippodraw;
60 ObserverWrap ( PyObject *
self )
88 object ( handle<> ( borrowed ( detail::wrapper_base_::get_owner(*
this))));
97 #ifndef HAVE_OLD_PYTHON
98 PyGILState_STATE state = PyGILState_Ensure ();
102 call_method < void, const Observable * > (
self.ptr(),
"update", obs );
103 }
catch ( error_already_set & ) {
104 std::cout <<
"ObserverWrap::update: caught error_already_set"
110 PyGILState_Release ( state );
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
boost::python::object get_owner(T *me) const
Find the Python object that owns this object.
hippodraw::ObserverWrap class interface.
void export_Observer()
Exports the Observer class to Python.
A wrapper class for Observer to allow its pure virtual function to be implemented in Python...
Observable class interface.
Part of an implementation of the Observable Observer pattern based on the example implementation in t...
void update(const Observable *)