Static Public Member Functions | Private Types | Static Private Member Functions | Friends
ecl::SigSlotsManager< Data > Class Template Reference

The sigslots connection manager. More...

#include <manager.hpp>

List of all members.

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 >

Detailed Description

template<typename Data = Void>
class ecl::SigSlotsManager< 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.

Template Parameters:
Data: the type of sigslots this manager looks after.

Definition at line 48 of file manager.hpp.


Member Typedef Documentation

template<typename Data = Void>
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.


Member Function Documentation

template<typename Data = Void>
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.

Parameters:
topic: topic to publish to.
sigslot: sigslot that will be publishing.
Returns:
const Subscribers& : a reference to the subscriber list.

Definition at line 81 of file manager.hpp.

template<typename Data = Void>
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.

Parameters:
topic: topic to subscribe (listen) to.
sigslot: sigslot that will be subscribing (listening).

Definition at line 100 of file manager.hpp.

template<typename Data = Void>
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.

Parameters:
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.

template<typename Data = Void>
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).

Parameters:
topic: topic to check.
Returns:
bool : success/failure of the request.

Definition at line 135 of file manager.hpp.

template<typename Data = Void>
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.

template<typename Data = Void>
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.

Parameters:
topic: the topic to check for.
Returns:
Subscribers : a set of pointers to subscribers of a topic.

Definition at line 161 of file manager.hpp.

template<typename Data = Void>
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.

Returns:
map : a handle to the string id/topic database.

Definition at line 146 of file manager.hpp.


Friends And Related Function Documentation

template<typename Data = Void>
friend class SigSlot< Data > [friend]

Definition at line 51 of file manager.hpp.


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


ecl_sigslots
Author(s): Daniel Stonier
autogenerated on Thu Jan 2 2014 11:13:07