Public Member Functions | Private Attributes | List of all members
ecl::Signal< Void > Class Template Reference

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 std::string &topic)
 Creates a signal and connects. More...
 
 Signal (const Signal &signal)
 Copy constructor. More...
 
 ~Signal ()
 Default destructor. More...
 

Private Attributes

SigSlot< Void > * sigslot
 

Detailed Description

template<>
class ecl::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.

Definition at line 149 of file signal.hpp.

Constructor & Destructor Documentation

◆ Signal() [1/3]

ecl::Signal< Void >::Signal ( )
inline

Default constructor.

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

Definition at line 157 of file signal.hpp.

◆ Signal() [2/3]

ecl::Signal< Void >::Signal ( const std::string &  topic)
inline

Creates a signal and connects.

Definition at line 163 of file signal.hpp.

◆ Signal() [3/3]

ecl::Signal< Void >::Signal ( const Signal< Void > &  signal)
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.

Parameters
signal: the object to be copied.

Definition at line 178 of file signal.hpp.

◆ ~Signal()

ecl::Signal< Void >::~Signal ( )
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 189 of file signal.hpp.

Member Function Documentation

◆ connect()

void ecl::Signal< Void >::connect ( const std::string &  topic)
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.

Parameters
topic: the topic to connect to.

Definition at line 203 of file signal.hpp.

◆ connectAsSlot()

void ecl::Signal< Void >::connectAsSlot ( const std::string &  topic)
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.

Parameters
topic: the topic to connect to.

Definition at line 212 of file signal.hpp.

◆ disconnect()

void ecl::Signal< Void >::disconnect ( )
inline

Disconnect the signal from all topics.

This completely disconnects the signal.

Definition at line 218 of file signal.hpp.

◆ emit()

void ecl::Signal< Void >::emit ( )
inline

The primary purpose of the signal, to emit!

Emits a signal with no data.

Definition at line 225 of file signal.hpp.

Member Data Documentation

◆ sigslot

SigSlot<Void>* ecl::Signal< Void >::sigslot
private

Definition at line 228 of file signal.hpp.


The documentation for this class was generated from the following file:


ecl_sigslots
Author(s): Daniel Stonier
autogenerated on Thu Jun 6 2019 21:59:05