Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
trigger_inout.h
1#ifndef TRIGGER_INOUT_H
2#define TRIGGER_INOUT_H
3
4#include "./trigger.h"
5#include "./notifier.h"
6
7namespace ara
8{
9 namespace sm
10 {
13 template <typename T>
15 {
16 private:
17 Trigger<T> mTrigger;
18 Notifier<T> mNotifier;
19
20 public:
24 TriggerInOut(T &state, TriggerHandler handler) : mTrigger(state, handler),
25 mNotifier(state)
26 {
27 }
28
29 TriggerInOut() = delete;
30 ~TriggerInOut() noexcept = default;
31 TriggerInOut(const TriggerInOut &) = delete;
32 TriggerInOut(TriggerInOut &&) = delete;
33 TriggerInOut &operator=(const TriggerInOut &) = delete;
34 TriggerInOut &operator=(TriggerInOut &&) = delete;
35
38 Trigger<T> &GetTrigger() noexcept
39 {
40 return mTrigger;
41 }
42
46 {
47 return mNotifier;
48 }
49 };
50 }
51}
52
53#endif
State changing notifier wrapper.
Definition: notifier.h:20
State input and output trigger.
Definition: trigger_inout.h:15
Notifier< T > & GetNotifier() noexcept
Notifier property getter.
Definition: trigger_inout.h:45
Trigger< T > & GetTrigger() noexcept
Trigger property getter.
Definition: trigger_inout.h:38
TriggerInOut(T &state, TriggerHandler handler)
Constructor.
Definition: trigger_inout.h:24
State changing trigger wrapper.
Definition: trigger.h:17
std::function< void()> TriggerHandler
Callback on trigger invocation.
Definition: trigger.h:11