CVB++ 15.0
CancellationTokenSource Class Reference

Provides tokens and signals tokens cancellation. More...

#include <cvb/cancellation_token_source.hpp>

Public Member Functions

 CancellationTokenSource ()
 Default constructor. More...
 
void * Handle () const noexcept
 Classic API image handle. More...
 
CancellationTokenPtr Token () const noexcept
 Get a token for this source. More...
 
void Cancel ()
 Signals the tokens cancellation. More...
 

Detailed Description

Provides tokens and signals tokens cancellation.

Constructor & Destructor Documentation

◆ CancellationTokenSource()

Default constructor.

Exceptions
Anyexception derived from std::exception including CvbException.

Member Function Documentation

◆ Cancel()

void Cancel ( )
inline

Signals the tokens cancellation.

Note
There is usually nothing that can fail. However, the C-API may produce an error that should not be ignored.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API image handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ Token()

CancellationTokenPtr Token ( ) const
inlinenoexcept

Get a token for this source.

Returns
A token.
Exceptions
Doesnot throw any exception.