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.
Public Types | Public Member Functions | Static Public Member Functions | List of all members
pplx::cancellation_token_source Class Reference

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_sourceoperator= (const cancellation_token_source &_Src)
 
cancellation_token_sourceoperator= (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)
 

Detailed Description

The cancellation_token_source class represents the ability to cancel some cancelable operation.

Constructor & Destructor Documentation

pplx::cancellation_token_source::cancellation_token_source ( )
inline

Constructs a new cancellation_token_source. The source can be used to flag cancellation of some cancelable operation.

Member Function Documentation

void pplx::cancellation_token_source::cancel ( ) const
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.

static cancellation_token_source pplx::cancellation_token_source::create_linked_source ( cancellation_token _Src)
inlinestatic

Creates a cancellation_token_source which is canceled when the provided token is canceled.

Parameters
_SrcA 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.
Returns
A cancellation_token_source which is canceled when the token provided by the _Src parameter is canceled.
template<typename _Iter >
static cancellation_token_source pplx::cancellation_token_source::create_linked_source ( _Iter  _Begin,
_Iter  _End 
)
inlinestatic

Creates a cancellation_token_source which is canceled when one of a series of tokens represented by an STL iterator pair is canceled.

Parameters
_BeginThe STL iterator corresponding to the beginning of the range of tokens to listen for cancellation of.
_EndThe STL iterator corresponding to the ending of the range of tokens to listen for cancellation of.
Returns
A 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.
cancellation_token pplx::cancellation_token_source::get_token ( ) const
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.

Returns
A cancellation token associated with this source.

The documentation for this class was generated from the following file: