Asio Extensions
Additional functionality built on top of (Boost.)Asio
|
Manager for cancellation_tokens. More...
#include <asioext/cancellation_token.hpp>
Public Member Functions | |
cancellation_token_source () | |
Construct a cancellation_token_source. More... | |
cancellation_token_source (cancellation_token_source &&other) noexcept | |
Move-construct a cancellation_token_source. More... | |
cancellation_token_source & | operator= (cancellation_token_source &&other) noexcept |
Move-assign a cancellation_token_source. More... | |
void | cancel () |
Cancel all currently issued cancellation_tokens. More... | |
void | destroy () noexcept |
Cancel all tokens, present and future. More... | |
void | reset () |
Reset a destroyed token source. More... | |
Friends | |
class | cancellation_token |
Manager for cancellation_tokens.
This class provides functionality to create and cancel cancellation_tokens.
asioext::cancellation_token_source::cancellation_token_source | ( | ) |
Construct a cancellation_token_source.
|
noexcept |
Move-construct a cancellation_token_source.
This constructor moves the token source.
other | The other cancellation_token_source object from which the move will occur. |
void asioext::cancellation_token_source::cancel | ( | ) |
Cancel all currently issued cancellation_tokens.
This function cancels all tokens that have been issued until this call.
Tokens issued after a call to cancel() are unaffected.
|
noexcept |
Cancel all tokens, present and future.
This function cancels all currently issued tokens, as well as tokens issued after this call.
All new tokens created from this source will start in the cancelled state.
|
noexcept |
Move-assign a cancellation_token_source.
This assignment operator moves the token source.
other | The other cancellation_token_source object from which the move will occur. |
void asioext::cancellation_token_source::reset | ( | ) |
Reset a destroyed token source.
This function resets a destroyed token source, so that it can be used to issue and cancel tokens again.
After a call to this function, the object's state is as if just constructed.
|
friend |