|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
#include <cancellation.hpp>
Public Member Functions | |
| CancellationSource () | |
| CancellationToken | token () const noexcept |
| void | cancel () |
| Trigger cancellation. | |
| bool | is_cancelled () const noexcept |
| ~CancellationSource () | |
| Auto-cancel on destruction — perfect for ViewModelScope. | |
| CancellationSource (const CancellationSource &)=delete | |
| CancellationSource & | operator= (const CancellationSource &)=delete |
| CancellationSource (CancellationSource &&)=default | |
| CancellationSource & | operator= (CancellationSource &&other) noexcept |
|
inline |
|
inline |
Auto-cancel on destruction — perfect for ViewModelScope.
|
delete |
|
default |
|
inlinenodiscardnoexcept |
|
inline |
Trigger cancellation.
All currently registered callbacks fire synchronously on the calling thread; any later observers see is_cancelled() == true.
Coroutine resumes triggered by callbacks are deferred: the callback enqueues the coroutine handle, and this function drains the queue once every callback has returned. That keeps the stack shape free of std::function::operator() indirection at the moment a resumed coroutine throws — see the comment on detail::DeferredResumeContext for the full rationale.
Safe to call on a moved-from CancellationSource (state_ may be nullptr). The destructor relies on this guard.
|
inlinenodiscardnoexcept |
|
delete |
|
inlinenoexcept |