|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Structured cancellation scope with check points. More...
#include <enhanced_cancellation_token.h>

Public Member Functions | |
| cancellation_scope (enhanced_cancellation_token token) | |
| Constructs a scope with the given token. | |
| ~cancellation_scope ()=default | |
| Destructor. | |
| cancellation_scope (const cancellation_scope &)=delete | |
| auto | operator= (const cancellation_scope &) -> cancellation_scope &=delete |
| cancellation_scope (cancellation_scope &&)=delete | |
| auto | operator= (cancellation_scope &&) -> cancellation_scope &=delete |
| auto | is_cancelled () const -> bool |
| Checks if the token is cancelled. | |
| auto | check_cancelled () const -> common::VoidResult |
| Checks if the token is cancelled and returns an error result. | |
| auto | token () const -> const enhanced_cancellation_token & |
| Gets the underlying token. | |
Private Attributes | |
| enhanced_cancellation_token | token_ |
Structured cancellation scope with check points.
Provides a convenient way to check for cancellation at various points in code execution.
Definition at line 420 of file enhanced_cancellation_token.h.
|
explicit |
Constructs a scope with the given token.
| token | The cancellation token to monitor. |
Definition at line 577 of file enhanced_cancellation_token.cpp.
|
default |
Destructor.
|
delete |
|
delete |
|
nodiscard |
Checks if the token is cancelled and returns an error result.
Definition at line 587 of file enhanced_cancellation_token.cpp.
References kcenon::thread::enhanced_cancellation_token::check_cancelled(), and token_.

|
nodiscard |
Checks if the token is cancelled.
Definition at line 582 of file enhanced_cancellation_token.cpp.
References kcenon::thread::enhanced_cancellation_token::is_cancelled(), and token_.

|
delete |
|
delete |
|
nodiscard |
Gets the underlying token.
Definition at line 592 of file enhanced_cancellation_token.cpp.
References token_.
|
private |
Definition at line 460 of file enhanced_cancellation_token.h.
Referenced by check_cancelled(), is_cancelled(), and token().