|
Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
|
An abstract observable type, maintaining a list of observers, who can be notified in case of Events. More...
#include <observable.hpp>
Public Member Functions | |
| void | AddObserver (AnyObserver &new_observer) const |
| Add an observer, to observe this observable. | |
| void | RemoveObserver (AnyObserver &observer) const |
| Remove an observer from this observable. | |
Protected Member Functions | |
| void | NotifyObservers (AnyEvent const &e) const |
| Sends an Event (more particularly, AnyEvent) to all watching observers of this object. | |
An abstract observable type, maintaining a list of observers, who can be notified in case of Events.
Some known observable types are Tracker and Endgame.
|
inline |
Add an observer, to observe this observable.
|
inlineprotected |
Sends an Event (more particularly, AnyEvent) to all watching observers of this object.
This function could potentially be improved by filtering on the observer's desired event types, if known at compile time. This could potentially be a performance bottleneck (hopefully not!) since filtering can use dynamic_casting. One hopes this cost is overwhelmed by things like linear algebra and system evaluation.
| e | The event to emit. Its type should be derived from AnyEvent. |
|
inline |
Remove an observer from this observable.