|
psychic-ui 0.0.0
|
#include <Slot.hpp>
Public Types | |
| using | Callback = std::function<void(const T &...)> |
Public Member Functions | |
| Slot (std::weak_ptr< detail::SignalCore< T... > > core, Callback callback) | |
| void | disconnect () override |
| bool | connected () const override |
| Public Member Functions inherited from psychic_ui::SlotBase | |
| SlotBase (const SlotBase &)=delete | |
| SlotBase & | operator= (const SlotBase &)=delete |
| SlotBase (SlotBase &&)=delete | |
| SlotBase & | operator= (SlotBase &&)=delete |
Friends | |
| class | Signal< T... > |
| struct | detail::SignalCore< T... > |
Subscription to a signal, returned by Signal::subscribe.
The signal keeps its slots alive, so dropping the returned pointer does not disconnect: keep it in a ScopedSlot to disconnect later, or extend from Observer and use subscribeTo to disconnect when the observer dies.
|
inlinenodiscardoverridevirtual |
Whether the callback will still be called when the signal is emitted
Implements psychic_ui::SlotBase.
|
inlineoverridevirtual |
Disconnects this slot from its signal. Safe to call more than once, from inside the callback, and after the signal was destroyed.
Implements psychic_ui::SlotBase.