NAP
Public Types | Public Member Functions | List of all members
Slot< Args > Class Template Reference

Slot. More...

#include <nap/signalslot.h>

Public Types

using Function = std::function< void(Args... args)>
 

Public Member Functions

 Slot ()=default
 
 Slot (Function inFunction)
 
template<typename U , typename F >
 Slot (U *parent, F memberFunction)
 
template<typename U , typename F >
 Slot (U *parent, F memberFunction, Signal< Args... > &signal)
 
 ~Slot ()
 
void disconnect ()
 
void setFunction (Function func)
 
void trigger (Args... args)
 
void copyCauses (const Slot &rhs)
 

Description

template<typename... Args>
class nap::Slot< Args >

Slot.

A slot manages a function call that can be connected to a signal. A slot hides the connect / disconnect behavior of an event.

Member Typedef Documentation

◆ Function

using Function = std::function<void(Args... args)>

Constructor & Destructor Documentation

◆ Slot() [1/4]

Slot ( )
default

◆ Slot() [2/4]

Slot ( Function  inFunction)

◆ Slot() [3/4]

Slot ( U *  parent,
memberFunction 
)

This templated constructor can be used to initialize the slot with a member function with one single parameter

◆ Slot() [4/4]

Slot ( U *  parent,
memberFunction,
Signal< Args... > &  signal 
)

This templated constructor can be used to initialize the slot with a member function with one single parameter, last argument is a signal to connect to straightaway after construction

◆ ~Slot()

~Slot ( )

Member Function Documentation

◆ copyCauses()

void copyCauses ( const Slot< Args > &  rhs)

◆ disconnect()

void disconnect

Disconnects the slot from all signals it is connected to

◆ setFunction()

void setFunction ( Function  func)

◆ trigger()

void trigger ( Args...  args)