F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TmFramerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title TmFramerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for TmFramer component base class
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_TmFramerComponentAc_HPP
8 #define Svc_Ccsds_TmFramerComponentAc_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
19 #include "Fw/Prm/PrmGetPortAc.hpp"
20 #include "Fw/Prm/PrmSetPortAc.hpp"
21 #include "Fw/Time/TimePortAc.hpp"
22 #include "Fw/Tlm/TlmPortAc.hpp"
24 
25 namespace Svc {
26 
27  namespace Ccsds {
28 
35  {
36 
37  // ----------------------------------------------------------------------
38  // Friend classes
39  // ----------------------------------------------------------------------
40 
42  friend class TmFramerTesterBase;
44  friend class TmFramerTester;
45 
46  protected:
47 
48  // ----------------------------------------------------------------------
49  // Constants
50  // ----------------------------------------------------------------------
51 
53  enum {
57  };
58 
60  enum {
67  };
68 
70  enum {
74  };
75 
76  public:
77 
78  // ----------------------------------------------------------------------
79  // Component initialization
80  // ----------------------------------------------------------------------
81 
83  void init(
84  FwEnumStoreType instance = 0
85  );
86 
87  public:
88 
89  // ----------------------------------------------------------------------
90  // Getters for typed input ports
91  // ----------------------------------------------------------------------
92 
97  FwIndexType portNum
98  );
99 
104  FwIndexType portNum
105  );
106 
111  FwIndexType portNum
112  );
113 
114  public:
115 
116  // ----------------------------------------------------------------------
117  // Connect input ports to special output ports
118  // ----------------------------------------------------------------------
119 
122  FwIndexType portNum,
123  Fw::InputLogPort* port
124  );
125 
126 #if FW_ENABLE_TEXT_LOGGING == 1
127 
129  void set_logTextOut_OutputPort(
130  FwIndexType portNum,
131  Fw::InputLogTextPort* port
132  );
133 
134 #endif
135 
138  FwIndexType portNum,
139  Fw::InputPrmGetPort* port
140  );
141 
144  FwIndexType portNum,
145  Fw::InputPrmSetPort* port
146  );
147 
150  FwIndexType portNum,
151  Fw::InputTimePort* port
152  );
153 
156  FwIndexType portNum,
157  Fw::InputTlmPort* port
158  );
159 
160  public:
161 
162  // ----------------------------------------------------------------------
163  // Connect typed input ports to typed output ports
164  // ----------------------------------------------------------------------
165 
168  FwIndexType portNum,
170  );
171 
174  FwIndexType portNum,
176  );
177 
180  FwIndexType portNum,
182  );
183 
184 #if FW_PORT_SERIALIZATION
185 
186  public:
187 
188  // ----------------------------------------------------------------------
189  // Connect serial input ports to special output ports
190  // ----------------------------------------------------------------------
191 
194  FwIndexType portNum,
195  Fw::InputSerializePort* port
196  );
197 
198 #if FW_ENABLE_TEXT_LOGGING == 1
199 
201  void set_logTextOut_OutputPort(
202  FwIndexType portNum,
203  Fw::InputSerializePort* port
204  );
205 
206 #endif
207 
210  FwIndexType portNum,
211  Fw::InputSerializePort* port
212  );
213 
216  FwIndexType portNum,
217  Fw::InputSerializePort* port
218  );
219 
222  FwIndexType portNum,
223  Fw::InputSerializePort* port
224  );
225 
226 #endif
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 ~TmFramerComponentBase();
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 
297  protected:
298 
299  // ----------------------------------------------------------------------
300  // Getters for numbers of special output ports
301  // ----------------------------------------------------------------------
302 
308  }
309 
310 #if FW_ENABLE_TEXT_LOGGING == 1
311 
315  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
317  }
318 
319 #endif
320 
326  }
327 
333  }
334 
340  }
341 
347  }
348 
349  protected:
350 
351  // ----------------------------------------------------------------------
352  // Getters for numbers of typed output ports
353  // ----------------------------------------------------------------------
354 
360  }
361 
367  }
368 
374  }
375 
376  protected:
377 
378  // ----------------------------------------------------------------------
379  // Connection status queries for special output ports
380  // ----------------------------------------------------------------------
381 
386  FwIndexType portNum
387  );
388 
389 #if FW_ENABLE_TEXT_LOGGING == 1
390 
394  bool isConnected_logTextOut_OutputPort(
395  FwIndexType portNum
396  );
397 
398 #endif
399 
404  FwIndexType portNum
405  );
406 
411  FwIndexType portNum
412  );
413 
418  FwIndexType portNum
419  );
420 
425  FwIndexType portNum
426  );
427 
428  protected:
429 
430  // ----------------------------------------------------------------------
431  // Connection status queries for typed output ports
432  // ----------------------------------------------------------------------
433 
438  FwIndexType portNum
439  );
440 
445  FwIndexType portNum
446  );
447 
452  FwIndexType portNum
453  );
454 
455  protected:
456 
457  // ----------------------------------------------------------------------
458  // Handlers to implement for typed input ports
459  // ----------------------------------------------------------------------
460 
462  virtual void comStatusIn_handler(
463  FwIndexType portNum,
464  Fw::Success& condition
465  ) = 0;
466 
468  virtual void dataIn_handler(
469  FwIndexType portNum,
470  Fw::Buffer& data,
471  const ComCfg::FrameContext& context
472  ) = 0;
473 
475  virtual void dataReturnIn_handler(
476  FwIndexType portNum,
477  Fw::Buffer& data,
478  const ComCfg::FrameContext& context
479  ) = 0;
480 
481  protected:
482 
483  // ----------------------------------------------------------------------
484  // Port handler base-class functions for typed input ports
485  //
486  // Call these functions directly to bypass the corresponding ports
487  // ----------------------------------------------------------------------
488 
491  FwIndexType portNum,
492  Fw::Success& condition
493  );
494 
496  void dataIn_handlerBase(
497  FwIndexType portNum,
498  Fw::Buffer& data,
499  const ComCfg::FrameContext& context
500  );
501 
504  FwIndexType portNum,
505  Fw::Buffer& data,
506  const ComCfg::FrameContext& context
507  );
508 
509  protected:
510 
511  // ----------------------------------------------------------------------
512  // Invocation functions for typed output ports
513  // ----------------------------------------------------------------------
514 
516  void comStatusOut_out(
517  FwIndexType portNum,
518  Fw::Success& condition
519  );
520 
522  void dataOut_out(
523  FwIndexType portNum,
524  Fw::Buffer& data,
525  const ComCfg::FrameContext& context
526  );
527 
529  void dataReturnOut_out(
530  FwIndexType portNum,
531  Fw::Buffer& data,
532  const ComCfg::FrameContext& context
533  );
534 
535  protected:
536 
537  // ----------------------------------------------------------------------
538  // Time
539  // ----------------------------------------------------------------------
540 
544  Fw::Time getTime() const;
545 
546  private:
547 
548  // ----------------------------------------------------------------------
549  // Calls for messages received on typed input ports
550  // ----------------------------------------------------------------------
551 
553  static void m_p_comStatusIn_in(
554  Fw::PassiveComponentBase* callComp,
555  FwIndexType portNum,
556  Fw::Success& condition
557  );
558 
560  static void m_p_dataIn_in(
561  Fw::PassiveComponentBase* callComp,
562  FwIndexType portNum,
563  Fw::Buffer& data,
564  const ComCfg::FrameContext& context
565  );
566 
568  static void m_p_dataReturnIn_in(
569  Fw::PassiveComponentBase* callComp,
570  FwIndexType portNum,
571  Fw::Buffer& data,
572  const ComCfg::FrameContext& context
573  );
574 
575  private:
576 
577  // ----------------------------------------------------------------------
578  // Typed input ports
579  // ----------------------------------------------------------------------
580 
583 
586 
589 
590  private:
591 
592  // ----------------------------------------------------------------------
593  // Special output ports
594  // ----------------------------------------------------------------------
595 
597  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
598 
599 #if FW_ENABLE_TEXT_LOGGING == 1
600 
602  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
603 
604 #endif
605 
607  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
608 
610  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
611 
613  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
614 
616  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
617 
618  private:
619 
620  // ----------------------------------------------------------------------
621  // Typed output ports
622  // ----------------------------------------------------------------------
623 
626 
629 
632 
633  };
634 
635  }
636 
637 }
638 
639 #endif
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
I32 FwEnumStoreType
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_dataIn_InputPorts()
bool isConnected_prmSetOut_OutputPort(FwIndexType portNum)
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
static constexpr FwIndexType getNum_prmSetOut_OutputPorts()
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
virtual ~TmFramerComponentBase()
Destroy TmFramerComponentBase object.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition)
Invoke output port comStatusOut.
friend class TmFramerTesterBase
Friend class tester to support autocoded test harness.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:24
friend class TmFramerTester
Friend class tester implementation to support white-box testing.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
bool isConnected_logOut_OutputPort(FwIndexType portNum)
TmFramerComponentBase(const char *compName="")
Construct TmFramerComponentBase object.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
static constexpr FwIndexType getNum_comStatusIn_InputPorts()
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
static constexpr FwIndexType getNum_logOut_OutputPorts()
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
static constexpr FwIndexType getNum_prmGetOut_OutputPorts()
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
Auto-generated base for TmFramer component.
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
PlatformIndexType FwIndexType
bool isConnected_prmGetOut_OutputPort(FwIndexType portNum)
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
bool isConnected_tlmOut_OutputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_dataOut_OutputPorts()
static constexpr FwIndexType getNum_tlmOut_OutputPorts()
Success/Failure.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.