Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
checkpoint_communicator.h
1#ifndef CHECKPOINT_COMMUNICATOR_H
2#define CHECKPOINT_COMMUNICATOR_H
3
4#include <stdint.h>
5#include <functional>
6
7namespace ara
8{
10 namespace phm
11 {
15 {
16 public:
18 using CheckpointReception = std::function<void(uint32_t)>;
19
20 protected:
23
24 CheckpointCommunicator() noexcept = default;
25
26 public:
30 virtual bool TrySend(uint32_t checkpoint) = 0;
31
34 void SetCallback(CheckpointReception &&callback);
35
37 void ResetCallback() noexcept;
38
39 virtual ~CheckpointCommunicator() noexcept;
40 };
41 }
42}
43
44#endif
An abstract class to communicate a checkpoint between an application and the PHM cluster.
Definition: checkpoint_communicator.h:15
void SetCallback(CheckpointReception &&callback)
Set a callback to be invoked at a checkpoint reception.
Definition: checkpoint_communicator.cpp:7
virtual bool TrySend(uint32_t checkpoint)=0
Try to send a checkpoint occurrence.
CheckpointReception Callback
Callback to be invoked at a checkpoint reception.
Definition: checkpoint_communicator.h:22
void ResetCallback() noexcept
Reset the callback to be invoked at a checkpoint reception.
Definition: checkpoint_communicator.cpp:12
std::function< void(uint32_t)> CheckpointReception
Callback type for checkpoint reception.
Definition: checkpoint_communicator.h:18