|
GNode library (C++)
|
Manages the lifetime of a subscription to an Event. More...
#include <event.hpp>
Public Member Functions | |
| EventConnection ()=default | |
| EventConnection (std::function< void()> disconnect) | |
| Construct a connection with a custom disconnect callback. | |
| ~EventConnection () | |
| Destructor automatically triggers the disconnect action. | |
| EventConnection (const EventConnection &)=delete | |
| EventConnection & | operator= (const EventConnection &)=delete |
| EventConnection (EventConnection &&other) noexcept | |
| Move constructor. | |
| EventConnection & | operator= (EventConnection &&other) noexcept |
| Move assignment operator. | |
| void | disconnect () |
| Manually disconnect the subscription. | |
Private Attributes | |
| std::function< void()> | disconnect_ |
Manages the lifetime of a subscription to an Event.
Automatically disconnects the subscription upon destruction unless manually disconnected beforehand.
|
default |
|
inline |
Construct a connection with a custom disconnect callback.
| disconnect | Callable to execute when disconnecting. |
|
inline |
Destructor automatically triggers the disconnect action.
|
delete |
|
inlinenoexcept |
Move constructor.
|
inline |
Manually disconnect the subscription.
Triggers the stored callback and releases it. Safe to call multiple times.
|
delete |
|
inlinenoexcept |
Move assignment operator.
|
private |