Public Member Functions | Private Member Functions | Private Attributes | List of all members
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]

Public Member Functions

 ObserverWrap (PyObject *self)
 The constructor.
 ObserverWrap ()
 ObserverWrap (const Observer &)
void update (const Observable *)
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_.nosp@m.Kunz.nosp@m.@slac.nosp@m..sta.nosp@m.nford.nosp@m..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.

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)
virtual
Note
This function is only available with Python 2.3 or later.

Implements Observer.

Definition at line 95 of file ObserverWrap.cxx.

References ObserverWrap::get_owner().

void willDelete ( const Observable )
virtualinherited

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 ViewBase, FunctionRep, BinningProjector, NTupleProjector, Profile2DProjector, DyHist1DProjector, DyHist2DProjector, TextPlotter, CutPlotter, and ProfileProjector.

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