23#ifndef CANCELLATIONTOKEN_H
24#define CANCELLATIONTOKEN_H
70 operator
bool() const noexcept;
73 mutable std::mutex m_mutex;
75 std::function<
void()> m_cancelFunction;
CancellationToken(const std::function< void()> &cancelFunction={}) noexcept
Constructs a CancellationToken.
void cancel() noexcept
Cancels the token.
const std::function< void()> & getCancelFunction() const noexcept
Gets the cancel function to be called when the token is cancelled.
void reset() noexcept
Resets the token to its initial state.
bool isCancelled() const noexcept
Gets whether or not the token is cancelled.
void setCancelFunction(const std::function< void()> &cancelFunction) noexcept
Sets the cancel function to be called when the token is cancelled.
Definition cancellationtoken.h:30