This class represents an observable subject that will notify all of its registered observers.
More...
#include <Observable.qc.dox.h>
|
hash< ObserverEventInfo > | registerObserverEventsArgs (hash< ObserverEventInfo > info, list< auto > events) |
| Registers observer events.
|
|
|
hash< string, hash< ObserverEventInfo > > | observer_map |
| maps from object hash -> object
|
|
This class represents an observable subject that will notify all of its registered observers.
◆ deregisterObserver() [1/2]
bool DataProvider::Observable::deregisterObserver |
( |
object |
observer | ) |
|
The method deregisters the given observer.
- Parameters
-
observer | the observer to be deregistered |
- Returns
- True if found otherwise False
- Note
- this variant is meant for observer objects implemented in other languages
◆ deregisterObserver() [2/2]
bool DataProvider::Observable::deregisterObserver |
( |
Observer |
observer | ) |
|
The method deregisters the given observer.
- Parameters
-
observer | the observer to be deregistered |
- Returns
- True if found otherwise False
◆ log()
DataProvider::Observable::log |
( |
int |
level, |
|
|
string |
fmt |
|
) |
| |
Reimplement this method to implement logging.
- Parameters
-
level | the Logger level |
fmt | the format string |
... | any arguments for any format placeholders in fmt |
◆ notifyObservers()
DataProvider::Observable::notifyObservers |
( |
string |
event_id, |
|
|
hash< auto > |
data_ |
|
) |
| |
The method notifies all subscribed observers.
- Parameters
-
event_id | unique ID identifying an event |
data_ | hash representing new data to be passed to observers' update() methods |
◆ registerObserver() [1/2]
DataProvider::Observable::registerObserver |
( |
object |
observer | ) |
|
The method registers the given observer.
- Parameters
-
observer | the observer to be registered |
... | event IDs for notifications; if no additional arguments are passed, then the observer is notified for all events |
- Note
- this variant is meant for observer objects implemented in other languages
◆ registerObserver() [2/2]
DataProvider::Observable::registerObserver |
( |
Observer |
observer | ) |
|
The method registers the given observer.
- Parameters
-
observer | the observer to be registered |
... | event IDs for notifications; if no additional arguments are passed, then the observer is notified for all events |
- Exceptions
-
EVENT-ERROR | type error; additional argument is not a string event ID |
◆ registerObserverWithFilter() [1/2]
DataProvider::Observable::registerObserverWithFilter |
( |
object |
observer, |
|
|
AbstractEventFilter |
filter |
|
) |
| |
The method registers the given observer.
- Parameters
-
observer | the observer to be registered |
filter | the filter object for events |
... | event IDs for notifications; if no additional arguments are passed, then the observer is notified for all events |
- Note
- this variant is meant for observer objects implemented in other languages
◆ registerObserverWithFilter() [2/2]
The method registers the given observer.
- Parameters
-
observer | the observer to be registered |
filter | the filter object for events |
... | event IDs for notifications; if no additional arguments are passed, then the observer is notified for all events |
- Exceptions
-
EVENT-ERROR | type error; additional argument is not a string event ID |