11#ifndef SEMF_UTILS_CORE_SIGNALS_SLOT_H_
12#define SEMF_UTILS_CORE_SIGNALS_SLOT_H_
21#define SEMF_SLOT_FUNC(function) [](auto& obj, auto&&... args) { obj.function(std::forward<decltype(args)>(args)...); }
30#define SEMF_SLOT(name, className, object, function, ...) semf::Slot<className, ##__VA_ARGS__> name = {object, SEMF_SLOT_FUNC(function)}
41template <
typename T,
typename... Arguments>
80 void call(Arguments&&... arguments);
89template <
typename T,
typename... Arguments>
95template <
typename T,
typename... Arguments>
101template <
typename T,
typename... Arguments>
104 m_function = function;
107template <
typename T,
typename... Arguments>
113template <
typename T,
typename... Arguments>
116 (m_function)(*m_object, std::forward<Arguments>(arguments)...);
Base Class for all Slot implementations.
Slot for lightweight signal/slot implementation. This ConstSlot is for connecting a signal to a membe...
void setFunction(Function function)
setFunction Set the method which should called.
Slot(T &object, Function function)
Constructor.
Function function() const
Get the method which should called.
T & object() const
Get the reference to the context.
void(* Function)(T &, Arguments &&...)
void call(Arguments &&... arguments)
The invocation of the callback.
void setObject(T &object)
Set the reference to the context.