F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ComStubComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title ComStubComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for ComStub component base class
5 // ======================================================================
6 
7 #ifndef Svc_ComStubComponentAc_HPP
8 #define Svc_ComStubComponentAc_HPP
9 
15 #include "Fw/FPrimeBasicTypes.hpp"
16 #if !FW_DIRECT_PORT_CALLS
18 #endif
19 #if !FW_DIRECT_PORT_CALLS
21 #endif
24 
25 namespace Svc {
26 
35  {
36 
37  // ----------------------------------------------------------------------
38  // Friend classes
39  // ----------------------------------------------------------------------
40 
42  friend class ComStubTesterBase;
44  friend class ComStubTester;
45 
46  protected:
47 
48  // ----------------------------------------------------------------------
49  // Constants
50  // ----------------------------------------------------------------------
51 
53  enum {
59  };
60 
62  enum {
69  };
70 
71  public:
72 
73  // ----------------------------------------------------------------------
74  // Component initialization
75  // ----------------------------------------------------------------------
76 
78  void init(
79  FwEnumStoreType instance = 0
80  );
81 
82 #if !FW_DIRECT_PORT_CALLS
83 
84  public:
85 
86  // ----------------------------------------------------------------------
87  // Getters for typed input ports
88  // ----------------------------------------------------------------------
89 
94  FwIndexType portNum
95  );
96 
101  FwIndexType portNum
102  );
103 
108  FwIndexType portNum
109  );
110 
115  FwIndexType portNum
116  );
117 
122  FwIndexType portNum
123  );
124 
125 #endif
126 
127 #if !FW_DIRECT_PORT_CALLS
128 
129  public:
130 
131  // ----------------------------------------------------------------------
132  // Connect typed input ports to typed output ports
133  // ----------------------------------------------------------------------
134 
137  FwIndexType portNum,
139  );
140 
143  FwIndexType portNum,
145  );
146 
149  FwIndexType portNum,
151  );
152 
155  FwIndexType portNum,
157  );
158 
161  FwIndexType portNum,
163  );
164 
167  FwIndexType portNum,
169  );
170 
171 #endif
172 
173 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
174 
175  public:
176 
177  // ----------------------------------------------------------------------
178  // Connect serial input ports to typed output ports
179  // ----------------------------------------------------------------------
180 
183  FwIndexType portNum,
184  Fw::InputSerializePort* port
185  );
186 
189  FwIndexType portNum,
190  Fw::InputSerializePort* port
191  );
192 
195  FwIndexType portNum,
196  Fw::InputSerializePort* port
197  );
198 
201  FwIndexType portNum,
202  Fw::InputSerializePort* port
203  );
204 
207  FwIndexType portNum,
208  Fw::InputSerializePort* port
209  );
210 
211 #endif
212 
213  protected:
214 
215  // ----------------------------------------------------------------------
216  // Component construction and destruction
217  // ----------------------------------------------------------------------
218 
221  const char* compName = ""
222  );
223 
225  virtual ~ComStubComponentBase();
226 
227  protected:
228 
229  // ----------------------------------------------------------------------
230  // Getters for numbers of typed input ports
231  // ----------------------------------------------------------------------
232 
237  return NUM_DATAIN_INPUT_PORTS;
238  }
239 
245  }
246 
252  }
253 
259  }
260 
266  }
267 
268  protected:
269 
270  // ----------------------------------------------------------------------
271  // Getters for numbers of typed output ports
272  // ----------------------------------------------------------------------
273 
279  }
280 
286  }
287 
293  }
294 
300  }
301 
307  }
308 
314  }
315 
316  protected:
317 
318  // ----------------------------------------------------------------------
319  // Connection status queries for typed output ports
320  // ----------------------------------------------------------------------
321 
326  FwIndexType portNum
327  ) const;
328 
333  FwIndexType portNum
334  ) const;
335 
340  FwIndexType portNum
341  ) const;
342 
347  FwIndexType portNum
348  ) const;
349 
354  FwIndexType portNum
355  ) const;
356 
361  FwIndexType portNum
362  ) const;
363 
364  protected:
365 
366  // ----------------------------------------------------------------------
367  // Handlers to implement for typed input ports
368  // ----------------------------------------------------------------------
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 drvAsyncSendReturnIn_handler(
386  FwIndexType portNum,
387  Fw::Buffer& buffer,
388  const Drv::ByteStreamStatus& status
389  ) = 0;
390 
392  virtual void drvConnected_handler(
393  FwIndexType portNum
394  ) = 0;
395 
397  virtual void drvReceiveIn_handler(
398  FwIndexType portNum,
399  Fw::Buffer& buffer,
400  const Drv::ByteStreamStatus& status
401  ) = 0;
402 
403 #if FW_DIRECT_PORT_CALLS
404  public:
405 #else
406  protected:
407 #endif
408 
409  // ----------------------------------------------------------------------
410  // Port handler base-class functions for typed input ports
411  //
412  // Call these functions directly to bypass the corresponding ports
413  // ----------------------------------------------------------------------
414 
416  void dataIn_handlerBase(
417  FwIndexType portNum,
418  Fw::Buffer& data,
419  const ComCfg::FrameContext& context
420  );
421 
424  FwIndexType portNum,
425  Fw::Buffer& data,
426  const ComCfg::FrameContext& context
427  );
428 
431  FwIndexType portNum,
432  Fw::Buffer& buffer,
433  const Drv::ByteStreamStatus& status
434  );
435 
438  FwIndexType portNum
439  );
440 
443  FwIndexType portNum,
444  Fw::Buffer& buffer,
445  const Drv::ByteStreamStatus& status
446  );
447 
448  protected:
449 
450  // ----------------------------------------------------------------------
451  // Invocation functions for typed output ports
452  // ----------------------------------------------------------------------
453 
455  void comStatusOut_out(
456  FwIndexType portNum,
457  Fw::Success& condition
458  ) const;
459 
461  void dataOut_out(
462  FwIndexType portNum,
463  Fw::Buffer& data,
464  const ComCfg::FrameContext& context
465  ) const;
466 
468  void dataReturnOut_out(
469  FwIndexType portNum,
470  Fw::Buffer& data,
471  const ComCfg::FrameContext& context
472  ) const;
473 
475  void drvAsyncSendOut_out(
476  FwIndexType portNum,
477  Fw::Buffer& fwBuffer
478  ) const;
479 
482  FwIndexType portNum,
483  Fw::Buffer& fwBuffer
484  ) const;
485 
488  FwIndexType portNum,
489  Fw::Buffer& sendBuffer
490  ) const;
491 
492  private:
493 
494  // ----------------------------------------------------------------------
495  // Calls for messages received on typed input ports
496  // ----------------------------------------------------------------------
497 
499  static void m_p_dataIn_in(
500  Fw::PassiveComponentBase* callComp,
501  FwIndexType portNum,
502  Fw::Buffer& data,
503  const ComCfg::FrameContext& context
504  );
505 
507  static void m_p_dataReturnIn_in(
508  Fw::PassiveComponentBase* callComp,
509  FwIndexType portNum,
510  Fw::Buffer& data,
511  const ComCfg::FrameContext& context
512  );
513 
515  static void m_p_drvAsyncSendReturnIn_in(
516  Fw::PassiveComponentBase* callComp,
517  FwIndexType portNum,
518  Fw::Buffer& buffer,
519  const Drv::ByteStreamStatus& status
520  );
521 
523  static void m_p_drvConnected_in(
524  Fw::PassiveComponentBase* callComp,
525  FwIndexType portNum
526  );
527 
529  static void m_p_drvReceiveIn_in(
530  Fw::PassiveComponentBase* callComp,
531  FwIndexType portNum,
532  Fw::Buffer& buffer,
533  const Drv::ByteStreamStatus& status
534  );
535 
536 #if !FW_DIRECT_PORT_CALLS
537 
538  private:
539 
540  // ----------------------------------------------------------------------
541  // Typed input ports
542  // ----------------------------------------------------------------------
543 
546 
549 
551  Drv::InputByteStreamDataPort m_drvAsyncSendReturnIn_InputPort[NUM_DRVASYNCSENDRETURNIN_INPUT_PORTS];
552 
555 
558 
559 #endif
560 
561 #if !FW_DIRECT_PORT_CALLS
562 
563  private:
564 
565  // ----------------------------------------------------------------------
566  // Typed output ports
567  // ----------------------------------------------------------------------
568 
571 
574 
577 
579  Fw::OutputBufferSendPort m_drvAsyncSendOut_OutputPort[NUM_DRVASYNCSENDOUT_OUTPUT_PORTS];
580 
582  Fw::OutputBufferSendPort m_drvReceiveReturnOut_OutputPort[NUM_DRVRECEIVERETURNOUT_OUTPUT_PORTS];
583 
586 
587 #endif
588 
589  };
590 
591 }
592 
593 #endif
static constexpr FwIndexType getNum_dataIn_InputPorts()
static constexpr FwIndexType getNum_drvSendOut_OutputPorts()
ComStubComponentBase(const char *compName="")
Construct ComStubComponentBase object.
static constexpr FwIndexType getNum_drvAsyncSendOut_OutputPorts()
void set_drvAsyncSendOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to drvAsyncSendOut[portNum].
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
I32 FwEnumStoreType
void drvConnected_handlerBase(FwIndexType portNum)
Handler base-class function for input port drvConnected.
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum) const
Auto-generated base for ComStub component.
virtual void drvAsyncSendReturnIn_handler(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)=0
Handler for input port drvAsyncSendReturnIn.
Drv::InputByteStreamDataPort * get_drvReceiveIn_InputPort(FwIndexType portNum)
virtual void drvConnected_handler(FwIndexType portNum)=0
Handler for input port drvConnected.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
virtual ~ComStubComponentBase()
Destroy ComStubComponentBase object.
void init()
Object initializer.
Definition: ObjBase.cpp:24
bool isConnected_drvAsyncSendOut_OutputPort(FwIndexType portNum) const
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition) const
Invoke output port comStatusOut.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
Status returned by the send call.
friend class ComStubTester
Friend class tester implementation to support white-box testing.
static constexpr FwIndexType getNum_dataOut_OutputPorts()
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
Drv::InputByteStreamReadyPort * get_drvConnected_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
bool isConnected_drvReceiveReturnOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
static constexpr FwIndexType getNum_drvReceiveReturnOut_OutputPorts()
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
friend class ComStubTesterBase
Friend class tester to support autocoded test harness.
virtual void drvReceiveIn_handler(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)=0
Handler for input port drvReceiveIn.
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
Drv::InputByteStreamDataPort * get_drvAsyncSendReturnIn_InputPort(FwIndexType portNum)
void drvAsyncSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port drvAsyncSendOut.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
PlatformIndexType FwIndexType
void set_drvReceiveReturnOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to drvReceiveReturnOut[portNum].
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
Type used to pass context info between components during framing/deframing.
void drvReceiveIn_handlerBase(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)
Handler base-class function for input port drvReceiveIn.
RateGroupDivider component implementation.
void set_drvSendOut_OutputPort(FwIndexType portNum, Drv::InputByteStreamSendPort *port)
Connect port to drvSendOut[portNum].
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_drvConnected_InputPorts()
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
static constexpr FwIndexType getNum_drvAsyncSendReturnIn_InputPorts()
Success/Failure.
bool isConnected_drvSendOut_OutputPort(FwIndexType portNum) const
void drvAsyncSendReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)
Handler base-class function for input port drvAsyncSendReturnIn.
void drvReceiveReturnOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port drvReceiveReturnOut.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
Drv::ByteStreamStatus drvSendOut_out(FwIndexType portNum, Fw::Buffer &sendBuffer) const
Invoke output port drvSendOut.
static constexpr FwIndexType getNum_drvReceiveIn_InputPorts()