Loading...
Searching...
No Matches
mce::core::SubscriptionToken Struct Reference

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.

## Detailed Description

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.

## Constructor & Destructor Documentation

## ~SubscriptionToken()

mce::core::SubscriptionToken::~SubscriptionToken | ( |  | ) |

inline

Destructor.

Automatically unsubscribes if an unsubscribe callable is present.

## Member Data Documentation

## unsubscribe

eastl::function<void()> mce::core::SubscriptionToken::unsubscribe

Callable invoked to perform the unsubscribe action.

If empty, destruction of the token has no effect.

The documentation for this struct was generated from the following file:

- Minecraft-Community-Edition/Core/QEventBus.hpp