azure-core-amqp
Loading...
Searching...
No Matches
cancellable.hpp
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#pragma once
5
6#include <chrono>
7#include <memory>
8#include <string>
9#include <vector>
10#if 0
11struct ASYNC_OPERATION_INSTANCE_TAG;
12
13namespace Azure { namespace Core { namespace Amqp { namespace _internal {
14 class Cancellable final {
15 public:
16 Cancellable(ASYNC_OPERATION_INSTANCE_TAG* asyncOperation) : m_operation{asyncOperation} {}
17 ~Cancellable();
18
19 Cancellable(Cancellable const&) = delete;
20 Cancellable& operator=(Cancellable const&) = delete;
21 Cancellable(Cancellable&& that) noexcept : m_operation{that.m_operation}
22 {
23 that.m_operation = nullptr;
24 }
25 Cancellable& operator=(Cancellable&& that) noexcept
26 {
27 m_operation = that.m_operation;
28 that.m_operation = nullptr;
29 return *this;
30 }
31
32 void Cancel();
33
34 private:
35 ASYNC_OPERATION_INSTANCE_TAG* m_operation;
36 };
37}}}} // namespace Azure::Core::Amqp::_internal
38#endif