Template Class Signal< Void >

Class Documentation

template<>
class Signal<Void>

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.

See also

Signal, Slot.

Public Functions

inline Signal()

Default constructor.

This creates a signal but with no default connection. Use connect() to establish a connection.

inline Signal(const std::string &topic)

Creates a signal and connects.

inline Signal(const Signal<Void> &signal)

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.

Parameters

signal – : the object to be copied.

inline void operator=(const Signal<Void> &signal)

Default assignment operator.

inline ~Signal()

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.

inline void connect(const std::string &topic)

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.

Parameters

topic – : the topic to connect to.

inline void connectAsSlot(const std::string &topic)

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.

Parameters

topic – : the topic to connect to.

inline void disconnect()

Disconnect the signal from all topics.

This completely disconnects the signal.

inline void emit()

The primary purpose of the signal, to emit!

Emits a signal with no data.