12 #ifndef ECL_SIGSLOTS_LITE_MANAGERS_HPP_ 13 #define ECL_SIGSLOTS_LITE_MANAGERS_HPP_ 32 template <
typename Data,
unsigned int Capacity>
class Signal;
42 template <
typename Data,
typename FunctionClass>
45 virtual unsigned int stored()
const {
return 0; }
46 virtual unsigned int capacity()
const {
return 0; }
53 template <
typename FunctionClass>
56 virtual unsigned int stored()
const {
return 0; }
57 virtual unsigned int capacity()
const {
return 0; }
90 template <
typename Data,
typename FunctionClass,
unsigned int Capacity = 1>
97 template <
typename Data_,
unsigned int Capacity_,
typename FunctionClass_>
101 template <
typename Data_,
typename FunctionClass_>
105 template <
typename Data_,
typename FunctionClass_>
118 unsigned int stored()
const {
return size; }
136 for (
unsigned int i = 0; i < size; ++i ) {
137 if ( func == slots[i].member_function ) {
141 if ( size < Capacity ) {
144 return &(slots[size-1]);
190 template <
typename Data,
typename Dummy =
int>
199 template <
typename Data_,
unsigned int Capacity_>
203 template <
typename Data_>
218 static unsigned int stored(
const bool increment =
false) {
219 static unsigned int stored_slots = 0;
220 if ( increment ) { ++stored_slots; }
232 unsigned int size =
stored();
234 for (
unsigned int i = 0; i < size; ++i ) {
235 if ( func == slots[i].global_function ) {
239 if ( size < capacity ) {
243 return &(slots[size]);
256 template <
typename FunctionClass,
unsigned int Capacity>
263 template <
unsigned int Capacity_,
typename FunctionClass_>
266 template <
typename Data_,
typename FunctionClass_>
270 template <
typename Data_,
typename FunctionClass_>
282 unsigned int stored()
const {
return size; }
301 for (
unsigned int i = 0; i < size; ++i ) {
302 if ( func == slots[i].member_function ) {
306 if ( size < Capacity ) {
309 return &(slots[size-1]);
324 template <
typename Dummy>
334 template <
unsigned int Capacity_>
352 static unsigned int stored(
const bool increment =
false) {
353 static unsigned int stored_slots = 0;
354 if ( increment ) { ++stored_slots; }
367 unsigned int size =
stored();
369 for (
unsigned int i = 0; i < size; ++i ) {
370 if ( func == slots[i].global_function ) {
374 if ( size < capacity ) {
378 return &(slots[size]);
A slot with global/static callback function.
static unsigned int stored(const bool increment=false)
Number of slots currently stored.
virtual unsigned int stored() const
unsigned int capacity() const
The number of slots that can be attached to member functions.
Used internally to retrieve info about members lots.
static const unsigned int capacity
Number of global void functions that can be slotted.
A slot with member callback function.
This is the global slot interface.
static sigslots::GlobalSlot< void > * addSlot(void(*func)(void))
Add a slot.
ecl::lite::sigslots::Error connect(ecl::lite::Signal< Data, Capacity > &signal, MemberSlot< Data, FunctionClass > &slot)
Internal worker used to connect a signal with a slot.
virtual unsigned int stored() const
A slot with member callback function.
static sigslots::GlobalSlot< Data > * addSlot(void(*func)(Data))
Add a slot.
virtual sigslots::MemberSlot< Data, FunctionClass > * addSlot(void(FunctionClass::*func)(Data), FunctionClass &instance)=0
unsigned int member_slots_capacity(const FunctionClass &object)
Extends the generic ecl error handler with some time specific error strings.
virtual unsigned int capacity() const
This is the member slot interface, inheritable by classes.
virtual unsigned int capacity() const
static const unsigned int capacity
Number of global functions of this type that can be slotted.
A slot with global/static callback function.
sigslots::MemberSlot< void, FunctionClass > * addSlot(void(FunctionClass::*func)(void), FunctionClass &instance)
Add a slot.
unsigned int member_slots_stored(const FunctionClass &object)
unsigned int capacity() const
The number of slots that can be attached to member functions.
static unsigned int stored(const bool increment=false)
Number of slots currently stored.
unsigned int global_slots_stored()
sigslots::MemberSlot< Data, FunctionClass > * addSlot(void(FunctionClass::*func)(Data), FunctionClass &instance)
Add a slot.
unsigned int stored() const
The number of slots stored.
Simple slots - these are actually all hidden from the user.
unsigned int stored() const
The number of slots stored.