properties-cpp 0.0.1
A very simple convenience library for handling properties and signals in C++11.
|
A signal class that observers can subscribe to. More...
#include <signal.h>
Public Types | |
typedef std::function< void(Arguments...)> | Slot |
Slot is the function type that observers have to provide to connect to this signal. | |
Public Member Functions | |
Signal () noexcept(true) | |
Signal constructs a new instance. Never throws. | |
~Signal () | |
Signal (const Signal &)=delete | |
Signal & | operator= (const Signal &)=delete |
bool | operator== (const Signal &) const =delete |
Connection | connect (const Slot &slot) const |
Connects the provided slot to this signal instance. | |
void | operator() (Arguments... args) |
operator () emits the signal with the provided parameters. | |
A signal class that observers can subscribe to.
Arguments | List of argument types passed on to observers when the signal is emitted. |
typedef std::function<void(Arguments...)> core::Signal< Arguments >::Slot |
|
inlinenoexcept |
|
inline |
|
delete |
|
inline |
Connects the provided slot to this signal instance.
Calling this method is thread-safe and synchronized with any other connect, signal emission or disconnect calls.
slot | The function to be called when the signal is emitted. |
Definition at line 86 of file signal.h.
Referenced by TEST().
|
inline |
operator () emits the signal with the provided parameters.
Please note that signal emissions might not be delivered immediately to registered slots, depending on whether the respective connection is dispatched via a queueing dispatcher. For that reason, the lifetime of the arguments has to exceed the scope of the call to this operator and its surrounding scope.
args | The arguments to be passed on to registered slots. |
|
delete |
|
delete |