Template Class GlobalSlots

Class Documentation

template<typename Data, typename Dummy = int>
class GlobalSlots

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

Public Static Attributes

static const unsigned int capacity

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

Friends

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