#include <Events.hpp>
EventDispatcher is the interface of a very simple event dispatcher.
virtual void ldaplusplus::events::EventDispatcherInterface::add_listener |
( |
std::shared_ptr< EventListenerInterface > |
listener | ) |
|
|
pure virtual |
std::shared_ptr<EventListenerInterface> ldaplusplus::events::EventDispatcherInterface::add_listener |
( |
std::function< void(std::shared_ptr< Event >)> |
listener | ) |
|
|
inline |
Create on the fly a listener from the function and add it to the dispatcher.
The created object is returned so that the listener can be removed later.
- Parameters
-
listener | A function implementing the EventListener interface. |
template<class ListenerType , typename... Args>
std::shared_ptr<EventListenerInterface> ldaplusplus::events::EventDispatcherInterface::add_listener |
( |
Args... |
args | ) |
|
|
inline |
Create on the fly a listener of type ListenerType and add it to the dispatcher.
The created object is returned so that the listener can be removed later.
- Parameters
-
args | Variadic template arguments to be expanded as constructor parameters for the listener |
virtual void ldaplusplus::events::EventDispatcherInterface::dispatch |
( |
std::shared_ptr< Event > |
event | ) |
|
|
pure virtual |
template<class EventType , typename... Args>
void ldaplusplus::events::EventDispatcherInterface::dispatch |
( |
Args... |
args | ) |
|
|
inline |
Create on the fly an event object and dispatch it.
- Parameters
-
args | Variadic template arguments to be expanded as constructor parameters for the event |
virtual void ldaplusplus::events::EventDispatcherInterface::remove_listener |
( |
std::shared_ptr< EventListenerInterface > |
listener | ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: