Observation is meant as an association scheme between two objects, one observed, one observing, that share an individual (observation) interface. The observed object reports events and attribute changes of some meaning through the interface to the observer, which implements this xxxObserver interface. The xxxObserver interface is defined along with the class of the observed object, where xxx is replaced with the class name. An Observer is a client to its observed object and managed by the template class Observable. A class that support the observation scheme as a type for observed objects should use Observable as a base class.
Public Member Functions | |
Observable (Observer *o=0) | |
Construction. | |
const std::list< Observer * > & | getObserver () |
get Observer | |
void | addObserver (Observer *newObserver) |
add new Observer | |
void | removeObserver (Observer *ob) |
remove Observer |
|
Construction.
|
|
get Observer
|
|
add new Observer
|
|
remove Observer
|