3#include "cancellation_token.hpp"
11inline HandleGuard<CancellationTokenSource>::HandleGuard(
void* handle) noexcept
12 : HandleGuard<CancellationTokenSource>(handle, [](
void* handle) { CVB_CALL_CAPI(ReleaseObject(handle)); })
30 CExports::CVCANCELLATIONTOKENSOURCE sourceHandle =
nullptr;
31 CExports::CVCANCELLATIONTOKEN tokenHandle =
nullptr;
32 CVB_CALL_CAPI_CHECKED(CVCCreateCancellationToken(sourceHandle, tokenHandle));
33 handle_ = HandleGuard<CancellationTokenSource>(sourceHandle);
34 token_ = std::make_shared<CancellationToken>(HandleGuard<CancellationToken>(tokenHandle), CancellationToken::PrivateTag{});
46 return handle_.Handle();
67 CVB_CALL_CAPI_CHECKED(CVCCancellationTokenSourceCancel(
Handle()));
72 HandleGuard<CancellationTokenSource> handle_;
Provides tokens and signals tokens cancellation.
Definition: cancellation_token_source.hpp:20
CancellationTokenPtr Token() const noexcept
Get a token for this source.
Definition: cancellation_token_source.hpp:54
CancellationTokenSource()
Default constructor.
Definition: cancellation_token_source.hpp:27
void Cancel()
Signals the tokens cancellation.
Definition: cancellation_token_source.hpp:65
void * Handle() const noexcept
Classic API image handle.
Definition: cancellation_token_source.hpp:44
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24