provides a lightweight signal / event system More...
#include <signal-signal.hpp>
Public Types | |
typedef function< void(const TArgs &...)> | Handler |
represents a function that can connect to the signal More... | |
Public Member Functions | |
Signal () | |
~Signal () | |
Connection | connect (const Handler &handler) |
connects a handler to the signal More... | |
Connection | connectSingleShot (const Handler &handler) |
connects a single-shot handler to the signal More... | |
provides a lightweight signal / event system
To declare a signal: public: Signal<Owner, T1, T2> signalName; To connect to a signal: owner->signalName.connect(f); Multiple functions can connect to the same signal. To emit a signal from owner: this->signalName(arg1, arg2);
Owner | the signal owner class; only this class can emit the signal |
TArgs | types of signal arguments |
Definition at line 50 of file signal-signal.hpp.
typedef function<void(const TArgs&...)> ndn::util::signal::Signal< Owner, TArgs >::Handler |
represents a function that can connect to the signal
Definition at line 55 of file signal-signal.hpp.
ndn::util::signal::Signal< Owner, TArgs >::Signal | ( | ) |
Definition at line 161 of file signal-signal.hpp.
ndn::util::signal::Signal< Owner, TArgs >::~Signal | ( | ) |
Definition at line 167 of file signal-signal.hpp.
|
inline |
connects a handler to the signal
Definition at line 174 of file signal-signal.hpp.
|
inline |
connects a single-shot handler to the signal
After the handler is executed once, it is automatically disconnected.
Definition at line 184 of file signal-signal.hpp.