The sigslots connection manager. More...
#include <manager.hpp>
Static Public Member Functions | |
static ECL_PUBLIC 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 ECL_LOCAL const Subscribers * | connectSignal (const std::string &topic, SigSlot< Data > *sigslot) |
static ECL_LOCAL void | connectSlot (const std::string &topic, SigSlot< Data > *sigslot) |
static ECL_LOCAL void | disconnect (const std::string &topic, SigSlot< Data > *sigslot) |
Disconnect the sigslot from the specified topic. | |
static ECL_LOCAL bool | isTopic (const std::string &topic) |
Check to see if the specified topic exists (and is being used). | |
static ECL_LOCAL const Subscribers & | subscribers (const std::string &topic) |
Provides a list of subscribers (listeners) associated with a topic. | |
static ECL_PUBLIC 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 48 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 70 of file manager.hpp.
static ECL_LOCAL 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 81 of file manager.hpp.
static ECL_LOCAL 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 100 of file manager.hpp.
static ECL_LOCAL 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 119 of file manager.hpp.
static ECL_LOCAL 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 135 of file manager.hpp.
static ECL_PUBLIC 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 58 of file manager.hpp.
static ECL_LOCAL 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 161 of file manager.hpp.
static ECL_PUBLIC 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 146 of file manager.hpp.
friend class SigSlot< Data > [friend] |
Definition at line 51 of file manager.hpp.