semf
slot.h File Reference
Include dependency graph for slot.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  semf::Slot< T, Arguments >
 Slot for lightweight signal/slot implementation. This ConstSlot is for connecting a signal to a member function. When the signal is emitted, the given member function is invoked. More...
 

Namespaces

namespace  semf
 

Macros

#define SEMF_SLOT_FUNC(function)   [](auto& obj, auto&&... args) { obj.function(std::forward<decltype(args)>(args)...); }
 Creates a binding to a given member function. More...
 
#define SEMF_SLOT(name, className, object, function, ...)   semf::Slot<className, ##__VA_ARGS__> name = {object, SEMF_SLOT_FUNC(function)}
 Creates a semf slot. More...
 

Detailed Description

Date
11.05.2023
Author
nk

Definition in file slot.h.

Macro Definition Documentation

◆ SEMF_SLOT

#define SEMF_SLOT (   name,
  className,
  object,
  function,
  ... 
)    semf::Slot<className, ##__VA_ARGS__> name = {object, SEMF_SLOT_FUNC(function)}

Creates a semf slot.

Parameters
nameName of the created slot variable.
classNameName of the class.
objectObject of the class.
functionMember function to bind to.
...Additional parameter types.

Definition at line 30 of file slot.h.

◆ SEMF_SLOT_FUNC

#define SEMF_SLOT_FUNC (   function)    [](auto& obj, auto&&... args) { obj.function(std::forward<decltype(args)>(args)...); }

Creates a binding to a given member function.

Parameters
functionMember function to bind to.

Definition at line 21 of file slot.h.