#include <eventbus.h>
Public Member Functions | |
| void | registerBusObserver (BusObserver &observer, BusEvent::EVENT_TYPE event_type) |
| Register a BusObserver in the EventBus. | |
| void | removeBusObserver (BusObserver &observer) |
| Removes an observer from the observers lists. | |
| void | sendBusEvent (auto_ptr< BusEvent > event) |
| Sends a new Event in the EventBus. | |
Static Public Member Functions | |
| static EventBus & | getInstance () |
| Gets the unique EventBus instance. | |
Protected Member Functions | |
| EventBus () | |
| Creates a new EventBus. | |
Protected Attributes | |
|
map< BusEvent::EVENT_TYPE, BusObserverVector > | event_observers |
| Registered observers collection by Event type. | |
| auto_ptr< Mutex > | map_mutex |
| Mutex to protect observers collection. | |
Static Protected Attributes | |
| static EventBus * | instance |
| Unique EventBus instance. | |
It follows the Singleton design pattern.
| EventBus & openikev2::EventBus::getInstance | ( | ) | [static] |
| void openikev2::EventBus::registerBusObserver | ( | BusObserver & | observer, | |
| BusEvent::EVENT_TYPE | event_type | |||
| ) |
Register a BusObserver in the EventBus.
| observer | BusObserver to be registered | |
| event_type | Type of the events observer wants to receive |
| void openikev2::EventBus::removeBusObserver | ( | BusObserver & | observer | ) |
Removes an observer from the observers lists.
Note that object will not be deleted.
| observer | Observer to be removed |
| void openikev2::EventBus::sendBusEvent | ( | auto_ptr< BusEvent > | event | ) |
Sends a new Event in the EventBus.
All the registered observers will be notified.
| event | Notified Event |
1.5.1