|
Minecraft Community Edition 0.1.0
|
Token object that controls the lifetime of an event subscription. More...
#include <QEventBus.hpp>
Public Member Functions | |
| ~SubscriptionToken () | |
| Destructor. | |
Public Attributes | |
| eastl::function< void()> | unsubscribe |
| Callable invoked to perform the unsubscribe action. | |
Token object that controls the lifetime of an event subscription.
The destructor will call the stored unsubscribe callable if it is set, causing the associated handler to be removed from the event bus.
This type is move- and copy-assignable depending on the semantics of the stored eastl::function. Use subscribeRAII to obtain a token.
|
inline |
Destructor.
Automatically unsubscribes if an unsubscribe callable is present.
| eastl::function<void()> mce::SubscriptionToken::unsubscribe |
Callable invoked to perform the unsubscribe action.
If empty, destruction of the token has no effect.