Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
recovery_action.h
1#ifndef RECOVERY_ACTION_H
2#define RECOVERY_ACTION_H
3
4#include "../core/result.h"
5#include "../core/instance_specifier.h"
6#include "../exec/execution_error_event.h"
7
8namespace ara
9{
10 namespace phm
11 {
13 enum class TypeOfSupervision : uint32_t
14 {
15 AliveSupervision = 0,
18 };
19
24 {
25 private:
26 const core::InstanceSpecifier &mInstance;
27 bool mOffered;
28
29 protected:
32 explicit RecoveryAction(const core::InstanceSpecifier &instance);
33
36 bool IsOffered() const noexcept;
37
38 public:
39 RecoveryAction(RecoveryAction &&ra) noexcept;
40 RecoveryAction(const RecoveryAction &ra) = delete;
41 RecoveryAction &operator=(const RecoveryAction &ra) = delete;
42
43 virtual ~RecoveryAction() noexcept = default;
44
50 virtual void RecoveryHandler(
51 const exec::ExecutionErrorEvent &executionError,
52 TypeOfSupervision supervision) = 0;
53
58
61 void StopOffer() noexcept;
62 };
63 }
64}
65
66#endif
AUTOSAR shortname-path wrapper.
Definition: instance_specifier.h:14
A wrapper around the callee's return value and its possible error.
Definition: result.h:16
An abstract class to wrap the action for recovering a supervised entity.
Definition: recovery_action.h:24
void StopOffer() noexcept
Stop offering the recovery action.
Definition: recovery_action.cpp:31
virtual void RecoveryHandler(const exec::ExecutionErrorEvent &executionError, TypeOfSupervision supervision)=0
Perform the action to handle the recovery.
core::Result< void > Offer()
Start offering the recovery action.
Definition: recovery_action.cpp:24
bool IsOffered() const noexcept
Indicate whether the action has been already offered or not.
Definition: recovery_action.cpp:19
RecoveryAction(const core::InstanceSpecifier &instance)
Constructor.
Definition: recovery_action.cpp:7
TypeOfSupervision
Supervision algorithm type.
Definition: recovery_action.h:14
@ DeadlineSupervision
!< Supervision by measuring the time interval of a single checkpoint
@ LogicalSupervision
!< Supervision by measuring the time difference between two checkpoints
Undefined Function Group State event argument.
Definition: execution_error_event.h:15