Specialised signal that emits without passing data. More...
#include <signal.hpp>
Public Member Functions | |
void | connect (const std::string &topic) |
Make a connection to the specified topic. More... | |
void | connectAsSlot (const std::string &topic) |
Connect as a slot, with the emit function loaded. More... | |
void | disconnect () |
Disconnect the signal from all topics. More... | |
void | emit () |
The primary purpose of the signal, to emit! More... | |
Signal () | |
Default constructor. More... | |
Signal (const Signal &signal) | |
Copy constructor. More... | |
Signal (const std::string &topic) | |
Creates a signal and connects. More... | |
~Signal () | |
Default destructor. More... | |
Private Attributes | |
SigSlot< Void > * | sigslot |
Specialised signal that emits without passing data.
Specialised signal that only emits a signal but passes no data to their respective slots. This is the default template construction for a signal, so you need only use Signal<> to represent the type.
Usage examples are provided in the main page's documentation for this package.
Definition at line 155 of file signal.hpp.
|
inline |
Default constructor.
This creates a signal but with no default connection. Use connect() to establish a connection.
Definition at line 165 of file signal.hpp.
|
inline |
Creates a signal and connects.
Definition at line 171 of file signal.hpp.
|
inline |
Copy constructor.
This is specially designed so that copying a signal is perfectly acceptable. Copies do not increase the number of emits that are fired - they just preserve the signal when used with things like stl containers. When the last copy disappears, the object destroys its connection automagically.
signal | : the object to be copied. |
Definition at line 186 of file signal.hpp.
|
inline |
Default destructor.
This handles the cleanup operation, first decrementing and then checking if its the last of its instance. If it is, it cleans up the sigslot connection with the sigslots manager.
Definition at line 197 of file signal.hpp.
|
inline |
Make a connection to the specified topic.
This contacts the sigslots manager to connect the signal to the specified topic - creating the topic if it is not yet existing.
topic | : the topic to connect to. |
Definition at line 211 of file signal.hpp.
|
inline |
Connect as a slot, with the emit function loaded.
This allows the signal to act as a relaying signal (effectively a slot with the emit() function loaded.
topic | : the topic to connect to. |
Definition at line 220 of file signal.hpp.
|
inline |
Disconnect the signal from all topics.
This completely disconnects the signal.
Definition at line 226 of file signal.hpp.
|
inline |
The primary purpose of the signal, to emit!
Emits a signal with no data.
Definition at line 233 of file signal.hpp.
|
private |
Definition at line 236 of file signal.hpp.