provides a lightweight signal / event system More...
#include <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 (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 51 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 56 of file signal.hpp.
ndn::util::signal::Signal< Owner, TArgs >::Signal |
Definition at line 148 of file signal.hpp.
ndn::util::signal::Signal< Owner, TArgs >::~Signal |
Definition at line 154 of file signal.hpp.
Connection ndn::util::signal::Signal< Owner, TArgs >::connect | ( | Handler | handler | ) |
connects a handler to the signal
Definition at line 161 of file signal.hpp.
References ndn::util::signal::Connection::disconnect().
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 171 of file signal.hpp.
References ndn::util::signal::Connection::disconnect(), and nonstd::optional_lite::std11::move().