provides a lightweight signal / event system More...
#include <signal.hpp>
Inherits noncopyable.
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 (Handler handler) |
connects a handler to the signal More... | |
Connection | connectSingleShot (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 52 of file 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 57 of file signal.hpp.
ndn::util::signal::Signal< Owner, TArgs >::Signal | ( | ) |
Definition at line 149 of file signal.hpp.
ndn::util::signal::Signal< Owner, TArgs >::~Signal | ( | ) |
Definition at line 155 of file signal.hpp.
Connection ndn::util::signal::Signal< Owner, TArgs >::connect | ( | Handler | handler | ) |
connects a handler to the signal
Definition at line 162 of file signal.hpp.
Connection ndn::util::signal::Signal< Owner, TArgs >::connectSingleShot | ( | Handler | handler | ) |
connects a single-shot handler to the signal
After the handler is executed once, it is automatically disconnected.
Definition at line 172 of file signal.hpp.