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"
17 
18 namespace Svc {
19 
22 
23  // ----------------------------------------------------------------------
24  // Friend classes
25  // ----------------------------------------------------------------------
26 
29 
30  public:
31 
32  // ----------------------------------------------------------------------
33  // Types
34  // ----------------------------------------------------------------------
35 
38 
40  enum class Signal : FwEnumStoreType {
44  fill,
46  status,
48  timeout,
49  };
50 
51  protected:
52 
53  // ----------------------------------------------------------------------
54  // Constructors and Destructors
55  // ----------------------------------------------------------------------
56 
59 
62 
63  protected:
64 
65  // ----------------------------------------------------------------------
66  // Initialization
67  // ----------------------------------------------------------------------
68 
70  void initBase(
71  const FwEnumStoreType id
72  );
73 
74  public:
75 
76  // ----------------------------------------------------------------------
77  // Getter functions
78  // ----------------------------------------------------------------------
79 
82 
83  public:
84 
85  // ----------------------------------------------------------------------
86  // Send signal functions
87  // ----------------------------------------------------------------------
88 
90  void sendSignal_timeout();
91 
93  void sendSignal_fill(
94  const Svc::ComDataContextPair& value
95  );
96 
98  void sendSignal_status(
99  const Fw::Success& value
100  );
101 
102  protected:
103 
104  // ----------------------------------------------------------------------
105  // Actions
106  // ----------------------------------------------------------------------
107 
109  virtual void action_doClear(
110  Signal signal
111  ) = 0;
112 
114  virtual void action_doFill(
115  Signal signal,
116  const Svc::ComDataContextPair& value
117  ) = 0;
118 
120  virtual void action_doSend(
121  Signal signal
122  ) = 0;
123 
125  virtual void action_doHold(
126  Signal signal,
127  const Svc::ComDataContextPair& value
128  ) = 0;
129 
131  virtual void action_doSplitHold(
132  Signal signal,
133  const Svc::ComDataContextPair& value
134  ) = 0;
135 
137  virtual void action_doNoteFailure(
138  Signal signal
139  ) = 0;
140 
142  virtual void action_assertNoStatus(
143  Signal signal
144  ) = 0;
145 
146  protected:
147 
148  // ----------------------------------------------------------------------
149  // Guards
150  // ----------------------------------------------------------------------
151 
153  virtual bool guard_isFull(
154  Signal signal,
155  const Svc::ComDataContextPair& value
156  ) const = 0;
157 
159  virtual bool guard_willFill(
160  Signal signal,
161  const Svc::ComDataContextPair& value
162  ) const = 0;
163 
165  virtual bool guard_isNotEmpty(
166  Signal signal
167  ) const = 0;
168 
170  virtual bool guard_isGood(
171  Signal signal,
172  const Fw::Success& value
173  ) const = 0;
174 
176  virtual bool guard_isSpanFull(
177  Signal signal
178  ) const = 0;
179 
180  private:
181 
182  // ----------------------------------------------------------------------
183  // State and choice entry
184  // ----------------------------------------------------------------------
185 
187  void enter_FILL(
188  Signal signal
189  );
190 
192  void enter_WAIT_STATUS(
193  Signal signal
194  );
195 
197  void enter_SPAN_CHECK(
198  Signal signal,
199  const Fw::Success& value
200  );
201 
203  void enter_IS_GOOD_STATUS(
204  Signal signal,
205  const Fw::Success& value
206  );
207 
209  void enter_WILL_FILL_THEN_SEND(
210  Signal signal,
211  const Svc::ComDataContextPair& value
212  );
213 
215  void enter_IS_FULL_THEN_SEND(
216  Signal signal,
217  const Svc::ComDataContextPair& value
218  );
219 
220  protected:
221 
222  // ----------------------------------------------------------------------
223  // Member variables
224  // ----------------------------------------------------------------------
225 
228 
231 
232  };
233 
234 }
235 
236 #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.
virtual bool guard_isSpanFull(Signal signal) const =0
Check if the aggregation buffer was completely filled from held continuation data.
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.
virtual void action_doSplitHold(Signal signal, const Svc::ComDataContextPair &value)=0
Hold a buffer, first splitting its leading bytes into the remaining frame space when spanning...
void sendSignal_fill(const Svc::ComDataContextPair &value)
Fill buffer signal.
virtual void action_doNoteFailure(Signal signal)=0
Record that the last frame was not acknowledged.
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.