18 #include <boost/python.hpp> 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" 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...
hippodraw::ObserverWrap class interface.
boost::python::object get_owner(T *me) const
Find the Python object that owns this object.
PyObject * m_self
The held Python object.
A wrapper class for Observer to allow its pure virtual function to be implemented in Python...
Observable class interface.
void update(const Observable *)
void export_Observer()
Exports the Observer class to Python.
Part of an implementation of the Observable Observer pattern based on the example implementation in t...