Identifies a function handler subscribed to a SubscribableEvent. Can be used to unsubscribe the function handler.
More...
#include <SubscribableEvent.hpp>
|
|
static constexpr Token | Subscribe {} |
| |
|
|
template<typename ... Args> |
| class | SubscribableEvent |
| |
Identifies a function handler subscribed to a SubscribableEvent. Can be used to unsubscribe the function handler.
This handle automatically unsubscribes the associated event handler at destruction. It avoids undefined behaviour if the event is already destroyed. However, this mechanism is not thread-safe!
◆ ~SubscriberHandle()
| sat::SubscriberHandle::~SubscriberHandle |
( |
| ) |
|
DTor. Automatically unregisters the associated event handler if not already disposed.
◆ SubscriberHandle() [1/2]
| constexpr sat::SubscriberHandle::SubscriberHandle |
( |
| ) |
|
|
constexprdefaultnoexcept |
Ctor. Creates an empty handle
◆ SubscriberHandle() [2/2]
| sat::SubscriberHandle::SubscriberHandle |
( |
Token |
| ) |
|
|
protected |
Ctor creates a handle with specified id
- Parameters
-
◆ isSubscribed()
| bool sat::SubscriberHandle::isSubscribed |
( |
| ) |
const |
|
noexcept |
Whether the handle refers to a valid event
- Returns
- true if handle refers to an active event, false otherwise
◆ unregister()
| void sat::SubscriberHandle::unregister |
( |
| ) |
|
|
noexcept |
Manually unregister the associated event handler
The documentation for this class was generated from the following files: