Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
debouncer.h
1#ifndef DEBOUNCER_H
2#define DEBOUNCER_H
3
4#include <functional>
5
6namespace ara
7{
8 namespace diag
9 {
12 namespace debouncing
13 {
16 {
17 kPassed = -1,
19 kFailed = 1
20 };
21
24 {
25 private:
26 EventStatus mEventStatus;
27
28 std::function<void(bool)> onEventStatusChanged;
29
30 protected:
33 explicit Debouncer(std::function<void(bool)> callback);
34
37 void SetEventStatus(EventStatus status);
38
39 public:
41 virtual void ReportPrepassed() = 0;
42
44 virtual void ReportPassed() = 0;
45
47 virtual void ReportPrefailed() = 0;
48
50 virtual void ReportFailed() = 0;
51
53 virtual void Freeze() = 0;
54
56 virtual void Reset() = 0;
57
58 virtual ~Debouncer() noexcept = default;
59 };
60 }
61 }
62}
63
64#endif
Debouncing mechanism interface.
Definition: debouncer.h:24
void SetEventStatus(EventStatus status)
Set the monitored event status.
Definition: debouncer.cpp:14
virtual void ReportFailed()=0
Report finally failed of the monitored event.
virtual void Freeze()=0
Freeze the debouncing mechanism.
virtual void ReportPassed()=0
Report finally passed of the monitored event.
virtual void ReportPrepassed()=0
Report pre-passed of the monitored event.
virtual void Reset()=0
Reset the debouncing mechanism.
virtual void ReportPrefailed()=0
Report pre-failed of the monitored event.
Debouncer(std::function< void(bool)> callback)
Constructor.
Definition: debouncer.cpp:9
EventStatus
Monitored event status.
Definition: debouncer.h:16
@ kPending
!< Finally healed event
Definition: debouncer.h:18
@ kFailed
!< Pending status event
Definition: debouncer.h:19