semf
semf::StaticSlot< Arguments > Class Template Reference

StaticSlot for lightweight signal/slot implementation. This StaticSlot ist for connecting a signal to a static function which have a return value from type void. More...

#include <staticslot.h>

Inheritance diagram for semf::StaticSlot< Arguments >:
Inheritance graph
Collaboration diagram for semf::StaticSlot< Arguments >:
Collaboration graph

Public Types

typedef void(* Function) (Arguments...)
 

Public Member Functions

 StaticSlot (Function function)
 Constructor. More...
 
virtual ~StaticSlot ()=default
 
void setFunction (Function function)
 Set the callback function. More...
 
Function function () const
 function Get the pointer to the callback function. More...
 
- Public Member Functions inherited from semf::SlotBase< Arguments... >
virtual ~SlotBase ()=default
 

Protected Member Functions

void call (Arguments &&... arguments)
 The invocation of the callback. More...
 
virtual void call (Arguments &&... arguments)=0
 The invocation of the callback. More...
 

Detailed Description

template<typename... Arguments>
class semf::StaticSlot< Arguments >

StaticSlot for lightweight signal/slot implementation. This StaticSlot ist for connecting a signal to a static function which have a return value from type void.

Parameters
ArgumentsThe parameter types for pass parameter over the signal to a function.

Definition at line 26 of file staticslot.h.

Member Typedef Documentation

◆ Function

template<typename... Arguments>
typedef void(* semf::StaticSlot< Arguments >::Function) (Arguments...)

typedef for the function pointer.

Definition at line 30 of file staticslot.h.

Constructor & Destructor Documentation

◆ StaticSlot()

template<typename... Arguments>
semf::StaticSlot< Arguments >::StaticSlot ( Function  function)
explicit

Constructor.

Parameters
functionpointer to the callback function

Definition at line 58 of file staticslot.h.

◆ ~StaticSlot()

template<typename... Arguments>
virtual semf::StaticSlot< Arguments >::~StaticSlot ( )
virtualdefault

Member Function Documentation

◆ call()

template<typename... Arguments>
void semf::StaticSlot< Arguments >::call ( Arguments &&...  arguments)
protectedvirtual

The invocation of the callback.

Parameters
argumentsArguments for the callback.

Implements semf::SlotBase< Arguments... >.

Definition at line 76 of file staticslot.h.

◆ function()

template<typename... Arguments>
StaticSlot< Arguments... >::Function semf::StaticSlot< Arguments >::function

function Get the pointer to the callback function.

Returns
The pointer to the callback function.

Definition at line 70 of file staticslot.h.

◆ setFunction()

template<typename... Arguments>
void semf::StaticSlot< Arguments >::setFunction ( Function  function)

Set the callback function.

Parameters
functionThe callback function

Definition at line 64 of file staticslot.h.