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 #include "Fw/Log/LogTextPortAc.hpp"
14 #if !FW_DIRECT_PORT_CALLS
16 #endif
17 #if !FW_DIRECT_PORT_CALLS
19 #endif
21 #include "Fw/Prm/PrmGetPortAc.hpp"
22 #include "Fw/Prm/PrmSetPortAc.hpp"
23 #include "Fw/Time/TimePortAc.hpp"
24 #include "Fw/Tlm/TlmPortAc.hpp"
26 
27 namespace Svc {
28 
29  namespace Ccsds {
30 
37  {
38 
39  // ----------------------------------------------------------------------
40  // Friend classes
41  // ----------------------------------------------------------------------
42 
44  friend class AosFramerTesterBase;
46  friend class AosFramerTester;
47 
48  protected:
49 
50  // ----------------------------------------------------------------------
51  // Constants
52  // ----------------------------------------------------------------------
53 
55  enum {
59  };
60 
62  enum {
69  };
70 
72  enum {
76  };
77 
78  public:
79 
80  // ----------------------------------------------------------------------
81  // Component initialization
82  // ----------------------------------------------------------------------
83 
85  void init(
86  FwEnumStoreType instance = 0
87  );
88 
89 #if !FW_DIRECT_PORT_CALLS
90 
91  public:
92 
93  // ----------------------------------------------------------------------
94  // Getters for typed input ports
95  // ----------------------------------------------------------------------
96 
101  FwIndexType portNum
102  );
103 
108  FwIndexType portNum
109  );
110 
115  FwIndexType portNum
116  );
117 
118 #endif
119 
120 #if !FW_DIRECT_PORT_CALLS
121 
122  public:
123 
124  // ----------------------------------------------------------------------
125  // Connect input ports to special output ports
126  // ----------------------------------------------------------------------
127 
130  FwIndexType portNum,
131  Fw::InputLogPort* port
132  );
133 
134 #if FW_ENABLE_TEXT_LOGGING == 1
135 
137  void set_logTextOut_OutputPort(
138  FwIndexType portNum,
139  Fw::InputLogTextPort* port
140  );
141 
142 #endif
143 
146  FwIndexType portNum,
147  Fw::InputPrmGetPort* port
148  );
149 
152  FwIndexType portNum,
153  Fw::InputPrmSetPort* port
154  );
155 
158  FwIndexType portNum,
159  Fw::InputTimePort* port
160  );
161 
164  FwIndexType portNum,
165  Fw::InputTlmPort* port
166  );
167 
168 #endif
169 
170 #if !FW_DIRECT_PORT_CALLS
171 
172  public:
173 
174  // ----------------------------------------------------------------------
175  // Connect typed input ports to typed output ports
176  // ----------------------------------------------------------------------
177 
180  FwIndexType portNum,
182  );
183 
186  FwIndexType portNum,
188  );
189 
192  FwIndexType portNum,
194  );
195 
196 #endif
197 
198 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
199 
200  public:
201 
202  // ----------------------------------------------------------------------
203  // Connect serial input ports to special output ports
204  // ----------------------------------------------------------------------
205 
208  FwIndexType portNum,
209  Fw::InputSerializePort* port
210  );
211 
212 #if FW_ENABLE_TEXT_LOGGING == 1
213 
215  void set_logTextOut_OutputPort(
216  FwIndexType portNum,
217  Fw::InputSerializePort* port
218  );
219 
220 #endif
221 
224  FwIndexType portNum,
225  Fw::InputSerializePort* port
226  );
227 
230  FwIndexType portNum,
231  Fw::InputSerializePort* port
232  );
233 
236  FwIndexType portNum,
237  Fw::InputSerializePort* port
238  );
239 
240 #endif
241 
242 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
243 
244  public:
245 
246  // ----------------------------------------------------------------------
247  // Connect serial input ports to typed output ports
248  // ----------------------------------------------------------------------
249 
252  FwIndexType portNum,
253  Fw::InputSerializePort* port
254  );
255 
258  FwIndexType portNum,
259  Fw::InputSerializePort* port
260  );
261 
264  FwIndexType portNum,
265  Fw::InputSerializePort* port
266  );
267 
268 #endif
269 
270  protected:
271 
272  // ----------------------------------------------------------------------
273  // Component construction and destruction
274  // ----------------------------------------------------------------------
275 
278  const char* compName = ""
279  );
280 
282  virtual ~AosFramerComponentBase();
283 
284  protected:
285 
286  // ----------------------------------------------------------------------
287  // Getters for numbers of typed input ports
288  // ----------------------------------------------------------------------
289 
295  }
296 
301  return NUM_DATAIN_INPUT_PORTS;
302  }
303 
309  }
310 
311  protected:
312 
313  // ----------------------------------------------------------------------
314  // Getters for numbers of special output ports
315  // ----------------------------------------------------------------------
316 
322  }
323 
324 #if FW_ENABLE_TEXT_LOGGING == 1
325 
329  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
331  }
332 
333 #endif
334 
340  }
341 
347  }
348 
354  }
355 
361  }
362 
363  protected:
364 
365  // ----------------------------------------------------------------------
366  // Getters for numbers of typed output ports
367  // ----------------------------------------------------------------------
368 
374  }
375 
381  }
382 
388  }
389 
390  protected:
391 
392  // ----------------------------------------------------------------------
393  // Connection status queries for special output ports
394  // ----------------------------------------------------------------------
395 
400  FwIndexType portNum
401  ) const;
402 
403 #if FW_ENABLE_TEXT_LOGGING == 1
404 
408  bool isConnected_logTextOut_OutputPort(
409  FwIndexType portNum
410  ) const;
411 
412 #endif
413 
418  FwIndexType portNum
419  ) const;
420 
425  FwIndexType portNum
426  ) const;
427 
432  FwIndexType portNum
433  ) const;
434 
439  FwIndexType portNum
440  ) const;
441 
442  protected:
443 
444  // ----------------------------------------------------------------------
445  // Connection status queries for typed output ports
446  // ----------------------------------------------------------------------
447 
452  FwIndexType portNum
453  ) const;
454 
459  FwIndexType portNum
460  ) const;
461 
466  FwIndexType portNum
467  ) const;
468 
469  protected:
470 
471  // ----------------------------------------------------------------------
472  // Handlers to implement for typed input ports
473  // ----------------------------------------------------------------------
474 
476  virtual void comStatusIn_handler(
477  FwIndexType portNum,
478  Fw::Success& condition
479  ) = 0;
480 
482  virtual void dataIn_handler(
483  FwIndexType portNum,
484  Fw::Buffer& data,
485  const ComCfg::FrameContext& context
486  ) = 0;
487 
489  virtual void dataReturnIn_handler(
490  FwIndexType portNum,
491  Fw::Buffer& data,
492  const ComCfg::FrameContext& context
493  ) = 0;
494 
495 #if FW_DIRECT_PORT_CALLS
496  public:
497 #else
498  protected:
499 #endif
500 
501  // ----------------------------------------------------------------------
502  // Port handler base-class functions for typed input ports
503  //
504  // Call these functions directly to bypass the corresponding ports
505  // ----------------------------------------------------------------------
506 
509  FwIndexType portNum,
510  Fw::Success& condition
511  );
512 
514  void dataIn_handlerBase(
515  FwIndexType portNum,
516  Fw::Buffer& data,
517  const ComCfg::FrameContext& context
518  );
519 
522  FwIndexType portNum,
523  Fw::Buffer& data,
524  const ComCfg::FrameContext& context
525  );
526 
527  protected:
528 
529  // ----------------------------------------------------------------------
530  // Invocation functions for typed output ports
531  // ----------------------------------------------------------------------
532 
534  void comStatusOut_out(
535  FwIndexType portNum,
536  Fw::Success& condition
537  ) const;
538 
540  void dataOut_out(
541  FwIndexType portNum,
542  Fw::Buffer& data,
543  const ComCfg::FrameContext& context
544  ) const;
545 
547  void dataReturnOut_out(
548  FwIndexType portNum,
549  Fw::Buffer& data,
550  const ComCfg::FrameContext& context
551  ) const;
552 
553  protected:
554 
555  // ----------------------------------------------------------------------
556  // Time
557  // ----------------------------------------------------------------------
558 
562  Fw::Time getTime() const;
563 
564  private:
565 
566  // ----------------------------------------------------------------------
567  // Calls for messages received on typed input ports
568  // ----------------------------------------------------------------------
569 
571  static void m_p_comStatusIn_in(
572  Fw::PassiveComponentBase* callComp,
573  FwIndexType portNum,
574  Fw::Success& condition
575  );
576 
578  static void m_p_dataIn_in(
579  Fw::PassiveComponentBase* callComp,
580  FwIndexType portNum,
581  Fw::Buffer& data,
582  const ComCfg::FrameContext& context
583  );
584 
586  static void m_p_dataReturnIn_in(
587  Fw::PassiveComponentBase* callComp,
588  FwIndexType portNum,
589  Fw::Buffer& data,
590  const ComCfg::FrameContext& context
591  );
592 
593  private:
594 
595  // ----------------------------------------------------------------------
596  // Invocation functions for special output ports
597  // ----------------------------------------------------------------------
598 
600  void timeCaller_out(
601  FwIndexType portNum,
602  Fw::Time& time
603  ) const;
604 
605 #if !FW_DIRECT_PORT_CALLS
606 
607  private:
608 
609  // ----------------------------------------------------------------------
610  // Typed input ports
611  // ----------------------------------------------------------------------
612 
615 
618 
621 
622 #endif
623 
624 #if !FW_DIRECT_PORT_CALLS
625 
626  private:
627 
628  // ----------------------------------------------------------------------
629  // Special output ports
630  // ----------------------------------------------------------------------
631 
633  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
634 
635 #if FW_ENABLE_TEXT_LOGGING == 1
636 
638  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
639 
640 #endif
641 
643  Fw::OutputPrmGetPort m_prmGetOut_OutputPort[NUM_PRMGETOUT_OUTPUT_PORTS];
644 
646  Fw::OutputPrmSetPort m_prmSetOut_OutputPort[NUM_PRMSETOUT_OUTPUT_PORTS];
647 
649  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
650 
652  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
653 
654 #endif
655 
656 #if !FW_DIRECT_PORT_CALLS
657 
658  private:
659 
660  // ----------------------------------------------------------------------
661  // Typed output ports
662  // ----------------------------------------------------------------------
663 
666 
669 
672 
673 #endif
674 
675  };
676 
677  }
678 
679 }
680 
681 #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.