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"
12 #if !FW_DIRECT_PORT_CALLS
14 #endif
15 #if !FW_DIRECT_PORT_CALLS
17 #endif
22 
23 namespace Svc {
24 
31  {
32 
33  // ----------------------------------------------------------------------
34  // Friend classes
35  // ----------------------------------------------------------------------
36 
40  friend class ComAggregatorTester;
41 
42  protected:
43 
44  // ----------------------------------------------------------------------
45  // Constants
46  // ----------------------------------------------------------------------
47 
49  enum {
54  };
55 
57  enum {
61  };
62 
64  enum class SmId : FwEnumStoreType {
66  };
67 
68  protected:
69 
70  // ----------------------------------------------------------------------
71  // Types for internal state machines
72  // ----------------------------------------------------------------------
73 
77  {
78 
79  // ----------------------------------------------------------------------
80  // Friend classes
81  // ----------------------------------------------------------------------
82 
86  friend class ComAggregatorTester;
87 
88  public:
89 
92  ComAggregatorComponentBase& component
93  );
94 
95  public:
96 
98  void init(
100  );
101 
102  public:
103 
106 
107  private:
108 
110  void action_doClear(
111  Signal signal
112  );
113 
115  void action_doFill(
116  Signal signal,
117  const Svc::ComDataContextPair& value
118  );
119 
121  void action_doSend(
122  Signal signal
123  );
124 
126  void action_doHold(
127  Signal signal,
128  const Svc::ComDataContextPair& value
129  );
130 
132  void action_doSplitHold(
133  Signal signal,
134  const Svc::ComDataContextPair& value
135  );
136 
138  void action_doNoteFailure(
139  Signal signal
140  );
141 
143  void action_assertNoStatus(
144  Signal signal
145  );
146 
147  private:
148 
150  bool guard_isFull(
151  Signal signal,
152  const Svc::ComDataContextPair& value
153  ) const;
154 
156  bool guard_willFill(
157  Signal signal,
158  const Svc::ComDataContextPair& value
159  ) const;
160 
162  bool guard_isNotEmpty(
163  Signal signal
164  ) const;
165 
167  bool guard_isGood(
168  Signal signal,
169  const Fw::Success& value
170  ) const;
171 
173  bool guard_isSpanFull(
174  Signal signal
175  ) const;
176 
177  private:
178 
180  ComAggregatorComponentBase& m_component;
181 
182  };
183 
184  public:
185 
186  // ----------------------------------------------------------------------
187  // Component initialization
188  // ----------------------------------------------------------------------
189 
191  void init(
192  FwSizeType queueDepth,
193  FwEnumStoreType instance = 0
194  );
195 
196 #if !FW_DIRECT_PORT_CALLS
197 
198  public:
199 
200  // ----------------------------------------------------------------------
201  // Getters for typed input ports
202  // ----------------------------------------------------------------------
203 
208  FwIndexType portNum
209  );
210 
215  FwIndexType portNum
216  );
217 
222  FwIndexType portNum
223  );
224 
229  FwIndexType portNum
230  );
231 
232 #endif
233 
234 #if !FW_DIRECT_PORT_CALLS
235 
236  public:
237 
238  // ----------------------------------------------------------------------
239  // Connect typed input ports to typed output ports
240  // ----------------------------------------------------------------------
241 
244  FwIndexType portNum,
246  );
247 
250  FwIndexType portNum,
252  );
253 
256  FwIndexType portNum,
258  );
259 
260 #endif
261 
262 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
263 
264  public:
265 
266  // ----------------------------------------------------------------------
267  // Connect serial input ports to typed output ports
268  // ----------------------------------------------------------------------
269 
272  FwIndexType portNum,
273  Fw::InputSerializePort* port
274  );
275 
278  FwIndexType portNum,
279  Fw::InputSerializePort* port
280  );
281 
284  FwIndexType portNum,
285  Fw::InputSerializePort* port
286  );
287 
288 #endif
289 
290  protected:
291 
292  // ----------------------------------------------------------------------
293  // Component construction and destruction
294  // ----------------------------------------------------------------------
295 
298  const char* compName = ""
299  );
300 
302  virtual ~ComAggregatorComponentBase();
303 
304  protected:
305 
306  // ----------------------------------------------------------------------
307  // Getters for numbers of typed input ports
308  // ----------------------------------------------------------------------
309 
315  }
316 
321  return NUM_DATAIN_INPUT_PORTS;
322  }
323 
329  }
330 
336  }
337 
338  protected:
339 
340  // ----------------------------------------------------------------------
341  // Getters for numbers of typed output ports
342  // ----------------------------------------------------------------------
343 
349  }
350 
356  }
357 
363  }
364 
365  protected:
366 
367  // ----------------------------------------------------------------------
368  // Connection status queries for typed output ports
369  // ----------------------------------------------------------------------
370 
375  FwIndexType portNum
376  ) const;
377 
382  FwIndexType portNum
383  ) const;
384 
389  FwIndexType portNum
390  ) const;
391 
392  protected:
393 
394  // ----------------------------------------------------------------------
395  // Handlers to implement for typed input ports
396  // ----------------------------------------------------------------------
397 
399  virtual void comStatusIn_handler(
400  FwIndexType portNum,
401  Fw::Success& condition
402  ) = 0;
403 
405  virtual void dataIn_handler(
406  FwIndexType portNum,
407  Fw::Buffer& data,
408  const ComCfg::FrameContext& context
409  ) = 0;
410 
412  virtual void dataReturnIn_handler(
413  FwIndexType portNum,
414  Fw::Buffer& data,
415  const ComCfg::FrameContext& context
416  ) = 0;
417 
419  virtual void timeout_handler(
420  FwIndexType portNum,
421  U32 context
422  ) = 0;
423 
424 #if FW_DIRECT_PORT_CALLS
425  public:
426 #else
427  protected:
428 #endif
429 
430  // ----------------------------------------------------------------------
431  // Port handler base-class functions for typed input ports
432  //
433  // Call these functions directly to bypass the corresponding ports
434  // ----------------------------------------------------------------------
435 
438  FwIndexType portNum,
439  Fw::Success& condition
440  );
441 
443  void dataIn_handlerBase(
444  FwIndexType portNum,
445  Fw::Buffer& data,
446  const ComCfg::FrameContext& context
447  );
448 
451  FwIndexType portNum,
452  Fw::Buffer& data,
453  const ComCfg::FrameContext& context
454  );
455 
457  void timeout_handlerBase(
458  FwIndexType portNum,
459  U32 context
460  );
461 
462  protected:
463 
464  // ----------------------------------------------------------------------
465  // Invocation functions for typed output ports
466  // ----------------------------------------------------------------------
467 
469  void comStatusOut_out(
470  FwIndexType portNum,
471  Fw::Success& condition
472  ) const;
473 
475  void dataOut_out(
476  FwIndexType portNum,
477  Fw::Buffer& data,
478  const ComCfg::FrameContext& context
479  ) const;
480 
482  void dataReturnOut_out(
483  FwIndexType portNum,
484  Fw::Buffer& data,
485  const ComCfg::FrameContext& context
486  ) const;
487 
488  protected:
489 
490  // ----------------------------------------------------------------------
491  // State getter functions
492  // ----------------------------------------------------------------------
493 
496 
497  protected:
498 
499  // ----------------------------------------------------------------------
500  // Signal send functions
501  // ----------------------------------------------------------------------
502 
505 
508  const Svc::ComDataContextPair& value
509  );
510 
513  const Fw::Success& value
514  );
515 
516  protected:
517 
518  // ----------------------------------------------------------------------
519  // Functions to implement for internal state machine actions
520  // ----------------------------------------------------------------------
521 
526  SmId smId,
528  ) = 0;
529 
534  SmId smId,
536  const Svc::ComDataContextPair& value
537  ) = 0;
538 
543  SmId smId,
545  ) = 0;
546 
551  SmId smId,
553  const Svc::ComDataContextPair& value
554  ) = 0;
555 
560  SmId smId,
562  const Svc::ComDataContextPair& value
563  ) = 0;
564 
569  SmId smId,
571  ) = 0;
572 
577  SmId smId,
579  ) = 0;
580 
581  protected:
582 
583  // ----------------------------------------------------------------------
584  // Functions to implement for internal state machine guards
585  // ----------------------------------------------------------------------
586 
591  SmId smId,
593  const Svc::ComDataContextPair& value
594  ) const = 0;
595 
600  SmId smId,
602  const Svc::ComDataContextPair& value
603  ) const = 0;
604 
609  SmId smId,
611  ) const = 0;
612 
617  SmId smId,
619  const Fw::Success& value
620  ) const = 0;
621 
626  SmId smId,
628  ) const = 0;
629 
630  private:
631 
632  // ----------------------------------------------------------------------
633  // Message dispatch functions
634  // ----------------------------------------------------------------------
635 
637  virtual MsgDispatchStatus doDispatch();
638 
639  private:
640 
641  // ----------------------------------------------------------------------
642  // Calls for messages received on typed input ports
643  // ----------------------------------------------------------------------
644 
646  static void m_p_comStatusIn_in(
647  Fw::PassiveComponentBase* callComp,
648  FwIndexType portNum,
649  Fw::Success& condition
650  );
651 
653  static void m_p_dataIn_in(
654  Fw::PassiveComponentBase* callComp,
655  FwIndexType portNum,
656  Fw::Buffer& data,
657  const ComCfg::FrameContext& context
658  );
659 
661  static void m_p_dataReturnIn_in(
662  Fw::PassiveComponentBase* callComp,
663  FwIndexType portNum,
664  Fw::Buffer& data,
665  const ComCfg::FrameContext& context
666  );
667 
669  static void m_p_timeout_in(
670  Fw::PassiveComponentBase* callComp,
671  FwIndexType portNum,
672  U32 context
673  );
674 
675  private:
676 
677  // ----------------------------------------------------------------------
678  // Send signal helper functions
679  // ----------------------------------------------------------------------
680 
682  void sendSignalStart(
683  SmId smId,
684  FwEnumStoreType signal,
685  Fw::SerialBufferBase& buffer
686  );
687 
689  void aggregationMachine_sendSignalFinish(
690  Fw::LinearBufferBase& buffer
691  );
692 
693  private:
694 
695  // ----------------------------------------------------------------------
696  // Helper functions for state machine dispatch
697  // ----------------------------------------------------------------------
698 
700  void smDispatch(
701  Fw::SerialBufferBase& buffer
702  );
703 
705  static void deserializeSmIdAndSignal(
706  Fw::SerialBufferBase& buffer,
707  FwEnumStoreType& smId,
708  FwEnumStoreType& signal
709  );
710 
712  void Svc_AggregationMachine_smDispatch(
713  Fw::SerialBufferBase& buffer,
714  Svc_AggregationMachine& sm,
716  );
717 
718 #if !FW_DIRECT_PORT_CALLS
719 
720  private:
721 
722  // ----------------------------------------------------------------------
723  // Typed input ports
724  // ----------------------------------------------------------------------
725 
728 
731 
734 
736  Svc::InputSchedPort m_timeout_InputPort[NUM_TIMEOUT_INPUT_PORTS];
737 
738 #endif
739 
740 #if !FW_DIRECT_PORT_CALLS
741 
742  private:
743 
744  // ----------------------------------------------------------------------
745  // Typed output ports
746  // ----------------------------------------------------------------------
747 
750 
753 
756 
757 #endif
758 
759  private:
760 
761  // ----------------------------------------------------------------------
762  // State machine instances
763  // ----------------------------------------------------------------------
764 
766  Svc_AggregationMachine m_stateMachine_aggregationMachine;
767 
768  };
769 
770 }
771 
772 #endif
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
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum) const
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 init(ComAggregatorComponentBase::SmId smId)
Initialize the state machine.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
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.
virtual void Svc_AggregationMachine_action_doNoteFailure(SmId smId, Svc_AggregationMachine::Signal signal)=0
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
virtual void Svc_AggregationMachine_action_doSplitHold(SmId smId, Svc_AggregationMachine::Signal signal, const Svc::ComDataContextPair &value)=0
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
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.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
ComAggregatorComponentBase(const char *compName="")
Construct ComAggregatorComponentBase object.
friend class ComAggregatorTesterBase
Autocoded test harness for the enclosing component.
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
Svc::AggregationMachine_State State
The state type.
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition) const
Invoke output port comStatusOut.
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.
virtual bool Svc_AggregationMachine_guard_isSpanFull(SmId smId, Svc_AggregationMachine::Signal signal) const =0
virtual void Svc_AggregationMachine_action_doSend(SmId smId, Svc_AggregationMachine::Signal signal)=0
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
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].
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.