F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
AosFramerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title AosFramerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for AosFramer component base class
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_AosFramerComponentAc_HPP
8 #define Svc_Ccsds_AosFramerComponentAc_HPP
9 
11 #include "Fw/FPrimeBasicTypes.hpp"
12 #include "Fw/Log/LogPortAc.hpp"
13 #if FW_ENABLE_TEXT_LOGGING == 1
14 #include "Fw/Log/LogTextPortAc.hpp"
15 #endif
16 #if !FW_DIRECT_PORT_CALLS
18 #endif
19 #if !FW_DIRECT_PORT_CALLS
21 #endif
23 #include "Fw/Prm/PrmGetPortAc.hpp"
24 #include "Fw/Prm/PrmSetPortAc.hpp"
25 #include "Fw/Time/TimePortAc.hpp"
26 #include "Fw/Tlm/TlmPortAc.hpp"
28 
29 namespace Svc {
30 
31  namespace Ccsds {
32 
39  {
40 
41  // ----------------------------------------------------------------------
42  // Friend classes
43  // ----------------------------------------------------------------------
44 
46  friend class AosFramerTesterBase;
48  friend class AosFramerTester;
49 
50  protected:
51 
52  // ----------------------------------------------------------------------
53  // Constants
54  // ----------------------------------------------------------------------
55 
57  enum {
61  };
62 
64  enum {
71  };
72 
74  enum {
78  };
79 
80  public:
81 
82  // ----------------------------------------------------------------------
83  // Component initialization
84  // ----------------------------------------------------------------------
85 
87  void init(
88  FwEnumStoreType instance = 0
89  );
90 
91 #if !FW_DIRECT_PORT_CALLS
92 
93  public:
94 
95  // ----------------------------------------------------------------------
96  // Getters for typed input ports
97  // ----------------------------------------------------------------------
98 
103  FwIndexType portNum
104  );
105 
110  FwIndexType portNum
111  );
112 
117  FwIndexType portNum
118  );
119 
120 #endif
121 
122 #if !FW_DIRECT_PORT_CALLS
123 
124  public:
125 
126  // ----------------------------------------------------------------------
127  // Connect input ports to special output ports
128  // ----------------------------------------------------------------------
129 
132  FwIndexType portNum,
133  Fw::InputLogPort* port
134  );
135 
136 #if FW_ENABLE_TEXT_LOGGING == 1
137 
139  void set_logTextOut_OutputPort(
140  FwIndexType portNum,
141  Fw::InputLogTextPort* port
142  );
143 
144 #endif
145 
148  FwIndexType portNum,
149  Fw::InputPrmGetPort* port
150  );
151 
154  FwIndexType portNum,
155  Fw::InputPrmSetPort* port
156  );
157 
160  FwIndexType portNum,
161  Fw::InputTimePort* port
162  );
163 
166  FwIndexType portNum,
167  Fw::InputTlmPort* port
168  );
169 
170 #endif
171 
172 #if !FW_DIRECT_PORT_CALLS
173 
174  public:
175 
176  // ----------------------------------------------------------------------
177  // Connect typed input ports to typed output ports
178  // ----------------------------------------------------------------------
179 
182  FwIndexType portNum,
184  );
185 
188  FwIndexType portNum,
190  );
191 
194  FwIndexType portNum,
196  );
197 
198 #endif
199 
200 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
201 
202  public:
203 
204  // ----------------------------------------------------------------------
205  // Connect serial input ports to special output ports
206  // ----------------------------------------------------------------------
207 
210  FwIndexType portNum,
211  Fw::InputSerializePort* port
212  );
213 
214 #if FW_ENABLE_TEXT_LOGGING == 1
215 
217  void set_logTextOut_OutputPort(
218  FwIndexType portNum,
219  Fw::InputSerializePort* port
220  );
221 
222 #endif
223 
226  FwIndexType portNum,
227  Fw::InputSerializePort* port
228  );
229 
232  FwIndexType portNum,
233  Fw::InputSerializePort* port
234  );
235 
238  FwIndexType portNum,
239  Fw::InputSerializePort* port
240  );
241 
242 #endif
243 
244 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
245 
246  public:
247 
248  // ----------------------------------------------------------------------
249  // Connect serial input ports to typed output ports
250  // ----------------------------------------------------------------------
251 
254  FwIndexType portNum,
255  Fw::InputSerializePort* port
256  );
257 
260  FwIndexType portNum,
261  Fw::InputSerializePort* port
262  );
263 
266  FwIndexType portNum,
267  Fw::InputSerializePort* port
268  );
269 
270 #endif
271 
272  protected:
273 
274  // ----------------------------------------------------------------------
275  // Component construction and destruction
276  // ----------------------------------------------------------------------
277 
280  const char* compName = ""
281  );
282 
284  virtual ~AosFramerComponentBase();
285 
286  protected:
287 
288  // ----------------------------------------------------------------------
289  // Getters for numbers of typed input ports
290  // ----------------------------------------------------------------------
291 
297  }
298 
303  return NUM_DATAIN_INPUT_PORTS;
304  }
305 
311  }
312 
313  protected:
314 
315  // ----------------------------------------------------------------------
316  // Getters for numbers of special output ports
317  // ----------------------------------------------------------------------
318 
324  }
325 
326 #if FW_ENABLE_TEXT_LOGGING == 1
327 
331  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
333  }
334 
335 #endif
336 
342  }
343 
349  }
350 
356  }
357 
363  }
364 
365  protected:
366 
367  // ----------------------------------------------------------------------
368  // Getters for numbers of typed output ports
369  // ----------------------------------------------------------------------
370 
376  }
377 
383  }
384 
390  }
391 
392  protected:
393 
394  // ----------------------------------------------------------------------
395  // Connection status queries for special output ports
396  // ----------------------------------------------------------------------
397 
402  FwIndexType portNum
403  ) const;
404 
405 #if FW_ENABLE_TEXT_LOGGING == 1
406 
410  bool isConnected_logTextOut_OutputPort(
411  FwIndexType portNum
412  ) const;
413 
414 #endif
415 
420  FwIndexType portNum
421  ) const;
422 
427  FwIndexType portNum
428  ) const;
429 
434  FwIndexType portNum
435  ) const;
436 
441  FwIndexType portNum
442  ) const;
443 
444  protected:
445 
446  // ----------------------------------------------------------------------
447  // Connection status queries for typed output ports
448  // ----------------------------------------------------------------------
449 
454  FwIndexType portNum
455  ) const;
456 
461  FwIndexType portNum
462  ) const;
463 
468  FwIndexType portNum
469  ) const;
470 
471  protected:
472 
473  // ----------------------------------------------------------------------
474  // Handlers to implement for typed input ports
475  // ----------------------------------------------------------------------
476 
478  virtual void comStatusIn_handler(
479  FwIndexType portNum,
480  Fw::Success& condition
481  ) = 0;
482 
484  virtual void dataIn_handler(
485  FwIndexType portNum,
486  Fw::Buffer& data,
487  const ComCfg::FrameContext& context
488  ) = 0;
489 
491  virtual void dataReturnIn_handler(
492  FwIndexType portNum,
493  Fw::Buffer& data,
494  const ComCfg::FrameContext& context
495  ) = 0;
496 
497 #if FW_DIRECT_PORT_CALLS
498  public:
499 #else
500  protected:
501 #endif
502 
503  // ----------------------------------------------------------------------
504  // Port handler base-class functions for typed input ports
505  //
506  // Call these functions directly to bypass the corresponding ports
507  // ----------------------------------------------------------------------
508 
511  FwIndexType portNum,
512  Fw::Success& condition
513  );
514 
516  void dataIn_handlerBase(
517  FwIndexType portNum,
518  Fw::Buffer& data,
519  const ComCfg::FrameContext& context
520  );
521 
524  FwIndexType portNum,
525  Fw::Buffer& data,
526  const ComCfg::FrameContext& context
527  );
528 
529  protected:
530 
531  // ----------------------------------------------------------------------
532  // Invocation functions for typed output ports
533  // ----------------------------------------------------------------------
534 
536  void comStatusOut_out(
537  FwIndexType portNum,
538  Fw::Success& condition
539  ) const;
540 
542  void dataOut_out(
543  FwIndexType portNum,
544  Fw::Buffer& data,
545  const ComCfg::FrameContext& context
546  ) const;
547 
549  void dataReturnOut_out(
550  FwIndexType portNum,
551  Fw::Buffer& data,
552  const ComCfg::FrameContext& context
553  ) const;
554 
555  protected:
556 
557  // ----------------------------------------------------------------------
558  // Time
559  // ----------------------------------------------------------------------
560 
564  Fw::Time getTime() const;
565 
566  private:
567 
568  // ----------------------------------------------------------------------
569  // Calls for messages received on typed input ports
570  // ----------------------------------------------------------------------
571 
573  static void m_p_comStatusIn_in(
574  Fw::PassiveComponentBase* callComp,
575  FwIndexType portNum,
576  Fw::Success& condition
577  );
578 
580  static void m_p_dataIn_in(
581  Fw::PassiveComponentBase* callComp,
582  FwIndexType portNum,
583  Fw::Buffer& data,
584  const ComCfg::FrameContext& context
585  );
586 
588  static void m_p_dataReturnIn_in(
589  Fw::PassiveComponentBase* callComp,
590  FwIndexType portNum,
591  Fw::Buffer& data,
592  const ComCfg::FrameContext& context
593  );
594 
595  private:
596 
597  // ----------------------------------------------------------------------
598  // Invocation functions for special output ports
599  // ----------------------------------------------------------------------
600 
602  void timeCaller_out(
603  FwIndexType portNum,
604  Fw::Time& time
605  ) const;
606 
607 #if !FW_DIRECT_PORT_CALLS
608 
609  private:
610 
611  // ----------------------------------------------------------------------
612  // Typed input ports
613  // ----------------------------------------------------------------------
614 
617 
620 
623 
624 #endif
625 
626 #if !FW_DIRECT_PORT_CALLS
627 
628  private:
629 
630  // ----------------------------------------------------------------------
631  // Special output ports
632  // ----------------------------------------------------------------------
633 
635  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
636 
637 #if FW_ENABLE_TEXT_LOGGING == 1
638 
640  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
641 
642 #endif
643 
645  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
646 
648  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
649 
651  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
652 
654  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
655 
656 #endif
657 
658 #if !FW_DIRECT_PORT_CALLS
659 
660  private:
661 
662  // ----------------------------------------------------------------------
663  // Typed output ports
664  // ----------------------------------------------------------------------
665 
668 
671 
674 
675 #endif
676 
677  };
678 
679  }
680 
681 }
682 
683 #endif
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
static constexpr FwIndexType getNum_prmGetOut_OutputPorts()
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
I32 FwEnumStoreType
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
static constexpr FwIndexType getNum_comStatusIn_InputPorts()
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
friend class AosFramerTesterBase
Friend class tester to support autocoded test harness.
Auto-generated base for AosFramer component.
virtual ~AosFramerComponentBase()
Destroy AosFramerComponentBase object.
static constexpr FwIndexType getNum_logOut_OutputPorts()
bool isConnected_prmSetOut_OutputPort(FwIndexType portNum) const
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition) const
Invoke output port comStatusOut.
void init()
Object initializer.
Definition: ObjBase.cpp:24
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
static constexpr FwIndexType getNum_prmSetOut_OutputPorts()
bool isConnected_tlmOut_OutputPort(FwIndexType portNum) const
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
bool isConnected_prmGetOut_OutputPort(FwIndexType portNum) const
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_dataOut_OutputPorts()
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_dataIn_InputPorts()
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
PlatformIndexType FwIndexType
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
AosFramerComponentBase(const char *compName="")
Construct AosFramerComponentBase object.
friend class AosFramerTester
Friend class tester implementation to support white-box testing.
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
Success/Failure.