provides a lightweight event system More...
#include <event-emitter.hpp>


Public Types | |
| typedef function< void(const TArgs &...)> | Handler |
| represents a handler that can subscribe to the event More... | |
Public Member Functions | |
| void | operator+= (const Handler &handler) |
| subscribes to the event More... | |
| bool | isEmpty () const |
| void | clear () |
| clears all subscriptions More... | |
| void | operator() (const TArgs &...args) const |
| triggers the event More... | |
provides a lightweight event system
To declare an event: EventEmitter<TArgs> onEventName; To subscribe to an event: eventSource->onEventName += eventHandler; Multiple functions can subscribe to the same event. To trigger an event: onEventName(args); To clear event subscriptions: onEventName.clear();
Definition at line 47 of file event-emitter.hpp.
| typedef function<void(const TArgs&...)> ndn::util::EventEmitter< TArgs >::Handler |
represents a handler that can subscribe to the event
Definition at line 52 of file event-emitter.hpp.
|
inline |
subscribes to the event
Definition at line 80 of file event-emitter.hpp.
|
inline |
Definition at line 87 of file event-emitter.hpp.
|
inline |
clears all subscriptions
Definition at line 94 of file event-emitter.hpp.
|
inline |
triggers the event
Definition at line 101 of file event-emitter.hpp.