Asio Extensions
Additional functionality built on top of (Boost.)Asio
|
Token to determine if an operation was cancelled. More...
#include <asioext/cancellation_token.hpp>
Public Member Functions | |
cancellation_token (const cancellation_token_source &source) noexcept | |
bool | cancelled () const noexcept |
Check whether this operation is cancelled. More... | |
Token to determine if an operation was cancelled.
This class provides the ability to determine if an operation was cancelled. cancellation_token objects can only be created from a cancellation_token_source.
A cancellation_token is not dependent on the lifetime of its cancellation_token_source (i.e. the token can outlive the source).
|
noexcept |
|
noexcept |
Check whether this operation is cancelled.
This function checks whether this token is cancelled (i.e. whether cancel() has been called after this token was created).
true
if the operation was cancelled, false
otherwise.