SingleObserver< T > Class Template Reference

#include <Observer.h>

Inheritance diagram for SingleObserver< T >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 SingleObserver ()
 The constructor and destructor for Observer do nothing.
virtual ~SingleObserver ()
virtual void notify (const T &observed, const ObserverEvent &event)=0
 The one virtual public interface method for SingleObserver.
void notify (const T &observed, int event)
 A non-virtual notify that just wrapps the given integer in an event object and passes that on.

template<class T>
class SingleObserver< T >


Constructor & Destructor Documentation

template<class T>
SingleObserver< T >::SingleObserver (  )  [inline]

The constructor and destructor for Observer do nothing.

It is up to the class deriving from Observer to call 'attach' and 'detach' when necessary.

template<class T>
virtual SingleObserver< T >::~SingleObserver (  )  [inline, virtual]


Member Function Documentation

template<class T>
virtual void SingleObserver< T >::notify ( const T &  observed,
const ObserverEvent event 
) [pure virtual]

The one virtual public interface method for SingleObserver.

notify is called by an Observable when it needs to tell attached Observer that some event has occurred. It is up to the derived class, for the type T, to be able to interpret the meaning of the integer event code in the provided ObserverEvent object (or to ignore it, if it needs to). notify is called with a reference to the object being observed and the event which occurred. Note that event code '0' is special; it means that the given Observable is being destroyed, so this Observer should just note that it is no longer attached to that Observable.

Referenced by SingleObserver< int >::notify().

template<class T>
void SingleObserver< T >::notify ( const T &  observed,
int  event 
) [inline]

A non-virtual notify that just wrapps the given integer in an event object and passes that on.


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

Generated on Wed Mar 16 06:20:35 2011 for FreePOOMA by  doxygen 1.5.9