F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FprimeFramerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FprimeFramerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FprimeFramer component base class
5 // ======================================================================
6 
7 #ifndef Svc_FprimeFramerComponentAc_HPP
8 #define Svc_FprimeFramerComponentAc_HPP
9 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #if !FW_DIRECT_PORT_CALLS
16 #endif
17 #if !FW_DIRECT_PORT_CALLS
19 #endif
21 #include "Fw/Time/TimePortAc.hpp"
23 
24 namespace Svc {
25 
32  {
33 
34  // ----------------------------------------------------------------------
35  // Friend classes
36  // ----------------------------------------------------------------------
37 
39  friend class FprimeFramerTesterBase;
41  friend class FprimeFramerTester;
42 
43  protected:
44 
45  // ----------------------------------------------------------------------
46  // Constants
47  // ----------------------------------------------------------------------
48 
50  enum {
54  };
55 
57  enum {
59  };
60 
62  enum {
68  };
69 
70  public:
71 
72  // ----------------------------------------------------------------------
73  // Component initialization
74  // ----------------------------------------------------------------------
75 
77  void init(
78  FwEnumStoreType instance = 0
79  );
80 
81 #if !FW_DIRECT_PORT_CALLS
82 
83  public:
84 
85  // ----------------------------------------------------------------------
86  // Getters for typed input ports
87  // ----------------------------------------------------------------------
88 
93  FwIndexType portNum
94  );
95 
100  FwIndexType portNum
101  );
102 
107  FwIndexType portNum
108  );
109 
110 #endif
111 
112 #if !FW_DIRECT_PORT_CALLS
113 
114  public:
115 
116  // ----------------------------------------------------------------------
117  // Connect input ports to special output ports
118  // ----------------------------------------------------------------------
119 
122  FwIndexType portNum,
123  Fw::InputTimePort* port
124  );
125 
126 #endif
127 
128 #if !FW_DIRECT_PORT_CALLS
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Connect typed input ports to typed output ports
134  // ----------------------------------------------------------------------
135 
138  FwIndexType portNum,
140  );
141 
144  FwIndexType portNum,
146  );
147 
150  FwIndexType portNum,
152  );
153 
156  FwIndexType portNum,
158  );
159 
162  FwIndexType portNum,
164  );
165 
166 #endif
167 
168 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
169 
170  public:
171 
172  // ----------------------------------------------------------------------
173  // Connect serial input ports to special output ports
174  // ----------------------------------------------------------------------
175 
178  FwIndexType portNum,
179  Fw::InputSerializePort* port
180  );
181 
182 #endif
183 
184 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
185 
186  public:
187 
188  // ----------------------------------------------------------------------
189  // Connect serial input ports to typed output ports
190  // ----------------------------------------------------------------------
191 
194  FwIndexType portNum,
195  Fw::InputSerializePort* port
196  );
197 
200  FwIndexType portNum,
201  Fw::InputSerializePort* port
202  );
203 
206  FwIndexType portNum,
207  Fw::InputSerializePort* port
208  );
209 
212  FwIndexType portNum,
213  Fw::InputSerializePort* port
214  );
215 
216 #endif
217 
218  protected:
219 
220  // ----------------------------------------------------------------------
221  // Component construction and destruction
222  // ----------------------------------------------------------------------
223 
226  const char* compName = ""
227  );
228 
230  virtual ~FprimeFramerComponentBase();
231 
232  protected:
233 
234  // ----------------------------------------------------------------------
235  // Getters for numbers of typed input ports
236  // ----------------------------------------------------------------------
237 
243  }
244 
249  return NUM_DATAIN_INPUT_PORTS;
250  }
251 
257  }
258 
259  protected:
260 
261  // ----------------------------------------------------------------------
262  // Getters for numbers of special output ports
263  // ----------------------------------------------------------------------
264 
270  }
271 
272  protected:
273 
274  // ----------------------------------------------------------------------
275  // Getters for numbers of typed output ports
276  // ----------------------------------------------------------------------
277 
283  }
284 
290  }
291 
297  }
298 
304  }
305 
311  }
312 
313  protected:
314 
315  // ----------------------------------------------------------------------
316  // Connection status queries for special output ports
317  // ----------------------------------------------------------------------
318 
323  FwIndexType portNum
324  ) const;
325 
326  protected:
327 
328  // ----------------------------------------------------------------------
329  // Connection status queries for typed output ports
330  // ----------------------------------------------------------------------
331 
336  FwIndexType portNum
337  ) const;
338 
343  FwIndexType portNum
344  ) const;
345 
350  FwIndexType portNum
351  ) const;
352 
357  FwIndexType portNum
358  ) const;
359 
364  FwIndexType portNum
365  ) const;
366 
367  protected:
368 
369  // ----------------------------------------------------------------------
370  // Handlers to implement for typed input ports
371  // ----------------------------------------------------------------------
372 
374  virtual void comStatusIn_handler(
375  FwIndexType portNum,
376  Fw::Success& condition
377  ) = 0;
378 
380  virtual void dataIn_handler(
381  FwIndexType portNum,
382  Fw::Buffer& data,
383  const ComCfg::FrameContext& context
384  ) = 0;
385 
387  virtual void dataReturnIn_handler(
388  FwIndexType portNum,
389  Fw::Buffer& data,
390  const ComCfg::FrameContext& context
391  ) = 0;
392 
393 #if FW_DIRECT_PORT_CALLS
394  public:
395 #else
396  protected:
397 #endif
398 
399  // ----------------------------------------------------------------------
400  // Port handler base-class functions for typed input ports
401  //
402  // Call these functions directly to bypass the corresponding ports
403  // ----------------------------------------------------------------------
404 
407  FwIndexType portNum,
408  Fw::Success& condition
409  );
410 
412  void dataIn_handlerBase(
413  FwIndexType portNum,
414  Fw::Buffer& data,
415  const ComCfg::FrameContext& context
416  );
417 
420  FwIndexType portNum,
421  Fw::Buffer& data,
422  const ComCfg::FrameContext& context
423  );
424 
425  protected:
426 
427  // ----------------------------------------------------------------------
428  // Invocation functions for typed output ports
429  // ----------------------------------------------------------------------
430 
433  FwIndexType portNum,
434  FwSizeType size
435  ) const;
436 
439  FwIndexType portNum,
440  Fw::Buffer& fwBuffer
441  ) const;
442 
444  void comStatusOut_out(
445  FwIndexType portNum,
446  Fw::Success& condition
447  ) const;
448 
450  void dataOut_out(
451  FwIndexType portNum,
452  Fw::Buffer& data,
453  const ComCfg::FrameContext& context
454  ) const;
455 
457  void dataReturnOut_out(
458  FwIndexType portNum,
459  Fw::Buffer& data,
460  const ComCfg::FrameContext& context
461  ) const;
462 
463  protected:
464 
465  // ----------------------------------------------------------------------
466  // Time
467  // ----------------------------------------------------------------------
468 
472  Fw::Time getTime() const;
473 
474  private:
475 
476  // ----------------------------------------------------------------------
477  // Calls for messages received on typed input ports
478  // ----------------------------------------------------------------------
479 
481  static void m_p_comStatusIn_in(
482  Fw::PassiveComponentBase* callComp,
483  FwIndexType portNum,
484  Fw::Success& condition
485  );
486 
488  static void m_p_dataIn_in(
489  Fw::PassiveComponentBase* callComp,
490  FwIndexType portNum,
491  Fw::Buffer& data,
492  const ComCfg::FrameContext& context
493  );
494 
496  static void m_p_dataReturnIn_in(
497  Fw::PassiveComponentBase* callComp,
498  FwIndexType portNum,
499  Fw::Buffer& data,
500  const ComCfg::FrameContext& context
501  );
502 
503  private:
504 
505  // ----------------------------------------------------------------------
506  // Invocation functions for special output ports
507  // ----------------------------------------------------------------------
508 
510  void timeCaller_out(
511  FwIndexType portNum,
512  Fw::Time& time
513  ) const;
514 
515 #if !FW_DIRECT_PORT_CALLS
516 
517  private:
518 
519  // ----------------------------------------------------------------------
520  // Typed input ports
521  // ----------------------------------------------------------------------
522 
525 
528 
531 
532 #endif
533 
534 #if !FW_DIRECT_PORT_CALLS
535 
536  private:
537 
538  // ----------------------------------------------------------------------
539  // Special output ports
540  // ----------------------------------------------------------------------
541 
543  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
544 
545 #endif
546 
547 #if !FW_DIRECT_PORT_CALLS
548 
549  private:
550 
551  // ----------------------------------------------------------------------
552  // Typed output ports
553  // ----------------------------------------------------------------------
554 
556  Fw::OutputBufferGetPort m_bufferAllocate_OutputPort[NUM_BUFFERALLOCATE_OUTPUT_PORTS];
557 
559  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
560 
563 
566 
569 
570 #endif
571 
572  };
573 
574 }
575 
576 #endif
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
PlatformSizeType FwSizeType
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
I32 FwEnumStoreType
Auto-generated base for FprimeFramer component.
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
static constexpr FwIndexType getNum_comStatusIn_InputPorts()
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
friend class FprimeFramerTester
Friend class tester implementation to support white-box testing.
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum) const
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:24
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
Fw::Buffer bufferAllocate_out(FwIndexType portNum, FwSizeType size) const
Invoke output port bufferAllocate.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
virtual ~FprimeFramerComponentBase()
Destroy FprimeFramerComponentBase object.
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition) const
Invoke output port comStatusOut.
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
bool isConnected_bufferAllocate_OutputPort(FwIndexType portNum) const
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
static constexpr FwIndexType getNum_bufferAllocate_OutputPorts()
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
friend class FprimeFramerTesterBase
Friend class tester to support autocoded test harness.
FprimeFramerComponentBase(const char *compName="")
Construct FprimeFramerComponentBase object.
PlatformIndexType FwIndexType
static constexpr FwIndexType getNum_dataOut_OutputPorts()
static constexpr FwIndexType getNum_bufferDeallocate_OutputPorts()
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port bufferDeallocate.
Success/Failure.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_dataIn_InputPorts()