|
void | connect (const std::string &topic) |
| Make a connection to the specified topic. More...
|
|
const std::set< std::string > & | connections () |
| Lists the topics this slot is connected to. More...
|
|
void | disconnect () |
| Disconnect the slot from all topics. More...
|
|
| Slot (void(*f)(Data)) |
| Load with a global/static function. More...
|
|
| Slot (void(*f)(Data), const std::string &topic) |
| Load with a global/static function and connect. More...
|
|
template<typename C > |
| Slot (void(C::*f)(Data), C &c) |
| Load with a member function. More...
|
|
template<typename C > |
| Slot (void(C::*f)(Data), C &c, const std::string &topic) |
| Load with a member function and connect. More...
|
|
| Slot (const Slot &slot) |
| Copy constructor. More...
|
|
| ~Slot () |
| Default destructor. More...
|
|
template<typename Data = Void>
class ecl::Slot< Data >
Function loading component of a callback system.
Anywhere that a callback is required can be implemented with a slot. These can be placed anywhere in your code and are initialised with either a free (static or global) function, or a member function. Once initialised, they can be hooked up to a signal.
Usage examples are provided in the main page's documentation for this package.
- See also
- Signal<Void>, Slot.
Definition at line 48 of file slot.hpp.
template<typename Data = Void>
ecl::Slot< Data >::Slot |
( |
void(*)(Data) |
f, |
|
|
const std::string & |
topic |
|
) |
| |
|
inline |
Load with a global/static function and connect.
Note that the function must have exactly one argument and it must be of the same type as the slot. It also must return void.
It additionally connects to the specified topic rapi style.
- Parameters
-
f | : the global/static function. |
topic | : the slot topic name to connect to. |
Definition at line 72 of file slot.hpp.
template<typename Data = Void>
template<typename C >
ecl::Slot< Data >::Slot |
( |
void(C::*)(Data) |
f, |
|
|
C & |
c, |
|
|
const std::string & |
topic |
|
) |
| |
|
inline |
Load with a member function and connect.
Note that the function must have exactly one argument and it must be of the same type as the slot. It also must return void.
It additionally connects to the specified topic rapi style.
- Parameters
-
f | : the member function. |
c | : the class instance. |
topic | : the slot topic name to connect to. |
Definition at line 103 of file slot.hpp.