3#include "spark/patterns/details/Connection.h"
7namespace spark::patterns
9 template <
typename... Args>
16 template <
typename... Args>
20 friend class Signal<Args...>;
29 explicit Slot(
const std::function<
void(Args...)>& f);
35 explicit Slot(std::function<
void(Args...)>&& f);
44 Slot(T* target,
void (T::*method)(Args...));
53 Slot(T* target,
void (T::*method)(Args...) const);
60 Slot& operator=(
Slot&& slot)
noexcept;
78 void move(
Slot* slot);
81 std::function<void(Args...)> m_callback;
86#include "spark/patterns/impl/Slot.h"
A signal is a class used to emit events.
Definition Slot.h:10
A slot is a connection between a signal and a callback.
Definition Slot.h:18
bool isConnected() const
Checks if this slot is connected to a signal.
Definition Slot.h:72
void disconnect()
Disconnects this slot from the signal.
Definition Slot.h:78
Slot(T *target, void(T::*method)(Args...) const)
Instantiates a slot from a const method pointer.
Definition Connection.h:18