|
VLink
2.0.0
A high-performance communication middleware
|
Move-only RAII handle that represents one subscribed cancellation callback. 更多...
#include <cancellation.h>
Public 成员函数 | |
| CancellationRegistration () noexcept | |
| Constructs an empty registration that owns no callback slot. 更多... | |
| ~CancellationRegistration () | |
| Destructor; detaches the owned callback when cancellation has not yet fired. 更多... | |
| CancellationRegistration (CancellationRegistration &&other) noexcept | |
Move constructor; transfers slot ownership and leaves other empty. 更多... | |
| CancellationRegistration & | operator= (CancellationRegistration &&other) noexcept |
Move assignment; detaches any current slot then adopts other 's slot. 更多... | |
| void | reset () noexcept |
| Detaches the owned callback and resets to the empty state. 更多... | |
| bool | valid () const noexcept |
| Reports whether the registration still owns an attached callback slot. 更多... | |
友元 | |
| class | CancellationToken |
| class | CancellationSource |
Move-only RAII handle that represents one subscribed cancellation callback.
Each registration owns exactly one slot inside the source's state. Destroying or reset-ing the handle detaches the callback if it has not yet fired; once the source has cancelled the slot is consumed automatically and the handle becomes a benign no-op sink. The type is deliberately move-only to keep slot identity unique.
|
noexcept |
Constructs an empty registration that owns no callback slot.
| vlink::CancellationRegistration::~CancellationRegistration | ( | ) |
Destructor; detaches the owned callback when cancellation has not yet fired.
|
noexcept |
Move constructor; transfers slot ownership and leaves other empty.
| other | Source registration emptied by the move. |
|
noexcept |
Move assignment; detaches any current slot then adopts other 's slot.
| other | Source registration emptied by the move. |
*this.
|
noexcept |
Detaches the owned callback and resets to the empty state.
Idempotent. Safe to call on an empty or already-reset registration.
|
noexcept |
Reports whether the registration still owns an attached callback slot.
true when the slot is live and the source has not yet cancelled.
|
friend |
|
friend |