E-MailRelay
Public Member Functions | Public Attributes | List of all members
G::Slot::Slot< Args > Struct Template Reference

A slot class template that is parameterised only on the target method's signature (with an implicit void return) and not on the target class. More...

#include <gslot.h>

Public Member Functions

template<typename T >
 Slot (T &sink, void(T::*mf)(Args...))
 
 Slot (std::function< void(Args...)> fn)
 
void invoke (Args... args)
 
template<typename T >
bool rebind (T &sink) noexcept
 

Public Attributes

std::function< void(Args...)> m_fn
 

Detailed Description

template<typename... Args>
struct G::Slot::Slot< Args >

A slot class template that is parameterised only on the target method's signature (with an implicit void return) and not on the target class.

The implementation uses std::function to hide the type of the target.

Definition at line 143 of file gslot.h.

Constructor & Destructor Documentation

◆ Slot() [1/2]

template<typename... Args>
template<typename T >
G::Slot::Slot< Args >::Slot ( T &  sink,
void(T::*)(Args...)  mf 
)
inline

Definition at line 147 of file gslot.h.

◆ Slot() [2/2]

template<typename... Args>
G::Slot::Slot< Args >::Slot ( std::function< void(Args...)>  fn)
inlineexplicit

Definition at line 151 of file gslot.h.

Member Function Documentation

◆ invoke()

template<typename... Args>
void G::Slot::Slot< Args >::invoke ( Args...  args)
inline

Definition at line 155 of file gslot.h.

◆ rebind()

template<typename... Args>
template<typename T >
bool G::Slot::Slot< Args >::rebind ( T &  sink)
inlinenoexcept

Definition at line 160 of file gslot.h.

Member Data Documentation

◆ m_fn

template<typename... Args>
std::function<void(Args...)> G::Slot::Slot< Args >::m_fn

Definition at line 145 of file gslot.h.


The documentation for this struct was generated from the following file: