Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
global_supervision.h
1#ifndef GLOBAL_SUPERVISION_H
2#define GLOBAL_SUPERVISION_H
3
4#include <vector>
5#include "./elementary_supervision.h"
6
7namespace ara
8{
9 namespace phm
10 {
11 namespace supervisors
12 {
15 {
18
21 };
22
26 {
27 private:
28 const std::vector<ElementarySupervision *> mSupervisors;
29
30 SupervisionStatus mStatus;
31 std::function<void(SupervisionUpdate)> mOnGlobalStatusChanged;
32
33 SupervisionUpdate getGlobalUpdate() const;
34 void onElementaryStatusChanged(SupervisionStatus status);
35
36 public:
39 explicit GlobalSupervision(
40 std::initializer_list<ElementarySupervision *> supervisors);
41 ~GlobalSupervision() noexcept = default;
42
45 SupervisionStatus GetStatus() const noexcept;
46
49 void SetCallback(
50 std::function<void(SupervisionUpdate)> &&callback);
51 };
52 }
53 }
54}
55
56#endif
A class to report the global supervision status based on several elementary supervisions.
Definition: global_supervision.h:26
GlobalSupervision(std::initializer_list< ElementarySupervision * > supervisors)
Constructor.
Definition: global_supervision.cpp:9
void SetCallback(std::function< void(SupervisionUpdate)> &&callback)
Set a callback to be invoked on the global supervision status change.
Definition: global_supervision.cpp:66
SupervisionStatus GetStatus() const noexcept
Get the supervision status.
Definition: global_supervision.cpp:61
SupervisionStatus
Supervision finite state machine status.
Definition: elementary_supervision.h:17
TypeOfSupervision
Supervision algorithm type.
Definition: recovery_action.h:14
Supervision update on global status.
Definition: global_supervision.h:15
TypeOfSupervision type
Dominant supervision method that determined the global status.
Definition: global_supervision.h:20
SupervisionStatus status
Updated supervision status.
Definition: global_supervision.h:17