Public Member Functions | Private Member Functions | Private Attributes

ObserverWrap Class Reference

A wrapper class for Observer to allow its pure virtual function to be implemented in Python. More...

#include <ObserverWrap.h>

Inheritance diagram for ObserverWrap:
Inheritance graph
[legend]
Collaboration diagram for ObserverWrap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ObserverWrap (PyObject *self)
 The constructor.
 ObserverWrap ()
 ObserverWrap (const Observer &)
void update (const Observable *)
virtual void update (const Observable *)=0
 The update method.
virtual void willDelete (const Observable *)
 Notifies this Observer object that one of its Observable objects is about to be deleted.

Private Member Functions

template<class T >
boost::python::object get_owner (T *me) const
 Find the Python object that owns this object.

Private Attributes

PyObject * m_self
 The held Python object.

Detailed Description

A wrapper class for Observer to allow its pure virtual function to be implemented in Python.

Note:
This class needs Python 2.3 or later to be fully functional.
Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 29 of file ObserverWrap.h.


Constructor & Destructor Documentation

ObserverWrap ( PyObject *  self  ) 

The constructor.

Todo:
This method and others may not be needed.

Definition at line 60 of file ObserverWrap.cxx.

ObserverWrap (  ) 

Definition at line 67 of file ObserverWrap.cxx.

ObserverWrap ( const Observer ow  ) 

Definition at line 73 of file ObserverWrap.cxx.


Member Function Documentation

object get_owner ( T *  me  )  const [private]

Find the Python object that owns this object.

Definition at line 82 of file ObserverWrap.cxx.

Referenced by ObserverWrap::update().

void update ( const Observable obs  ) 
Note:
This function is only available with Python 2.3 or later.

Definition at line 95 of file ObserverWrap.cxx.

References ObserverWrap::get_owner().

virtual void update ( const Observable  )  [pure virtual, inherited]

The update method.

This member function is called by the observed Observable when its state has changed The Command argument is optional and may be a null pointer.

Implemented in DataRep, DataSourceController, EpsView, ViewBase, OpenGLView, BinningProjector, DyHist1DProjector, DyHist2DProjector, NTupleProjector, Profile2DProjector, ProfileProjector, ProjectorBase, QtViewImp, and RootController.

Referenced by Observable::notifyObservers().

void willDelete ( const Observable  )  [virtual, inherited]

Notifies this Observer object that one of its Observable objects is about to be deleted.

Since most Observable objects are owned by its Observer, it is the Observer that issued the delete. Thus the default implementation here does nothing. Derived classes that observe objects owned by another should implement this method to remove the Observable from the list they are observing.

Reimplemented in FunctionRep, DataSourceController, ViewBase, BinningProjector, DyHist1DProjector, DyHist2DProjector, NTupleProjector, Profile2DProjector, ProfileProjector, and RootController.

Definition at line 25 of file Observer.cxx.

Referenced by DataRep::~DataRep(), DataSource::~DataSource(), NTuple::~NTuple(), PlotterBase::~PlotterBase(), RootNTuple::~RootNTuple(), and RTuple::~RTuple().


Member Data Documentation

PyObject* m_self [private]

The held Python object.

Definition at line 36 of file ObserverWrap.h.


The documentation for this class was generated from the following files:

Generated for HippoDraw Class Library by doxygen