[#bsl-stop_token] = xref:bsl.adoc[bsl]::stop_token :relfileprefix: ../ :mrdocs: Mechanism for observing cancellation requests on a stop state. == Synopsis Declared in `<bslstl_stoptoken.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class stop_token; ---- == Description This class is a mechanism for observing cancellation requests. An object of this class either has (possibly shared) ownership of a stop state and can be used to observe whether a cancellation request has been made on that stop state, or does not own a stop state. A `stop_token` cannot be used to make a cancellation request. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/stop_token/callback_type.adoc[`callback_type`] | Alias for `stop_callback` parameterized by `t_CALLBACK`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/stop_token/2constructor-06.adoc[`stop_token`] [.small]#[constructor]# | Constructors | xref:bsl/stop_token/2destructor.adoc[`~stop_token`] [.small]#[destructor]# | Destroy this object. | xref:bsl/stop_token/operator_assign-07.adoc[`operator=`] | Assignment operators | xref:bsl/stop_token/stop_possible.adoc[`stop_possible`] | Return whether a stop is still possible on the referred stop state. | xref:bsl/stop_token/stop_requested.adoc[`stop_requested`] | Return whether a stop has been requested on the referred stop state. | xref:bsl/stop_token/swap.adoc[`swap`] | Exchange the stop states referred to by `*this` and `other`. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:bsl/swap-06da.adoc[bsl::swap]` | Exchange the stop states referred to by `lhs` and `rhs`. | `xref:bsl/operator_eq-0c5.adoc[bsl::operator==]` | Return whether `lhs` and `rhs` refer to the same stop state. | `xref:bsl/stop_callback-06.adoc[bsl::stop_callback]` | Callback invoked when a stop is requested on an associated stop state. | `xref:bsl/stop_source.adoc[bsl::stop_source]` | Mechanism for requesting and observing cancellation on a stop state. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#