#include <observer.h>
Inheritance diagram for GltObserver< T >:
Public Methods | |
GltObserver () | |
Constructor. | |
~GltObserver () | |
Destructor. | |
void | observe (T &subject) |
Observe an object. | |
void | forget (T &subject) |
Forget an object. | |
virtual void | OnNotify (const T *subject)=0 |
Callback handler for subject updates -- should be supplied by subclass. | |
Protected Methods | |
void | OnNotify (const void *subject) |
Supplied by GltObserver to do type-specific OnNotify callback event. |
Classes inheriting from GltObserver can observe one or more subjects of a particular type. The derived class must define an OnNotify() handler for each type of subject that it observes. When the GltSubject derived subject calls the notify() member function, each observer will receive the OnNotify() callback.
It is safe to delete either the subject or observer at any time. Both will "forget" about each other as soon as either of the destructors is called.
Definition at line 95 of file observer.h.