BDE 4.14.0 Production release
|
#include <bslstl_stoptoken.h>
Public Member Functions | |
stop_token () BSLS_KEYWORD_NOEXCEPT | |
Create a stop_token object that does not refer to a stop state. | |
stop_token (const stop_token &original) BSLS_KEYWORD_NOEXCEPT | |
stop_token (BloombergLP::bslmf::MovableRef< stop_token > original) BSLS_KEYWORD_NOEXCEPT | |
~stop_token () | |
Destroy this object. | |
stop_token & | operator= (const stop_token &other) BSLS_KEYWORD_NOEXCEPT |
stop_token & | operator= (BloombergLP::bslmf::MovableRef< stop_token > other) BSLS_KEYWORD_NOEXCEPT |
void | swap (stop_token &other) BSLS_KEYWORD_NOEXCEPT |
BSLA_NODISCARD bool | stop_possible () const BSLS_KEYWORD_NOEXCEPT |
BSLA_NODISCARD bool | stop_requested () const BSLS_KEYWORD_NOEXCEPT |
Friends | |
class | stop_source |
template<class t_CALLBACK > | |
class | stop_callback |
BSLA_NODISCARD friend bool | operator== (const stop_token &lhs, const stop_token &rhs) BSLS_KEYWORD_NOEXCEPT |
BSLA_NODISCARD friend bool | operator!= (const stop_token &lhs, const stop_token &rhs) BSLS_KEYWORD_NOEXCEPT |
void | swap (stop_token &lhs, stop_token &rhs) BSLS_KEYWORD_NOEXCEPT |
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.
See bslstl_stoptoken
|
inline |
|
inline |
Create a stop_token object that refers to the same stop state (or lack thereof) as the specified original
object.
|
inline |
Create a stop_token object that refers to the same stop state (or lack) thereof as the specified original
object, and reset original
to not refer to a stop state.
|
inline |
|
inline |
Set this object to refer to the stop state (or lack thereof) that the specified other
object refers to, and reset other
to not refer to a stop state.
|
inline |
Set this object to refer to the same stop state (or lack thereof) as the specified other
object.
BSLA_NODISCARD bool bsl::stop_token::stop_possible | ( | ) | const |
Return true
if *this
refers to a stop state, and either a stop was already requested on that stop state or there is at least one stop_source object that refers to that stop state (implying that a stop could still be requested using the request_stop function), and false
otherwise. A call to stop_possible that is potentially concurrent with a call to stop_requested or stop_possible does not cause a data race.
BSLA_NODISCARD bool bsl::stop_token::stop_requested | ( | ) | const |
Return true
if *this
refers to a stop state on which request_stop has been called, and false
otherwise. If this function returns true
, then the successful call to request_stop synchronizes with this call. A call to stop_requested that is potentially concurrent with a call to stop_requested or stop_possible does not cause a data race.
|
inline |
Set *this
to refer to the stop state (or lack thereof) that the specified other
referred to, and vice versa. Equivalent to swap(*this, other)
.
|
friend |
Return true
if the specified lhs
and rhs
refer to different stop states, or if only one refers to a stop state; false
otherwise.
|
friend |
Return true
if the specified lhs
and rhs
refer to the same stop state, or if neither refers to a stop state; false
otherwise. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stoptoken.general]).
|
friend |
|
friend |
|
friend |
Set lhs
to refer to the stop state (or lack thereof) that rhs
referred to, and vice versa. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stoptoken.general]).