Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
cancellation_handler.h
1#ifndef CANCELLATION_HANDLER_H
2#define CANCELLATION_HANDLER_H
3
4#include <functional>
5
6namespace ara
7{
8 namespace diag
9 {
12 {
13 private:
14 bool mIsCanceled;
15 std::function<void()> mNotifier;
16
17 public:
18 CancellationHandler() = delete;
19 CancellationHandler(CancellationHandler &&) noexcept = default;
21 CancellationHandler &operator=(CancellationHandler &&) noexcept = default;
22 CancellationHandler &operator=(CancellationHandler &) = delete;
23
27 CancellationHandler(bool isCanceled) noexcept;
28
31 bool IsCanceled() const;
32
36 void SetIsCanceled(bool isCanceled);
37
40 void SetNotifier(std::function<void()> notifier);
41 };
42 }
43}
44
45#endif
A wrapper class around a conversation cancellation handler callback.
Definition: cancellation_handler.h:12
void SetIsCanceled(bool isCanceled)
Set conversation cancellation status.
Definition: cancellation_handler.cpp:16
void SetNotifier(std::function< void()> notifier)
Set a callback to be invoked when DM canceled the conversation.
Definition: cancellation_handler.cpp:29
bool IsCanceled() const
Get conversation cancellation status.
Definition: cancellation_handler.cpp:11