F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
AggregationMachineStateMachineAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title AggregationMachineStateMachineAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for AggregationMachine state machine
5 // ======================================================================
6 
7 #ifndef Svc_AggregationMachineStateMachineAc_HPP
8 #define Svc_AggregationMachineStateMachineAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
13 #include "Fw/Types/String.hpp"
16 
17 namespace Svc {
18 
21 
22  // ----------------------------------------------------------------------
23  // Friend classes
24  // ----------------------------------------------------------------------
25 
28 
29  public:
30 
31  // ----------------------------------------------------------------------
32  // Types
33  // ----------------------------------------------------------------------
34 
36  enum class State : FwEnumStoreType {
40  FILL,
43  };
44 
46  enum class Signal : FwEnumStoreType {
50  fill,
52  status,
54  timeout,
55  };
56 
57  protected:
58 
59  // ----------------------------------------------------------------------
60  // Constructors and Destructors
61  // ----------------------------------------------------------------------
62 
65 
68 
69  protected:
70 
71  // ----------------------------------------------------------------------
72  // Initialization
73  // ----------------------------------------------------------------------
74 
76  void initBase(
77  const FwEnumStoreType id
78  );
79 
80  public:
81 
82  // ----------------------------------------------------------------------
83  // Getter functions
84  // ----------------------------------------------------------------------
85 
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Send signal functions
93  // ----------------------------------------------------------------------
94 
96  void sendSignal_timeout();
97 
99  void sendSignal_fill(
100  const Svc::ComDataContextPair& value
101  );
102 
104  void sendSignal_status(
105  const Fw::Success& value
106  );
107 
108  protected:
109 
110  // ----------------------------------------------------------------------
111  // Actions
112  // ----------------------------------------------------------------------
113 
115  virtual void action_doClear(
116  Signal signal
117  ) = 0;
118 
120  virtual void action_doFill(
121  Signal signal,
122  const Svc::ComDataContextPair& value
123  ) = 0;
124 
126  virtual void action_doSend(
127  Signal signal
128  ) = 0;
129 
131  virtual void action_doHold(
132  Signal signal,
133  const Svc::ComDataContextPair& value
134  ) = 0;
135 
137  virtual void action_assertNoStatus(
138  Signal signal
139  ) = 0;
140 
141  protected:
142 
143  // ----------------------------------------------------------------------
144  // Guards
145  // ----------------------------------------------------------------------
146 
148  virtual bool guard_isFull(
149  Signal signal,
150  const Svc::ComDataContextPair& value
151  ) const = 0;
152 
154  virtual bool guard_willFill(
155  Signal signal,
156  const Svc::ComDataContextPair& value
157  ) const = 0;
158 
160  virtual bool guard_isNotEmpty(
161  Signal signal
162  ) const = 0;
163 
165  virtual bool guard_isGood(
166  Signal signal,
167  const Fw::Success& value
168  ) const = 0;
169 
170  private:
171 
172  // ----------------------------------------------------------------------
173  // State and choice entry
174  // ----------------------------------------------------------------------
175 
177  void enter_FILL(
178  Signal signal
179  );
180 
182  void enter_WAIT_STATUS(
183  Signal signal
184  );
185 
187  void enter_IS_GOOD_STATUS(
188  Signal signal,
189  const Fw::Success& value
190  );
191 
193  void enter_WILL_FILL_THEN_SEND(
194  Signal signal,
195  const Svc::ComDataContextPair& value
196  );
197 
199  void enter_IS_FULL_THEN_SEND(
200  Signal signal,
201  const Svc::ComDataContextPair& value
202  );
203 
204  protected:
205 
206  // ----------------------------------------------------------------------
207  // Member variables
208  // ----------------------------------------------------------------------
209 
212 
215 
216  };
217 
218 }
219 
220 #endif
virtual void action_doHold(Signal signal, const Svc::ComDataContextPair &value)=0
Hold a buffer.
virtual void action_doClear(Signal signal)=0
Clear the buffer fill state, last status.
void sendSignal_status(const Fw::Success &value)
Status return.
void sendSignal_timeout()
Rate-group driven timeout signal.
I32 FwEnumStoreType
AggregationMachineStateMachineBase::State getState() const
Get the state.
void initBase(const FwEnumStoreType id)
Initialize the state machine.
friend class AggregationMachineTester
Tester class for the state machine.
virtual bool guard_isNotEmpty(Signal signal) const =0
Check if not empty.
virtual void action_doFill(Signal signal, const Svc::ComDataContextPair &value)=0
Fill the buffer with data.
virtual bool guard_isFull(Signal signal, const Svc::ComDataContextPair &value) const =0
Check if the aggregation buffer is full, i.e. cannot accept the incoming buffer.
void sendSignal_fill(const Svc::ComDataContextPair &value)
Fill buffer signal.
virtual void action_assertNoStatus(Signal signal)=0
Assert no status when in fill state.
virtual bool guard_isGood(Signal signal, const Fw::Success &value) const =0
Check if last status is good.
RateGroupDivider component implementation.
virtual void action_doSend(Signal signal)=0
Send the buffer data.
virtual bool guard_willFill(Signal signal, const Svc::ComDataContextPair &value) const =0
Check if the aggregation will fill, i.e. the incoming buffer will exactly fit.
Success/Failure.