|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Holds information about why a cancellation occurred. More...
#include <cancellation_reason.h>

Public Types | |
| enum class | type { none , user_requested , timeout , deadline , parent_cancelled , pool_shutdown , error } |
| The type of cancellation that occurred. More... | |
Public Member Functions | |
| auto | to_string () const -> std::string |
| Converts the cancellation reason to a human-readable string. | |
Static Public Member Functions | |
| static auto | type_to_string (type t) -> std::string |
| Converts the reason type enum to a string. | |
Public Attributes | |
| type | reason_type = type::none |
| The type of cancellation that occurred. | |
| std::string | message |
| Human-readable message describing the cancellation. | |
| std::chrono::steady_clock::time_point | cancel_time |
| Time point when the cancellation occurred. | |
| std::optional< std::exception_ptr > | exception |
| Optional exception that triggered the cancellation. | |
Holds information about why a cancellation occurred.
When a cancellation token is cancelled, the reason provides details about what triggered the cancellation, when it occurred, and optionally any exception that caused it.
Definition at line 50 of file cancellation_reason.h.
|
strong |
The type of cancellation that occurred.
Definition at line 56 of file cancellation_reason.h.
|
inlinenodiscard |
Converts the cancellation reason to a human-readable string.
Definition at line 83 of file cancellation_reason.h.
References deadline, error, message, none, parent_cancelled, pool_shutdown, reason_type, timeout, and user_requested.
|
inlinestaticnodiscard |
Converts the reason type enum to a string.
| t | The reason type to convert. |
Definition at line 125 of file cancellation_reason.h.
References deadline, error, none, parent_cancelled, pool_shutdown, timeout, and user_requested.
| std::chrono::steady_clock::time_point kcenon::thread::cancellation_reason::cancel_time |
Time point when the cancellation occurred.
Definition at line 74 of file cancellation_reason.h.
Referenced by kcenon::thread::enhanced_cancellation_token::create_linked(), kcenon::thread::enhanced_cancellation_token::create_linked_with_timeout(), kcenon::thread::enhanced_cancellation_token::do_cancel(), and kcenon::thread::enhanced_cancellation_token::start_timeout_timer().
| std::optional<std::exception_ptr> kcenon::thread::cancellation_reason::exception |
Optional exception that triggered the cancellation.
Definition at line 77 of file cancellation_reason.h.
Referenced by kcenon::thread::enhanced_cancellation_token::do_cancel().
| std::string kcenon::thread::cancellation_reason::message |
Human-readable message describing the cancellation.
Definition at line 71 of file cancellation_reason.h.
Referenced by kcenon::thread::enhanced_cancellation_token::create_linked(), kcenon::thread::enhanced_cancellation_token::create_linked_with_timeout(), kcenon::thread::enhanced_cancellation_token::do_cancel(), kcenon::thread::operation_cancelled_exception::operation_cancelled_exception(), kcenon::thread::enhanced_cancellation_token::start_timeout_timer(), and to_string().
| type kcenon::thread::cancellation_reason::reason_type = type::none |
The type of cancellation that occurred.
Definition at line 68 of file cancellation_reason.h.
Referenced by kcenon::thread::enhanced_cancellation_token::create_linked(), kcenon::thread::enhanced_cancellation_token::create_linked_with_timeout(), kcenon::thread::enhanced_cancellation_token::do_cancel(), kcenon::thread::enhanced_cancellation_token::start_timeout_timer(), and to_string().