Protected Member Functions | Private Member Functions | Private Attributes | Friends
ecl::lite::MemberSlots< Data, FunctionClass, Capacity > Class Template Reference

This is the member slot interface, inheritable by classes. More...

#include <managers.hpp>

Inheritance diagram for ecl::lite::MemberSlots< Data, FunctionClass, Capacity >:
Inheritance graph
[legend]

List of all members.

Protected Member Functions

 MemberSlots ()

Private Member Functions

sigslots::MemberSlot< Data,
FunctionClass > * 
addSlot (void(FunctionClass::*func)(Data), FunctionClass &instance)
 Add a slot.
unsigned int capacity () const
 The number of slots that can be attached to member functions.
unsigned int stored () const
 The number of slots stored.

Private Attributes

unsigned int size
sigslots::MemberSlot< Data,
FunctionClass > 
slots [Capacity]

Friends

template<typename Data_ , unsigned int Capacity_, typename FunctionClass_ >
sigslots::Error connect (Signal< Data_, Capacity_ > &signal, void(FunctionClass_::*f)(Data_), FunctionClass_ &o)
template<typename Data_ , typename FunctionClass_ >
unsigned int member_slots_capacity (const FunctionClass_ &object)
template<typename Data_ , typename FunctionClass_ >
unsigned int member_slots_stored (const FunctionClass_ &object)

Detailed Description

template<typename Data, typename FunctionClass, unsigned int Capacity = 1>
class ecl::lite::MemberSlots< Data, FunctionClass, Capacity >

This is the member slot interface, inheritable by classes.

To enable slots for your class, simply inherit this interface.

 class Foo : public ecl::lite::MemberSlots<const char*,Foo> {
 public:
           void f(const char* str) {
                   std::cout << "Foo::f() " << str << std::endl;
           }
 };

 int main() {
     Foo foo;
     ecl::lite::Signal<const char*> signal;
     connect(signal,&Foo::f,foo);
     signal.emit("Dude");
Template Parameters:
Data: the footprint for the member function to slot.
FunctionClass: the class it will provide slots for.
Capacity: the number of functions from FunctionClass you'll slot.

Definition at line 91 of file managers.hpp.


Constructor & Destructor Documentation

template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::MemberSlots ( ) [inline, protected]

Definition at line 110 of file managers.hpp.


Member Function Documentation

template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
sigslots::MemberSlot<Data,FunctionClass>* ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::addSlot ( void(FunctionClass::*)(Data)  func,
FunctionClass &  instance 
) [inline, private, virtual]

Add a slot.

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

Parameters:
func: the function to slot.
instance: the class instance associated with the function.
Returns:
MemberSlot* : a pointer to a member slot.

Implements ecl::lite::sigslots::MemberSlotsBase< Data, FunctionClass >.

Definition at line 135 of file managers.hpp.

template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
unsigned int ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::capacity ( ) const [inline, private, virtual]

The number of slots that can be attached to member functions.

Returns:
unsigned int : the maximum capacity.

Reimplemented from ecl::lite::sigslots::MemberSlotsBase< Data, FunctionClass >.

Definition at line 124 of file managers.hpp.

template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
unsigned int ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::stored ( ) const [inline, private, virtual]

The number of slots stored.

Returns:
unsigned int : storage size.

Reimplemented from ecl::lite::sigslots::MemberSlotsBase< Data, FunctionClass >.

Definition at line 118 of file managers.hpp.


Friends And Related Function Documentation

template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
template<typename Data_ , unsigned int Capacity_, typename FunctionClass_ >
sigslots::Error connect ( Signal< Data_, Capacity_ > &  signal,
void(FunctionClass_::*)(Data_)  f,
FunctionClass_ &  o 
) [friend]
template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
template<typename Data_ , typename FunctionClass_ >
unsigned int member_slots_capacity ( const FunctionClass_ &  object) [friend]
template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
template<typename Data_ , typename FunctionClass_ >
unsigned int member_slots_stored ( const FunctionClass_ &  object) [friend]

Member Data Documentation

template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
unsigned int ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::size [private]

Definition at line 150 of file managers.hpp.

template<typename Data , typename FunctionClass , unsigned int Capacity = 1>
sigslots::MemberSlot<Data,FunctionClass> ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::slots[Capacity] [private]

Definition at line 151 of file managers.hpp.


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


ecl_sigslots_lite
Author(s): Daniel Stonier
autogenerated on Thu Jun 16 2016 09:47:16