The sigslots connection manager. More...
#include <manager.hpp>
Static Public Member Functions | |
static void | printStatistics () |
Print some statistics on the current status of the manager. | |
Private Types | |
typedef Topic< Data >::Subscribers | Subscribers |
A list of subscribers (slots) to a given topic. | |
Static Private Member Functions | |
static const Subscribers * | connectSignal (const std::string &topic, SigSlot< Data > *sigslot) |
static void | connectSlot (const std::string &topic, SigSlot< Data > *sigslot) |
static void | disconnect (const std::string &topic, SigSlot< Data > *sigslot) |
Disconnect the sigslot from the specified topic. | |
static bool | isTopic (const std::string &topic) |
Check to see if the specified topic exists (and is being used). | |
static const Subscribers & | subscribers (const std::string &topic) |
Provides a list of subscribers (listeners) associated with a topic. | |
static std::map< std::string, Topic< Data > > & | topics () |
Hack to create a static variable internally without. | |
Friends | |
class | SigSlot< Data > |
The sigslots connection manager.
This handles all the connections via the unique string identifiers. It does this invisibly, so the programmer need not actually have to use this class. However, it may be useful for debugging to actually check the number of connections with the printStatistics() method.
Data | : the type of sigslots this manager looks after. |
Definition at line 49 of file manager.hpp.
typedef Topic<Data>::Subscribers ecl::SigSlotsManager< Data >::Subscribers [private] |
A list of subscribers (slots) to a given topic.
Definition at line 71 of file manager.hpp.
static const Subscribers* ecl::SigSlotsManager< Data >::connectSignal | ( | const std::string & | topic, |
SigSlot< Data > * | sigslot | ||
) | [inline, static, private] |
Connects the signal to the topic if it already exists, or creates the topic if it doesn't. Returns the subscriber list which is used by sigslot to bypass the manager when emitting.
topic | : topic to publish to. |
sigslot | : sigslot that will be publishing. |
Definition at line 82 of file manager.hpp.
static void ecl::SigSlotsManager< Data >::connectSlot | ( | const std::string & | topic, |
SigSlot< Data > * | sigslot | ||
) | [inline, static, private] |
Connects the slot to the topic if it already exists, or creates the topic if it doesn't.
topic | : topic to subscribe (listen) to. |
sigslot | : sigslot that will be subscribing (listening). |
Definition at line 101 of file manager.hpp.
static void ecl::SigSlotsManager< Data >::disconnect | ( | const std::string & | topic, |
SigSlot< Data > * | sigslot | ||
) | [inline, static, private] |
Disconnect the sigslot from the specified topic.
This disconnection works for both signals and slots.
topic | : topic that the sigslot must be disconnected from. |
sigslot | : the sigslots that is to be disconnected. |
Definition at line 120 of file manager.hpp.
static bool ecl::SigSlotsManager< Data >::isTopic | ( | const std::string & | topic | ) | [inline, static, private] |
Check to see if the specified topic exists (and is being used).
topic | : topic to check. |
Definition at line 136 of file manager.hpp.
static void ecl::SigSlotsManager< Data >::printStatistics | ( | ) | [inline, static] |
Print some statistics on the current status of the manager.
Only here for debugging purposes only.
Definition at line 59 of file manager.hpp.
static const Subscribers& ecl::SigSlotsManager< Data >::subscribers | ( | const std::string & | topic | ) | [inline, static, private] |
Provides a list of subscribers (listeners) associated with a topic.
This provides a handle to the list of subscribers to a topic. Used by the signals to keep track of who's following them and who to run when emitting.
topic | : the topic to check for. |
Definition at line 162 of file manager.hpp.
static std::map< std::string, Topic<Data> >& ecl::SigSlotsManager< Data >::topics | ( | ) | [inline, static, private] |
Hack to create a static variable internally without.
Simple trick to avoid the explicit instantiation in a library.
Definition at line 147 of file manager.hpp.
friend class SigSlot< Data > [friend] |
Definition at line 52 of file manager.hpp.