#include <Pt/Slot.h>
Endpoint of a signal/slot connection. More...
Inherited by BasicSlot< R, A... >, BasicSlot< R, As... >, BasicSlot< void, As... >, and BasicSlot< R, As >.
Public Member Functions | |
| virtual | ~Slot () |
| Destructor. | |
| virtual Slot * | clone () const =0 |
| Clone this object with new. | |
| virtual const void * | callable () const =0 |
| Returns a pointer to the contained callable. | |
| virtual void | onConnect (const Connection &c)=0 |
| Notifies of connects. | |
| virtual void | onDisconnect (const Connection &c)=0 |
| Notifies of disconnects. | |
| virtual bool | equals (const Slot &slot) const =0 |
| 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. | |
Slots can be constructed with the slot() function, which is overloaded for various types of callable entities, most notably functions or member functions. Slots are lightweight proxy-objects and one example is the Pt::MethodSlot, which allows to use a member function as a slot.