Public Member Functions | Private Attributes
ecl::Slot< Void > Class Template Reference

Specialised slot that handles void callbacks. More...

#include <slot.hpp>

List of all members.

Public Member Functions

void connect (const std::string &topic)
 Make a connection to the specified topic.
void disconnect ()
 Disconnect the slot from all topics.
 Slot (VoidFunction f)
 Load with a global/static function.
 Slot (VoidFunction f, const std::string &topic)
 Load with a global/static function and connect.
template<typename C >
 Slot (void(C::*f)(void), C &c)
 Load with a member function.
template<typename C >
 Slot (void(C::*f)(void), C &c, const std::string &topic)
 Load with a member function and connect.
 Slot (const Slot &slot)
 Copy constructor.
 ~Slot ()
 Default destructor.

Private Attributes

SigSlot< Void > * sigslot

Detailed Description

template<>
class ecl::Slot< Void >

Specialised slot that handles void callbacks.

Specialised signal that works with void function callbacks.

Usage examples are provided in the main page's documentation for this package.

See also:
Signal, Slot.

Definition at line 177 of file slot.hpp.


Constructor & Destructor Documentation

ecl::Slot< Void >::Slot ( VoidFunction  f) [inline]

Load with a global/static function.

Note that the function must have zero arguments and it must return void.

Parameters:
f: the global/static function.

Definition at line 187 of file slot.hpp.

ecl::Slot< Void >::Slot ( VoidFunction  f,
const std::string &  topic 
) [inline]

Load with a global/static function and connect.

Note that the function must have zero arguments and it must return void.

Parameters:
f: the global/static function.
topic: the slot topic name to connect to.

Definition at line 199 of file slot.hpp.

template<typename C >
ecl::Slot< Void >::Slot ( void(C::*)(void)  f,
C &  c 
) [inline]

Load with a member function.

Note that the function must have zero arguments and it must return void.

Parameters:
f: the member function.
c: the class instance.

Definition at line 213 of file slot.hpp.

template<typename C >
ecl::Slot< Void >::Slot ( void(C::*)(void)  f,
C &  c,
const std::string &  topic 
) [inline]

Load with a member function and connect.

Note that the function must have zero arguments and it must return void.

Parameters:
f: the member function.
c: the class instance.
topic: the slot topic name to connect to.

Definition at line 227 of file slot.hpp.

ecl::Slot< Void >::Slot ( const Slot< Void > &  slot) [inline]

Copy constructor.

This is specially designed so that copying a slot is perfectly acceptable. Copies do not increase the number of callbacks that are fired - they just preserve the slot when used with things like stl containers. When the last copy disappears, the object destroys its connection automagically.

Parameters:
slot: the object to be copied.

Definition at line 242 of file slot.hpp.

ecl::Slot< Void >::~Slot ( ) [inline]

Default destructor.

This handles the cleanup operation, first decrementing and then checking if its the last of its instance. If it is, it cleans up the sigslot connection with the sigslots manager.

Definition at line 253 of file slot.hpp.


Member Function Documentation

void ecl::Slot< Void >::connect ( const std::string &  topic) [inline]

Make a connection to the specified topic.

This contacts the sigslots manager to connect the signal to the specified topic - creating the topic if it is not yet existing.

Parameters:
topic: the topic to connect to.

Definition at line 267 of file slot.hpp.

void ecl::Slot< Void >::disconnect ( ) [inline]

Disconnect the slot from all topics.

This completely disconnects the slot.

Definition at line 273 of file slot.hpp.


Member Data Documentation

SigSlot<Void>* ecl::Slot< Void >::sigslot [private]

Definition at line 276 of file slot.hpp.


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


ecl_sigslots
Author(s): Daniel Stonier
autogenerated on Sun Oct 5 2014 23:35:39