F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComAggregatorComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComAggregatorComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ComAggregator component base class
5 // ======================================================================
6 
7 #ifndef Svc_ComAggregatorComponentAc_HPP
8 #define Svc_ComAggregatorComponentAc_HPP
9 
11 #include "Fw/FPrimeBasicTypes.hpp"
18 
19 namespace Svc {
20 
27  {
28 
29  // ----------------------------------------------------------------------
30  // Friend classes
31  // ----------------------------------------------------------------------
32 
36  friend class ComAggregatorTester;
37 
38  protected:
39 
40  // ----------------------------------------------------------------------
41  // Constants
42  // ----------------------------------------------------------------------
43 
45  enum {
50  };
51 
53  enum {
57  };
58 
60  enum class SmId : FwEnumStoreType {
62  };
63 
64  protected:
65 
66  // ----------------------------------------------------------------------
67  // Types for internal state machines
68  // ----------------------------------------------------------------------
69 
73  {
74 
75  // ----------------------------------------------------------------------
76  // Friend classes
77  // ----------------------------------------------------------------------
78 
82  friend class ComAggregatorTester;
83 
84  public:
85 
88  ComAggregatorComponentBase& component
89  );
90 
91  public:
92 
94  void init(
96  );
97 
98  public:
99 
102 
103  private:
104 
106  void action_doClear(
107  Signal signal
108  );
109 
111  void action_doFill(
112  Signal signal,
113  const Svc::ComDataContextPair& value
114  );
115 
117  void action_doSend(
118  Signal signal
119  );
120 
122  void action_doHold(
123  Signal signal,
124  const Svc::ComDataContextPair& value
125  );
126 
128  void action_assertNoStatus(
129  Signal signal
130  );
131 
132  private:
133 
135  bool guard_isFull(
136  Signal signal,
137  const Svc::ComDataContextPair& value
138  ) const;
139 
141  bool guard_willFill(
142  Signal signal,
143  const Svc::ComDataContextPair& value
144  ) const;
145 
147  bool guard_isNotEmpty(
148  Signal signal
149  ) const;
150 
152  bool guard_isGood(
153  Signal signal,
154  const Fw::Success& value
155  ) const;
156 
157  private:
158 
160  ComAggregatorComponentBase& m_component;
161 
162  };
163 
164  public:
165 
166  // ----------------------------------------------------------------------
167  // Component initialization
168  // ----------------------------------------------------------------------
169 
171  void init(
172  FwSizeType queueDepth,
173  FwEnumStoreType instance = 0
174  );
175 
176  public:
177 
178  // ----------------------------------------------------------------------
179  // Getters for typed input ports
180  // ----------------------------------------------------------------------
181 
186  FwIndexType portNum
187  );
188 
193  FwIndexType portNum
194  );
195 
200  FwIndexType portNum
201  );
202 
207  FwIndexType portNum
208  );
209 
210  public:
211 
212  // ----------------------------------------------------------------------
213  // Connect typed input ports to typed output ports
214  // ----------------------------------------------------------------------
215 
218  FwIndexType portNum,
220  );
221 
224  FwIndexType portNum,
226  );
227 
230  FwIndexType portNum,
232  );
233 
234 #if FW_PORT_SERIALIZATION
235 
236  public:
237 
238  // ----------------------------------------------------------------------
239  // Connect serial input ports to typed output ports
240  // ----------------------------------------------------------------------
241 
244  FwIndexType portNum,
245  Fw::InputSerializePort* port
246  );
247 
250  FwIndexType portNum,
251  Fw::InputSerializePort* port
252  );
253 
256  FwIndexType portNum,
257  Fw::InputSerializePort* port
258  );
259 
260 #endif
261 
262  protected:
263 
264  // ----------------------------------------------------------------------
265  // Component construction and destruction
266  // ----------------------------------------------------------------------
267 
270  const char* compName = ""
271  );
272 
274  virtual ~ComAggregatorComponentBase();
275 
276  protected:
277 
278  // ----------------------------------------------------------------------
279  // Getters for numbers of typed input ports
280  // ----------------------------------------------------------------------
281 
287  }
288 
293  return NUM_DATAIN_INPUT_PORTS;
294  }
295 
301  }
302 
308  }
309 
310  protected:
311 
312  // ----------------------------------------------------------------------
313  // Getters for numbers of typed output ports
314  // ----------------------------------------------------------------------
315 
321  }
322 
328  }
329 
335  }
336 
337  protected:
338 
339  // ----------------------------------------------------------------------
340  // Connection status queries for typed output ports
341  // ----------------------------------------------------------------------
342 
347  FwIndexType portNum
348  );
349 
354  FwIndexType portNum
355  );
356 
361  FwIndexType portNum
362  );
363 
364  protected:
365 
366  // ----------------------------------------------------------------------
367  // Handlers to implement for typed input ports
368  // ----------------------------------------------------------------------
369 
371  virtual void comStatusIn_handler(
372  FwIndexType portNum,
373  Fw::Success& condition
374  ) = 0;
375 
377  virtual void dataIn_handler(
378  FwIndexType portNum,
379  Fw::Buffer& data,
380  const ComCfg::FrameContext& context
381  ) = 0;
382 
384  virtual void dataReturnIn_handler(
385  FwIndexType portNum,
386  Fw::Buffer& data,
387  const ComCfg::FrameContext& context
388  ) = 0;
389 
391  virtual void timeout_handler(
392  FwIndexType portNum,
393  U32 context
394  ) = 0;
395 
396  protected:
397 
398  // ----------------------------------------------------------------------
399  // Port handler base-class functions for typed input ports
400  //
401  // Call these functions directly to bypass the corresponding ports
402  // ----------------------------------------------------------------------
403 
406  FwIndexType portNum,
407  Fw::Success& condition
408  );
409 
411  void dataIn_handlerBase(
412  FwIndexType portNum,
413  Fw::Buffer& data,
414  const ComCfg::FrameContext& context
415  );
416 
419  FwIndexType portNum,
420  Fw::Buffer& data,
421  const ComCfg::FrameContext& context
422  );
423 
425  void timeout_handlerBase(
426  FwIndexType portNum,
427  U32 context
428  );
429 
430  protected:
431 
432  // ----------------------------------------------------------------------
433  // Invocation functions for typed output ports
434  // ----------------------------------------------------------------------
435 
437  void comStatusOut_out(
438  FwIndexType portNum,
439  Fw::Success& condition
440  );
441 
443  void dataOut_out(
444  FwIndexType portNum,
445  Fw::Buffer& data,
446  const ComCfg::FrameContext& context
447  );
448 
450  void dataReturnOut_out(
451  FwIndexType portNum,
452  Fw::Buffer& data,
453  const ComCfg::FrameContext& context
454  );
455 
456  protected:
457 
458  // ----------------------------------------------------------------------
459  // State getter functions
460  // ----------------------------------------------------------------------
461 
464 
465  protected:
466 
467  // ----------------------------------------------------------------------
468  // Signal send functions
469  // ----------------------------------------------------------------------
470 
473 
476  const Svc::ComDataContextPair& value
477  );
478 
481  const Fw::Success& value
482  );
483 
484  protected:
485 
486  // ----------------------------------------------------------------------
487  // Functions to implement for internal state machine actions
488  // ----------------------------------------------------------------------
489 
494  SmId smId,
496  ) = 0;
497 
502  SmId smId,
504  const Svc::ComDataContextPair& value
505  ) = 0;
506 
511  SmId smId,
513  ) = 0;
514 
519  SmId smId,
521  const Svc::ComDataContextPair& value
522  ) = 0;
523 
528  SmId smId,
530  ) = 0;
531 
532  protected:
533 
534  // ----------------------------------------------------------------------
535  // Functions to implement for internal state machine guards
536  // ----------------------------------------------------------------------
537 
542  SmId smId,
544  const Svc::ComDataContextPair& value
545  ) const = 0;
546 
551  SmId smId,
553  const Svc::ComDataContextPair& value
554  ) const = 0;
555 
560  SmId smId,
562  ) const = 0;
563 
568  SmId smId,
570  const Fw::Success& value
571  ) const = 0;
572 
573  private:
574 
575  // ----------------------------------------------------------------------
576  // Message dispatch functions
577  // ----------------------------------------------------------------------
578 
580  virtual MsgDispatchStatus doDispatch();
581 
582  private:
583 
584  // ----------------------------------------------------------------------
585  // Calls for messages received on typed input ports
586  // ----------------------------------------------------------------------
587 
589  static void m_p_comStatusIn_in(
590  Fw::PassiveComponentBase* callComp,
591  FwIndexType portNum,
592  Fw::Success& condition
593  );
594 
596  static void m_p_dataIn_in(
597  Fw::PassiveComponentBase* callComp,
598  FwIndexType portNum,
599  Fw::Buffer& data,
600  const ComCfg::FrameContext& context
601  );
602 
604  static void m_p_dataReturnIn_in(
605  Fw::PassiveComponentBase* callComp,
606  FwIndexType portNum,
607  Fw::Buffer& data,
608  const ComCfg::FrameContext& context
609  );
610 
612  static void m_p_timeout_in(
613  Fw::PassiveComponentBase* callComp,
614  FwIndexType portNum,
615  U32 context
616  );
617 
618  private:
619 
620  // ----------------------------------------------------------------------
621  // Send signal helper functions
622  // ----------------------------------------------------------------------
623 
625  void sendSignalStart(
626  SmId smId,
627  FwEnumStoreType signal,
628  Fw::SerialBufferBase& buffer
629  );
630 
632  void aggregationMachine_sendSignalFinish(
633  Fw::LinearBufferBase& buffer
634  );
635 
636  private:
637 
638  // ----------------------------------------------------------------------
639  // Helper functions for state machine dispatch
640  // ----------------------------------------------------------------------
641 
643  void smDispatch(
644  Fw::SerialBufferBase& buffer
645  );
646 
648  static void deserializeSmIdAndSignal(
649  Fw::SerialBufferBase& buffer,
650  FwEnumStoreType& smId,
651  FwEnumStoreType& signal
652  );
653 
655  void Svc_AggregationMachine_smDispatch(
656  Fw::SerialBufferBase& buffer,
657  Svc_AggregationMachine& sm,
659  );
660 
661  private:
662 
663  // ----------------------------------------------------------------------
664  // Typed input ports
665  // ----------------------------------------------------------------------
666 
669 
672 
675 
677  Svc::InputSchedPort m_timeout_InputPort[NUM_TIMEOUT_INPUT_PORTS];
678 
679  private:
680 
681  // ----------------------------------------------------------------------
682  // Typed output ports
683  // ----------------------------------------------------------------------
684 
687 
690 
693 
694  private:
695 
696  // ----------------------------------------------------------------------
697  // State machine instances
698  // ----------------------------------------------------------------------
699 
701  Svc_AggregationMachine m_stateMachine_aggregationMachine;
702 
703  };
704 
705 }
706 
707 #endif
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition)
Invoke output port comStatusOut.
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
static constexpr FwIndexType getNum_dataOut_OutputPorts()
PlatformSizeType FwSizeType
static constexpr FwIndexType getNum_dataIn_InputPorts()
virtual void Svc_AggregationMachine_action_doClear(SmId smId, Svc_AggregationMachine::Signal signal)=0
I32 FwEnumStoreType
virtual void Svc_AggregationMachine_action_doFill(SmId smId, Svc_AggregationMachine::Signal signal, const Svc::ComDataContextPair &value)=0
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
virtual bool Svc_AggregationMachine_guard_isFull(SmId smId, Svc_AggregationMachine::Signal signal, const Svc::ComDataContextPair &value) const =0
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
void init(ComAggregatorComponentBase::SmId smId)
Initialize the state machine.
void aggregationMachine_sendSignal_status(const Fw::Success &value)
Send signal status to state machine aggregationMachine.
static constexpr FwIndexType getNum_timeout_InputPorts()
void timeout_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port timeout.
static constexpr FwIndexType getNum_comStatusIn_InputPorts()
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
virtual ~ComAggregatorComponentBase()
Destroy ComAggregatorComponentBase object.
Svc_AggregationMachine::State aggregationMachine_getState() const
Get the state of state machine instance aggregationMachine.
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:24
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
virtual void Svc_AggregationMachine_action_assertNoStatus(SmId smId, Svc_AggregationMachine::Signal signal)=0
Svc_AggregationMachine(ComAggregatorComponentBase &component)
Constructor.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
friend class ComAggregatorTester
Test implementation for the enclosing component.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
virtual void Svc_AggregationMachine_action_doHold(SmId smId, Svc_AggregationMachine::Signal signal, const Svc::ComDataContextPair &value)=0
ComAggregatorComponentBase::SmId getId() const
Get the state machine id.
virtual void timeout_handler(FwIndexType portNum, U32 context)=0
Handler for input port timeout.
ComAggregatorComponentBase(const char *compName="")
Construct ComAggregatorComponentBase object.
friend class ComAggregatorTesterBase
Autocoded test harness for the enclosing component.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum)
virtual bool Svc_AggregationMachine_guard_willFill(SmId smId, Svc_AggregationMachine::Signal signal, const Svc::ComDataContextPair &value) const =0
friend class ComAggregatorTesterBase
Friend class tester to support autocoded test harness.
Implementation of state machine Svc_AggregationMachine.
Auto-generated base for ComAggregator component.
virtual bool Svc_AggregationMachine_guard_isGood(SmId smId, Svc_AggregationMachine::Signal signal, const Fw::Success &value) const =0
void aggregationMachine_sendSignal_timeout()
Send signal timeout to state machine aggregationMachine.
virtual bool Svc_AggregationMachine_guard_isNotEmpty(SmId smId, Svc_AggregationMachine::Signal signal) const =0
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
PlatformIndexType FwIndexType
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
Type used to pass context info between components during framing/deframing.
Svc::InputSchedPort * get_timeout_InputPort(FwIndexType portNum)
RateGroupDivider component implementation.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
virtual void Svc_AggregationMachine_action_doSend(SmId smId, Svc_AggregationMachine::Signal signal)=0
void aggregationMachine_sendSignal_fill(const Svc::ComDataContextPair &value)
Send signal fill to state machine aggregationMachine.
Success/Failure.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
friend class ComAggregatorTester
Friend class tester implementation to support white-box testing.