C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
|
The cancellation_token_source
class represents the ability to cancel some cancelable operation.
More...
#include <pplxcancellation_token.h>
Public Types | |
typedef ::pplx::details::_CancellationTokenState * | _ImplType |
Public Member Functions | |
cancellation_token_source () | |
Constructs a new cancellation_token_source . The source can be used to flag cancellation of some cancelable operation. More... | |
cancellation_token_source (const cancellation_token_source &_Src) | |
cancellation_token_source (cancellation_token_source &&_Src) | |
cancellation_token_source & | operator= (const cancellation_token_source &_Src) |
cancellation_token_source & | operator= (cancellation_token_source &&_Src) |
bool | operator== (const cancellation_token_source &_Src) const |
bool | operator!= (const cancellation_token_source &_Src) const |
cancellation_token | get_token () const |
Returns a cancellation token associated with this source. The returned token can be polled for cancellation or provide a callback if and when cancellation occurs. More... | |
void | cancel () const |
Cancels the token. Any task_group , structured_task_group , or task which utilizes the token will be canceled upon this call and throw an exception at the next interruption point. More... | |
_ImplType | _GetImpl () const |
Static Public Member Functions | |
static cancellation_token_source | create_linked_source (cancellation_token &_Src) |
Creates a cancellation_token_source which is canceled when the provided token is canceled. More... | |
template<typename _Iter > | |
static cancellation_token_source | create_linked_source (_Iter _Begin, _Iter _End) |
Creates a cancellation_token_source which is canceled when one of a series of tokens represented by an STL iterator pair is canceled. More... | |
static cancellation_token_source | _FromImpl (_ImplType _Impl) |
The cancellation_token_source
class represents the ability to cancel some cancelable operation.
|
inline |
Constructs a new cancellation_token_source
. The source can be used to flag cancellation of some cancelable operation.
|
inline |
Cancels the token. Any task_group
, structured_task_group
, or task
which utilizes the token will be canceled upon this call and throw an exception at the next interruption point.
|
inlinestatic |
Creates a cancellation_token_source
which is canceled when the provided token is canceled.
_Src | A token whose cancellation will cause cancellation of the returned token source. Note that the returned token source can also be canceled independently of the source contained in this parameter. |
cancellation_token_source
which is canceled when the token provided by the _Src parameter is canceled.
|
inlinestatic |
Creates a cancellation_token_source
which is canceled when one of a series of tokens represented by an STL iterator pair is canceled.
_Begin | The STL iterator corresponding to the beginning of the range of tokens to listen for cancellation of. |
_End | The STL iterator corresponding to the ending of the range of tokens to listen for cancellation of. |
cancellation_token_source
which is canceled when any of the tokens provided by the range described by the STL iterators contained in the _Begin and _End parameters is canceled.
|
inline |
Returns a cancellation token associated with this source. The returned token can be polled for cancellation or provide a callback if and when cancellation occurs.