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 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 SubscribersconnectSignal (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 Subscriberssubscribers (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 >

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 49 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 71 of file manager.hpp.


Member Function Documentation

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

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

Definition at line 82 of file manager.hpp.

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

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

Definition at line 101 of file manager.hpp.

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

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

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

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

Definition at line 136 of file manager.hpp.

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

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

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

Definition at line 162 of file manager.hpp.

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

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

Definition at line 147 of file manager.hpp.


Friends And Related Function Documentation

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

Definition at line 52 of file manager.hpp.


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


ecl_sigslots
Author(s): Daniel Stonier
autogenerated on Wed Aug 26 2015 11:27:23