Not for direct use, provides the power behind both void signals and slots. More...
#include <sigslot.hpp>
Public Types | |
typedef std::map< std::string, const Subscribers * > | PublicationMap |
Stores publishing topics and their followers. | |
typedef Topic< Void >::Subscribers | Subscribers |
A list of subscribers (slots) to a given topic. | |
Public Member Functions | |
void | connectSignal (const std::string &topic) |
Connect a signal to the specified topic. | |
void | connectSlot (const std::string &topic) |
Connect a slot to the specified topic. | |
void | decrHandles () |
Decrement the counter for the number of copies of this object. | |
void | disconnect (const std::string &topic) |
Disconnect the sigslot from the specified topic. | |
void | disconnect () |
Disconnect the sigslot from all topics. | |
void | emit () |
Emit a signal. | |
const unsigned int & | handles () const |
Number of copies of this object. | |
void | incrHandles () |
Increment the counter for the number of copies of this object. | |
void | process (Void void_arg=Void()) |
Process the callback function loaded into this sigslot. | |
SigSlot () | |
SigSlot (VoidFunction f) | |
template<typename C > | |
SigSlot (void(C::*f)(void), C &c) | |
~SigSlot () | |
Disconnects the sigslot completely. | |
Private Attributes | |
NullaryFunction< void > * | function |
Mutex | mutex |
unsigned int | number_of_handles |
unsigned int | processing_count |
PublicationMap | publications |
std::set< std::string > | subscriptions |
Not for direct use, provides the power behind both void signals and slots.
This is the workhorse for both signals and slots, providing the implementation for all the functions necessary by both types of frontends. This is the specialisation of the general case for void callbacks.
Definition at line 238 of file sigslot.hpp.
typedef std::map<std::string, const Subscribers*> ecl::SigSlot< Void >::PublicationMap |
Stores publishing topics and their followers.
Definition at line 242 of file sigslot.hpp.
typedef Topic<Void>::Subscribers ecl::SigSlot< Void >::Subscribers |
A list of subscribers (slots) to a given topic.
Definition at line 241 of file sigslot.hpp.
ecl::SigSlot< Void >::SigSlot | ( | ) | [inline] |
Used only by signals where the function callback automatically defaults to the emit() function.
Definition at line 248 of file sigslot.hpp.
ecl::SigSlot< Void >::SigSlot | ( | VoidFunction | f | ) | [inline] |
Used by slots loading global or static functions.
f | : the global/static function. |
Definition at line 256 of file sigslot.hpp.
ecl::SigSlot< Void >::SigSlot | ( | void(C::*)(void) | f, |
C & | c | ||
) | [inline] |
Used by slots loading a member function.
f | : the member function to load. |
c | : the instance for the member function's class. |
C | : the member function's class type. |
Definition at line 267 of file sigslot.hpp.
ecl::SigSlot< Void >::~SigSlot | ( | ) |
Disconnects the sigslot completely.
This is a rather elaborate process, it must first disconnect from any signals to ensure no new callbacks are instantiated, then check to see that there are no callbacks actually running, block if so, then finalise any deletions.
Definition at line 37 of file sigslot.cpp.
void ecl::SigSlot< Void >::connectSignal | ( | const std::string & | topic | ) |
Connect a signal to the specified topic.
If the topic doesn't exist, it will be created and the signal connected. If it does exist, it will connect with a set of slots also currently linked to the topic.
Definition at line 65 of file sigslot.cpp.
void ecl::SigSlot< Void >::connectSlot | ( | const std::string & | topic | ) |
Connect a slot to the specified topic.
Definition at line 77 of file sigslot.cpp.
void ecl::SigSlot< Void >::decrHandles | ( | ) | [inline] |
Decrement the counter for the number of copies of this object.
Definition at line 282 of file sigslot.hpp.
void ecl::SigSlot< Void >::disconnect | ( | const std::string & | topic | ) |
Disconnect the sigslot from the specified topic.
If the topic doesn't exist, it will be created and the slot connected. If it does exist, it will pass on its link details to any signals also connected to the topic.
Definition at line 84 of file sigslot.cpp.
void ecl::SigSlot< Void >::disconnect | ( | ) |
Disconnect the sigslot from all topics.
This completely disconnects the sigslot.
Definition at line 90 of file sigslot.cpp.
void ecl::SigSlot< Void >::emit | ( | ) |
Emit a signal.
This is used by signals when emitting to slots.
Definition at line 43 of file sigslot.cpp.
const unsigned int& ecl::SigSlot< Void >::handles | ( | ) | const [inline] |
Number of copies of this object.
Definition at line 280 of file sigslot.hpp.
void ecl::SigSlot< Void >::incrHandles | ( | ) | [inline] |
Increment the counter for the number of copies of this object.
Definition at line 281 of file sigslot.hpp.
void ecl::SigSlot< Void >::process | ( | Void | void_arg = Void() | ) |
Process the callback function loaded into this sigslot.
This is used by slots with their loaded functions or relaying signals with their emit() methods.
Definition at line 55 of file sigslot.cpp.
NullaryFunction<void>* ecl::SigSlot< Void >::function [private] |
Definition at line 331 of file sigslot.hpp.
Mutex ecl::SigSlot< Void >::mutex [private] |
Definition at line 325 of file sigslot.hpp.
unsigned int ecl::SigSlot< Void >::number_of_handles [private] |
Definition at line 327 of file sigslot.hpp.
unsigned int ecl::SigSlot< Void >::processing_count [private] |
Definition at line 326 of file sigslot.hpp.
PublicationMap ecl::SigSlot< Void >::publications [private] |
Definition at line 329 of file sigslot.hpp.
std::set<std::string> ecl::SigSlot< Void >::subscriptions [private] |
Definition at line 328 of file sigslot.hpp.