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_isNotEmpty(
142  Signal signal
143  ) const;
144 
146  bool guard_isGood(
147  Signal signal,
148  const Fw::Success& value
149  ) const;
150 
151  private:
152 
154  ComAggregatorComponentBase& m_component;
155 
156  };
157 
158  public:
159 
160  // ----------------------------------------------------------------------
161  // Component initialization
162  // ----------------------------------------------------------------------
163 
165  void init(
166  FwSizeType queueDepth,
167  FwEnumStoreType instance = 0
168  );
169 
170  public:
171 
172  // ----------------------------------------------------------------------
173  // Getters for typed input ports
174  // ----------------------------------------------------------------------
175 
180  FwIndexType portNum
181  );
182 
187  FwIndexType portNum
188  );
189 
194  FwIndexType portNum
195  );
196 
201  FwIndexType portNum
202  );
203 
204  public:
205 
206  // ----------------------------------------------------------------------
207  // Connect typed input ports to typed output ports
208  // ----------------------------------------------------------------------
209 
212  FwIndexType portNum,
214  );
215 
218  FwIndexType portNum,
220  );
221 
224  FwIndexType portNum,
226  );
227 
228 #if FW_PORT_SERIALIZATION
229 
230  public:
231 
232  // ----------------------------------------------------------------------
233  // Connect serial input ports to typed output ports
234  // ----------------------------------------------------------------------
235 
238  FwIndexType portNum,
239  Fw::InputSerializePort* port
240  );
241 
244  FwIndexType portNum,
245  Fw::InputSerializePort* port
246  );
247 
250  FwIndexType portNum,
251  Fw::InputSerializePort* port
252  );
253 
254 #endif
255 
256  protected:
257 
258  // ----------------------------------------------------------------------
259  // Component construction and destruction
260  // ----------------------------------------------------------------------
261 
264  const char* compName = ""
265  );
266 
268  virtual ~ComAggregatorComponentBase();
269 
270  protected:
271 
272  // ----------------------------------------------------------------------
273  // Getters for numbers of typed input ports
274  // ----------------------------------------------------------------------
275 
281  }
282 
287  return NUM_DATAIN_INPUT_PORTS;
288  }
289 
295  }
296 
302  }
303 
304  protected:
305 
306  // ----------------------------------------------------------------------
307  // Getters for numbers of typed output ports
308  // ----------------------------------------------------------------------
309 
315  }
316 
322  }
323 
329  }
330 
331  protected:
332 
333  // ----------------------------------------------------------------------
334  // Connection status queries for typed output ports
335  // ----------------------------------------------------------------------
336 
341  FwIndexType portNum
342  );
343 
348  FwIndexType portNum
349  );
350 
355  FwIndexType portNum
356  );
357 
358  protected:
359 
360  // ----------------------------------------------------------------------
361  // Handlers to implement for typed input ports
362  // ----------------------------------------------------------------------
363 
365  virtual void comStatusIn_handler(
366  FwIndexType portNum,
367  Fw::Success& condition
368  ) = 0;
369 
371  virtual void dataIn_handler(
372  FwIndexType portNum,
373  Fw::Buffer& data,
374  const ComCfg::FrameContext& context
375  ) = 0;
376 
378  virtual void dataReturnIn_handler(
379  FwIndexType portNum,
380  Fw::Buffer& data,
381  const ComCfg::FrameContext& context
382  ) = 0;
383 
385  virtual void timeout_handler(
386  FwIndexType portNum,
387  U32 context
388  ) = 0;
389 
390  protected:
391 
392  // ----------------------------------------------------------------------
393  // Port handler base-class functions for typed input ports
394  //
395  // Call these functions directly to bypass the corresponding ports
396  // ----------------------------------------------------------------------
397 
400  FwIndexType portNum,
401  Fw::Success& condition
402  );
403 
405  void dataIn_handlerBase(
406  FwIndexType portNum,
407  Fw::Buffer& data,
408  const ComCfg::FrameContext& context
409  );
410 
413  FwIndexType portNum,
414  Fw::Buffer& data,
415  const ComCfg::FrameContext& context
416  );
417 
419  void timeout_handlerBase(
420  FwIndexType portNum,
421  U32 context
422  );
423 
424  protected:
425 
426  // ----------------------------------------------------------------------
427  // Invocation functions for typed output ports
428  // ----------------------------------------------------------------------
429 
431  void comStatusOut_out(
432  FwIndexType portNum,
433  Fw::Success& condition
434  );
435 
437  void dataOut_out(
438  FwIndexType portNum,
439  Fw::Buffer& data,
440  const ComCfg::FrameContext& context
441  );
442 
444  void dataReturnOut_out(
445  FwIndexType portNum,
446  Fw::Buffer& data,
447  const ComCfg::FrameContext& context
448  );
449 
450  protected:
451 
452  // ----------------------------------------------------------------------
453  // State getter functions
454  // ----------------------------------------------------------------------
455 
458 
459  protected:
460 
461  // ----------------------------------------------------------------------
462  // Signal send functions
463  // ----------------------------------------------------------------------
464 
467 
470  const Svc::ComDataContextPair& value
471  );
472 
475  const Fw::Success& value
476  );
477 
478  protected:
479 
480  // ----------------------------------------------------------------------
481  // Functions to implement for internal state machine actions
482  // ----------------------------------------------------------------------
483 
488  SmId smId,
490  ) = 0;
491 
496  SmId smId,
498  const Svc::ComDataContextPair& value
499  ) = 0;
500 
505  SmId smId,
507  ) = 0;
508 
513  SmId smId,
515  const Svc::ComDataContextPair& value
516  ) = 0;
517 
522  SmId smId,
524  ) = 0;
525 
526  protected:
527 
528  // ----------------------------------------------------------------------
529  // Functions to implement for internal state machine guards
530  // ----------------------------------------------------------------------
531 
536  SmId smId,
538  const Svc::ComDataContextPair& value
539  ) const = 0;
540 
545  SmId smId,
547  ) const = 0;
548 
553  SmId smId,
555  const Fw::Success& value
556  ) const = 0;
557 
558  private:
559 
560  // ----------------------------------------------------------------------
561  // Message dispatch functions
562  // ----------------------------------------------------------------------
563 
565  virtual MsgDispatchStatus doDispatch();
566 
567  private:
568 
569  // ----------------------------------------------------------------------
570  // Calls for messages received on typed input ports
571  // ----------------------------------------------------------------------
572 
574  static void m_p_comStatusIn_in(
575  Fw::PassiveComponentBase* callComp,
576  FwIndexType portNum,
577  Fw::Success& condition
578  );
579 
581  static void m_p_dataIn_in(
582  Fw::PassiveComponentBase* callComp,
583  FwIndexType portNum,
584  Fw::Buffer& data,
585  const ComCfg::FrameContext& context
586  );
587 
589  static void m_p_dataReturnIn_in(
590  Fw::PassiveComponentBase* callComp,
591  FwIndexType portNum,
592  Fw::Buffer& data,
593  const ComCfg::FrameContext& context
594  );
595 
597  static void m_p_timeout_in(
598  Fw::PassiveComponentBase* callComp,
599  FwIndexType portNum,
600  U32 context
601  );
602 
603  private:
604 
605  // ----------------------------------------------------------------------
606  // Send signal helper functions
607  // ----------------------------------------------------------------------
608 
610  void sendSignalStart(
611  SmId smId,
612  FwEnumStoreType signal,
613  Fw::SerialBufferBase& buffer
614  );
615 
617  void aggregationMachine_sendSignalFinish(
618  Fw::LinearBufferBase& buffer
619  );
620 
621  private:
622 
623  // ----------------------------------------------------------------------
624  // Helper functions for state machine dispatch
625  // ----------------------------------------------------------------------
626 
628  void smDispatch(
629  Fw::SerialBufferBase& buffer
630  );
631 
633  static void deserializeSmIdAndSignal(
634  Fw::SerialBufferBase& buffer,
635  FwEnumStoreType& smId,
636  FwEnumStoreType& signal
637  );
638 
640  void Svc_AggregationMachine_smDispatch(
641  Fw::SerialBufferBase& buffer,
642  Svc_AggregationMachine& sm,
644  );
645 
646  private:
647 
648  // ----------------------------------------------------------------------
649  // Typed input ports
650  // ----------------------------------------------------------------------
651 
654 
657 
660 
662  Svc::InputSchedPort m_timeout_InputPort[NUM_TIMEOUT_INPUT_PORTS];
663 
664  private:
665 
666  // ----------------------------------------------------------------------
667  // Typed output ports
668  // ----------------------------------------------------------------------
669 
672 
675 
678 
679  private:
680 
681  // ----------------------------------------------------------------------
682  // State machine instances
683  // ----------------------------------------------------------------------
684 
686  Svc_AggregationMachine m_stateMachine_aggregationMachine;
687 
688  };
689 
690 }
691 
692 #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)
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.