BasicEventManager Class
Basic implementation of the EventManager. More...
Declaration
Base class
| class | EventManager |
|
An abstract EventManager managing the buffering and dispatching of events, acting as a central hub for event management. More... | |
Public Constructors Index
| BasicEventManager (std::unique_ptr< EventQueue > eventQueue, std::unique_ptr< Dispatcher > dispatcher) | |
|
Constructs a new BasicEventManager, using the specified EventQueue and the Dispatcher. More... | |
Public Member Functions Index
| EventManager & | post (std::unique_ptr< const Event > event, PostPolicy policy, const std::function< bool(const std::unique_ptr< const Event > &event, const std::unique_ptr< const Event > &evt)> &func) override |
|
Posts an event based on the specified policy to the EventQueue. More... | |
| EventManager & | dispatchAll () override |
|
Dispatches all events of the queue, passing ownership to the underlying Dispatcher. Clears the underlying EventQueue. More... | |
| EventManager & | post (std::unique_ptr< const Event > event) |
|
Posts the event to the queue using the APPEND policy, passing ownership of the event to the underlying queue. More... | |
| EventManager & | post (std::unique_ptr< const Event > event, PostPolicy policy) |
|
Posts the event to the queue, passing ownership of the event to the underlying queue. More... | |
Description
Basic implementation of the EventManager.
This implementation provides the concrete logic for post() and dispatchAll().
Definition at line 29 of file BasicEventManager.ixx.
Public Constructors
BasicEventManager()
| inline explicit |
Constructs a new BasicEventManager, using the specified EventQueue and the Dispatcher.
- Parameters
-
eventQueue dispatcher
Definition at line 41 of file BasicEventManager.ixx.
References helios::event::EventManager::dispatcher and helios::event::EventManager::EventManager.
Public Member Functions
dispatchAll()
| inline virtual |
Dispatches all events of the queue, passing ownership to the underlying Dispatcher. Clears the underlying EventQueue.
- Returns
Definition at line 109 of file BasicEventManager.ixx.
References helios::event::EventManager::dispatcher_, helios::event::EventManager::EventManager and helios::event::EventManager::eventQueue_.
post()
| inline virtual |
Posts an event based on the specified policy to the EventQueue.
- Parameters
-
event A unique_ptr to the event that should be posted
policy The policy to use for positing the event.
func A comparison function for LATEST_WINS policy. If none is specified, this method will compare the events based on type and tag equality.
- Returns
Definition at line 57 of file BasicEventManager.ixx.
References helios::event::APPEND, helios::event::EventManager::EventManager, helios::event::EventManager::eventQueue_ and helios::event::LATEST_WINS.
post()
| inline |
Posts the event to the queue using the APPEND policy, passing ownership of the event to the underlying queue.
Calling this function is functionally identical to calling post() with the second argument set to APPEND.
- Parameters
-
event The event to post to the EventQueue.
- Returns
Declaration at line 32 of file BasicEventManager.ixx, definition at line 106 of file EventManager.ixx.
post()
| inline |
Posts the event to the queue, passing ownership of the event to the underlying queue.
Calling this function is identical to calling post() with the third argument func set to nullptr, relying on the default implementations.
- Parameters
-
event The event to post to the EventQueue.
policy The policy to use for posting the event.
- Returns
Declaration at line 32 of file BasicEventManager.ixx, definition at line 123 of file EventManager.ixx.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.