Templates::Observer< T > Class Template Reference

Implementation of a generic typed observer (observer part). More...

#include <observer.h>

List of all members.

Public Member Functions

 Observer ()
 Default constructor.
virtual ~Observer ()
 Destructor.
virtual void update (T *subject)=0
 Observable object changed its state.


Detailed Description

template<class T>
class Templates::Observer< T >

Implementation of a generic typed observer (observer part).

Implements "observer" design pattern.

Usage:

 class ViewController: public Observer<View>
 {
     public:
         ViewController() {}
         ~ViewController() {}
         void update(View * subject)
         {
             std::cout << subject->getName() << " has changed." << std::endl;
         }
 };

See also:
Observable

Constructor & Destructor Documentation

template<class T>
Templates::Observer< T >::Observer (  )  [inline]

Default constructor.

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

Destructor.


Member Function Documentation

template<class T>
virtual void Templates::Observer< T >::update ( T *  subject  )  [pure virtual]

Observable object changed its state.

Parameters:
[in] subject Observable object.
This method is a reaction to the observable object (arg) state change.

Implemented in FadingExplosion, FireExplosion, ModelAvatar, and SnowmanAvatar.


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

Generated on Sat Dec 20 19:21:24 2008 for PGR2008 by  doxygen 1.5.6