5#include <system/idisposable.h>
6#include <system/action.h>
9namespace System {
namespace Threading {
11class CancellationToken;
47 ASPOSECPP_SHARED_API
void Dispose()
override;
54 ASPOSECPP_SHARED_API int32_t RegisterCallback(
const Action<>&);
56 ASPOSECPP_SHARED_API
void UnregisterCallback(int32_t);
61 std::map<int32_t, Action<>> m_callbacks;
Defines method that releases resources owned by the current object. Objects of this class should only...
Definition: idisposable.h:30
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Propagates notification that operations should be canceled. This class provides a mechanism for coope...
Definition: cancellation_token.h:43
Represents a registration for a cancellation token callback.
Definition: cancellation_token.h:19
A cancellation token source that can be used to trigger cancellation notifications.
Definition: cancellation_token_source.h:17
static SharedPtr< CancellationTokenSource > CreateLinkedTokenSource(const CancellationToken &token1, const CancellationToken &token2)
Creates a linked token source that cancels when any of the provided tokens cancel.
void Dispose() override
Releases all resources used by the CancellationTokenSource.
bool get_IsCancellationRequested() const
Gets whether cancellation has been requested.
Definition: cancellation_token_source.h:25
CancellationTokenSource()
Constructs a new CancellationTokenSource.
CancellationToken get_Token() const
Gets the cancellation token associated with this source.
void Cancel()
Communicates a request for cancellation.
Definition: db_command.h:9
MulticastDelegate< void(Args...)> Action
Delegate type that references methods that have no return value.
Definition: action.h:40