#include <Object.h>
Inheritance diagram for ogs::support::Object:
Public Member Functions | |
void | addObserver (Observer &observer) |
Add an event observer. | |
void | removeObserver (Observer &observer) |
Remove an event observer. | |
Class | getClass () const |
Determine the class of this object. | |
virtual std::string | toString () const |
Format a string representation of this object. | |
Protected Types | |
typedef std::list< Observer * > | Observers |
A list of observers. | |
Protected Member Functions | |
Object () | |
Create a new object. | |
Observers | getObservers () const |
Retrieve the list of observers. | |
virtual void | notifyObservers (Event &event) |
Notify all observers of an event. |
|
This constructor is protected so it can only be called by derived classes. All that it does is initialize the observers as an empty list. |
|
This function adds the observer only if it is not already in the list of observers for this object.
|
|
|
|
|
|
This method is protected so that subclasses can control when observers are notified of events. Subclasses may expose this method to allow any other class to control when observers are notified.
|
|
|
|
The format of the string is "Class@Address" where "Class" is the name of the derived class and "Address" is the pointer to this object.
Reimplemented in ogs::core::Modifier, and ogs::core::details::Gender. |