Propagates notification that operations should be canceled.
Public Fields | |
| static cancellation_token | none |
| Represents an empty xtd::threading::cancellation_token value. | |
Public Constructors | |
| cancellation_token (bool canceled) | |
| Initializes the xtd::threading::cancellation_token. | |
Public Properties | |
| auto | can_be_canceled () const noexcept -> bool |
| Gets whether this token is capable of being in the canceled state. | |
| auto | is_cancellation_requested () const noexcept -> bool |
| Gets whether cancellation has been requested for this token. | |
| auto | wait_handle () noexcept -> threading::wait_handle & |
| Gets a xtd::threading::wait_handle that is signaled when the token is canceled. | |
Public Methods | |
| auto | equals (const object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | equals (const cancellation_token &other) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | get_hash_code () const noexcept -> xtd::usize override |
| Serves as a hash function for a particular type. | |
| auto | throw_if_cancellation_requested () const -> void |
| Throws a xtd::operation_canceled_exception if this token has had cancellation requested. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| virtual auto | to_string () const -> xtd::string |
| Returns a xtd::string that represents the current object. | |
| virtual auto | equals (const cancellation_token &) const noexcept -> bool=0 |
| Indicates whether the current object is equal to another object of the same type. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
| xtd::threading::cancellation_token::cancellation_token | ( | bool | canceled | ) |
Initializes the xtd::threading::cancellation_token.
| canceled | The canceled state for the token. |
|
nodiscardnoexcept |
Gets whether this token is capable of being in the canceled state.
|
nodiscardnoexcept |
Gets whether cancellation has been requested for this token.
|
nodiscardnoexcept |
Gets a xtd::threading::wait_handle that is signaled when the token is canceled.
|
nodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
nodiscardoverridenoexcept |
Determines whether the specified object is equal to the current object.
| other | The object to compare with the current object. |
|
nodiscardoverridevirtualnoexcept |
Serves as a hash function for a particular type.
Reimplemented from xtd::object.
| auto xtd::threading::cancellation_token::throw_if_cancellation_requested | ( | ) | const -> void |
Throws a xtd::operation_canceled_exception if this token has had cancellation requested.
| xtd::operation_canceled_exception | The token has had cancellation requested. |
|
static |
Represents an empty xtd::threading::cancellation_token value.