#include <observer.h>
Public Member Functions | |
Observer () | |
Default constructor. | |
virtual | ~Observer () |
Destructor. | |
virtual void | update (T *subject)=0 |
Observable object changed its state. |
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; } };
Templates::Observer< T >::Observer | ( | ) | [inline] |
Default constructor.
virtual Templates::Observer< T >::~Observer | ( | ) | [inline, virtual] |
Destructor.
virtual void Templates::Observer< T >::update | ( | T * | subject | ) | [pure virtual] |
Observable object changed its state.
[in] | subject | Observable object. |
Implemented in FadingExplosion, FireExplosion, ModelAvatar, and SnowmanAvatar.