#include <Pt/Signal.h>
Wraps Signal objects so that they can act as Slots. More...
Inherits BasicSlot< void, As... >.
Public Member Functions | |
| SignalSlot (Signal< As... > &signal) | |
| Constructs from signal. | |
| Slot * | clone () const |
| Clone this object with new. | |
| virtual const Callback * | callable () const |
| Returns the callable converted to the type-erased Callback interface. More... | |
| virtual void | onConnect (const Connection &c) |
| Notifies of connects. | |
| virtual void | onDisconnect (const Connection &c) |
| Notifies of disconnects. | |
| virtual bool | equals (const Slot &rhs) const |
| Returns true if two slots are equal in value. | |
Related Functions | |
| template<typename R , typename BaseT , typename ClassT , typename... As> | |
| ConstMethodSlot< R, ClassT, As... > | slot (ClassT &object, R(BaseT::*method)(As...) const) |
| Returns a slot object for the given object/member pair. | |
| template<typename R , typename... As> | |
| DelegateSlot< R, As... > | slot (Delegate< R, As... > &delegate) |
| Returns a slot object for the given delegate. | |
| template<typename R , typename... As> | |
| FunctionSlot< R, As... > | slot (R(*function)(As...)) |
| Returns a slot object for the given free/static function. | |
| template<typename L , typename SlotT = typename LambdaSlotTraits<L>::Slot> | |
| SlotT | slot (L &&lambda) |
| Returns a deduced slot object for the given lambda. | |
| template<typename L , typename SlotT = typename LambdaSlotTraits<L>::Slot> | |
| SlotT | slot (Connectable &context, L &&lambda) |
| Returns a deduced slot object for the given lambda. | |
| template<typename R , typename... A, typename T , typename L = typename TypeTraits<T>::Value> | |
| LambdaSlot< L, R, A... > | slot (T &&lambda) |
| Returns a slot object for the given lambda. | |
| template<typename R , typename... A, typename T , typename L = typename TypeTraits<T>::Value> | |
| LambdaSlot< L, R, A... > | slot (Connectable &context, T &&lambda) |
| Returns a slot object for the given lambda. | |
| template<typename R , typename BaseT , typename ClassT , typename... As> | |
| MethodSlot< R, ClassT, As... > | slot (ClassT &object, R(BaseT::*method)(As...)) |
| Returns a slot object for the given object/member pair. | |
| template<typename... As> | |
| SignalSlot< As... > | slot (Signal< As... > &signal) |
| Returns a slot object for the given signal. | |
SignalSlot is a "slot wrapper" for Signal objects. That is, it effectively converts a Signal object into a Slot object, so that it can be used as the target of another Signal. This allows chaining of Signals.
|
virtual |
The concrete slot returns its stored callable converted to Callback via a derived-to-base conversion. Callers downcast the result to Callable<R, As...> or Invokable<As...> to invoke it.
Implements Slot.