This is the member slot interface, inheritable by classes. More...
#include <managers.hpp>
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) |
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");
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.
ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::MemberSlots | ( | ) | [inline, protected] |
Definition at line 110 of file managers.hpp.
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.
func | : the function to slot. |
instance | : the class instance associated with the function. |
Implements ecl::lite::sigslots::MemberSlotsBase< Data, FunctionClass >.
Definition at line 135 of file managers.hpp.
unsigned int ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::capacity | ( | ) | const [inline, private, virtual] |
The number of slots that can be attached to member functions.
Reimplemented from ecl::lite::sigslots::MemberSlotsBase< Data, FunctionClass >.
Definition at line 124 of file managers.hpp.
unsigned int ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::stored | ( | ) | const [inline, private, virtual] |
The number of slots stored.
Reimplemented from ecl::lite::sigslots::MemberSlotsBase< Data, FunctionClass >.
Definition at line 118 of file managers.hpp.
sigslots::Error connect | ( | Signal< Data_, Capacity_ > & | signal, |
void(FunctionClass_::*)(Data_) | f, | ||
FunctionClass_ & | o | ||
) | [friend] |
unsigned int member_slots_capacity | ( | const FunctionClass_ & | object | ) | [friend] |
unsigned int member_slots_stored | ( | const FunctionClass_ & | object | ) | [friend] |
unsigned int ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::size [private] |
Definition at line 150 of file managers.hpp.
sigslots::MemberSlot<Data,FunctionClass> ecl::lite::MemberSlots< Data, FunctionClass, Capacity >::slots[Capacity] [private] |
Definition at line 151 of file managers.hpp.