Static Public Attributes | Static Private Member Functions | Friends
ecl::lite::GlobalSlots< Data, Dummy > Class Template Reference

This is the global slot interface. More...

#include <managers.hpp>

List of all members.

Static Public Attributes

static const unsigned int capacity
 Number of global functions of this type that can be slotted.

Static Private Member Functions

static sigslots::GlobalSlot
< Data > * 
addSlot (void(*func)(Data))
 Add a slot.
static unsigned int stored (const bool increment=false)
 Number of slots currently stored.

Friends

template<typename Data_ , unsigned int Capacity_>
sigslots::Error connect (Signal< Data_, Capacity_ > &signal, void(*function)(Data_))
template<typename Data_ >
unsigned int global_slots_stored ()

Detailed Description

template<typename Data, typename Dummy = int>
class ecl::lite::GlobalSlots< Data, Dummy >

This is the global slot interface.

You'll need to preconfigure the capacity for this slot interface. Note that the capacity corresponds to the number of global functions with the specified footprint (Data arg), not the total number of slottable global functions overall.

 // reserve the number of global slots that you'll use.
 template<>
 const unsigned int ecl::lite::GlobalSlots<const char*>::capacity = 2;

 void f(const char* str) {
     std::cout << "f() " << str << std::endl;
 }

 void g(const char* str) {
           std::cout << "g() " << str << std::endl;
 }

 int main() {
     ecl::lite::Signal<const char*,2> signal;
     connect(signal,f);
     connect(signal,g);
     signal.emit("Dude");
Template Parameters:
Data: the footprint for the type of global functions to slot.
Dummy: dummy argument to enable capacity to be a const expr for array bounds

Definition at line 191 of file managers.hpp.


Member Function Documentation

template<typename Data , typename Dummy = int>
static sigslots::GlobalSlot<Data>* ecl::lite::GlobalSlots< Data, Dummy >::addSlot ( void(*)(Data)  func) [inline, static, private]

Add a slot.

This is used 'under the hood' by the connectors.

Parameters:
func: the function to slot.
Returns:
GlobalSlot* : a pointer to a global slot.

Definition at line 231 of file managers.hpp.

template<typename Data , typename Dummy = int>
static unsigned int ecl::lite::GlobalSlots< Data, Dummy >::stored ( const bool  increment = false) [inline, static, private]

Number of slots currently stored.

This is used for two purposes, 1) for recall and 2) to increment since it holds a static variable internally. This is triggered by the boolean argument which has a default value that can be hidden when doing 1).

Parameters:
increment: increment the storage value (called from addSlot)
Returns:
: number of slots currently stored.

Definition at line 218 of file managers.hpp.


Friends And Related Function Documentation

template<typename Data , typename Dummy = int>
template<typename Data_ , unsigned int Capacity_>
sigslots::Error connect ( Signal< Data_, Capacity_ > &  signal,
void(*)(Data_)  function 
) [friend]
template<typename Data , typename Dummy = int>
template<typename Data_ >
unsigned int global_slots_stored ( ) [friend]

Definition at line 29 of file utilities.hpp.


Member Data Documentation

template<typename Data , typename Dummy = int>
const unsigned int ecl::lite::GlobalSlots< Data, Dummy >::capacity [static]

Number of global functions of this type that can be slotted.

Definition at line 193 of file managers.hpp.


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


ecl_sigslots_lite
Author(s): Daniel Stonier
autogenerated on Sun Oct 5 2014 23:35:27