#include <Observer.hpp>
|
|
| Observer (const Observer &)=delete |
|
Observer & | operator= (const Observer &)=delete |
|
| Observer (Observer &&)=delete |
|
Observer & | operator= (Observer &&)=delete |
|
| template<class... T, class F> |
| std::shared_ptr< Slot< T... > > | subscribeTo (Signal< T... > &signal, F &&callback) |
Extend from Observer and use subscribeTo in order to remove subscriptions automatically. Useful in cases when the subclass' life is shorter than that of the signal. When the signal dies first, the subscription simply ends; disconnecting it later is a no-op.
◆ subscribeTo()
template<class... T, class F>
| std::shared_ptr< Slot< T... > > psychic_ui::Observer::subscribeTo |
( |
Signal< T... > & | signal, |
|
|
F && | callback ) |
|
inlineprotected |
Subscribe this observer to a signal, disconnected when the observer is destroyed The returned slot can disconnect it earlier.
The documentation for this class was generated from the following file:
- psychic-ui/signals/Observer.hpp