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"
20 
21 namespace Svc {
22 
31  {
32 
33  // ----------------------------------------------------------------------
34  // Friend classes
35  // ----------------------------------------------------------------------
36 
38  friend class ComStubTesterBase;
40  friend class ComStubTester;
41 
42  protected:
43 
44  // ----------------------------------------------------------------------
45  // Constants
46  // ----------------------------------------------------------------------
47 
49  enum {
55  };
56 
58  enum {
65  };
66 
67  public:
68 
69  // ----------------------------------------------------------------------
70  // Component initialization
71  // ----------------------------------------------------------------------
72 
74  void init(
75  FwEnumStoreType instance = 0
76  );
77 
78  public:
79 
80  // ----------------------------------------------------------------------
81  // Getters for typed input ports
82  // ----------------------------------------------------------------------
83 
88  FwIndexType portNum
89  );
90 
95  FwIndexType portNum
96  );
97 
102  FwIndexType portNum
103  );
104 
109  FwIndexType portNum
110  );
111 
116  FwIndexType portNum
117  );
118 
119  public:
120 
121  // ----------------------------------------------------------------------
122  // Connect typed input ports to typed output ports
123  // ----------------------------------------------------------------------
124 
127  FwIndexType portNum,
129  );
130 
133  FwIndexType portNum,
135  );
136 
139  FwIndexType portNum,
141  );
142 
145  FwIndexType portNum,
147  );
148 
151  FwIndexType portNum,
153  );
154 
157  FwIndexType portNum,
159  );
160 
161 #if FW_PORT_SERIALIZATION
162 
163  public:
164 
165  // ----------------------------------------------------------------------
166  // Connect serial input ports to typed output ports
167  // ----------------------------------------------------------------------
168 
171  FwIndexType portNum,
172  Fw::InputSerializePort* port
173  );
174 
177  FwIndexType portNum,
178  Fw::InputSerializePort* port
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 
199 #endif
200 
201  protected:
202 
203  // ----------------------------------------------------------------------
204  // Component construction and destruction
205  // ----------------------------------------------------------------------
206 
209  const char* compName = ""
210  );
211 
213  virtual ~ComStubComponentBase();
214 
215  protected:
216 
217  // ----------------------------------------------------------------------
218  // Getters for numbers of typed input ports
219  // ----------------------------------------------------------------------
220 
225  return NUM_DATAIN_INPUT_PORTS;
226  }
227 
233  }
234 
240  }
241 
247  }
248 
254  }
255 
256  protected:
257 
258  // ----------------------------------------------------------------------
259  // Getters for numbers of typed output ports
260  // ----------------------------------------------------------------------
261 
267  }
268 
274  }
275 
281  }
282 
288  }
289 
295  }
296 
302  }
303 
304  protected:
305 
306  // ----------------------------------------------------------------------
307  // Connection status queries for typed output ports
308  // ----------------------------------------------------------------------
309 
314  FwIndexType portNum
315  );
316 
321  FwIndexType portNum
322  );
323 
328  FwIndexType portNum
329  );
330 
335  FwIndexType portNum
336  );
337 
342  FwIndexType portNum
343  );
344 
349  FwIndexType portNum
350  );
351 
352  protected:
353 
354  // ----------------------------------------------------------------------
355  // Handlers to implement for typed input ports
356  // ----------------------------------------------------------------------
357 
359  virtual void dataIn_handler(
360  FwIndexType portNum,
361  Fw::Buffer& data,
362  const ComCfg::FrameContext& context
363  ) = 0;
364 
366  virtual void dataReturnIn_handler(
367  FwIndexType portNum,
368  Fw::Buffer& data,
369  const ComCfg::FrameContext& context
370  ) = 0;
371 
373  virtual void drvAsyncSendReturnIn_handler(
374  FwIndexType portNum,
375  Fw::Buffer& buffer,
376  const Drv::ByteStreamStatus& status
377  ) = 0;
378 
380  virtual void drvConnected_handler(
381  FwIndexType portNum
382  ) = 0;
383 
385  virtual void drvReceiveIn_handler(
386  FwIndexType portNum,
387  Fw::Buffer& buffer,
388  const Drv::ByteStreamStatus& status
389  ) = 0;
390 
391  protected:
392 
393  // ----------------------------------------------------------------------
394  // Port handler base-class functions for typed input ports
395  //
396  // Call these functions directly to bypass the corresponding ports
397  // ----------------------------------------------------------------------
398 
400  void dataIn_handlerBase(
401  FwIndexType portNum,
402  Fw::Buffer& data,
403  const ComCfg::FrameContext& context
404  );
405 
408  FwIndexType portNum,
409  Fw::Buffer& data,
410  const ComCfg::FrameContext& context
411  );
412 
415  FwIndexType portNum,
416  Fw::Buffer& buffer,
417  const Drv::ByteStreamStatus& status
418  );
419 
422  FwIndexType portNum
423  );
424 
427  FwIndexType portNum,
428  Fw::Buffer& buffer,
429  const Drv::ByteStreamStatus& status
430  );
431 
432  protected:
433 
434  // ----------------------------------------------------------------------
435  // Invocation functions for typed output ports
436  // ----------------------------------------------------------------------
437 
439  void comStatusOut_out(
440  FwIndexType portNum,
441  Fw::Success& condition
442  );
443 
445  void dataOut_out(
446  FwIndexType portNum,
447  Fw::Buffer& data,
448  const ComCfg::FrameContext& context
449  );
450 
452  void dataReturnOut_out(
453  FwIndexType portNum,
454  Fw::Buffer& data,
455  const ComCfg::FrameContext& context
456  );
457 
459  void drvAsyncSendOut_out(
460  FwIndexType portNum,
461  Fw::Buffer& fwBuffer
462  );
463 
466  FwIndexType portNum,
467  Fw::Buffer& fwBuffer
468  );
469 
472  FwIndexType portNum,
473  Fw::Buffer& sendBuffer
474  );
475 
476  private:
477 
478  // ----------------------------------------------------------------------
479  // Calls for messages received on typed input ports
480  // ----------------------------------------------------------------------
481 
483  static void m_p_dataIn_in(
484  Fw::PassiveComponentBase* callComp,
485  FwIndexType portNum,
486  Fw::Buffer& data,
487  const ComCfg::FrameContext& context
488  );
489 
491  static void m_p_dataReturnIn_in(
492  Fw::PassiveComponentBase* callComp,
493  FwIndexType portNum,
494  Fw::Buffer& data,
495  const ComCfg::FrameContext& context
496  );
497 
499  static void m_p_drvAsyncSendReturnIn_in(
500  Fw::PassiveComponentBase* callComp,
501  FwIndexType portNum,
502  Fw::Buffer& buffer,
503  const Drv::ByteStreamStatus& status
504  );
505 
507  static void m_p_drvConnected_in(
508  Fw::PassiveComponentBase* callComp,
509  FwIndexType portNum
510  );
511 
513  static void m_p_drvReceiveIn_in(
514  Fw::PassiveComponentBase* callComp,
515  FwIndexType portNum,
516  Fw::Buffer& buffer,
517  const Drv::ByteStreamStatus& status
518  );
519 
520  private:
521 
522  // ----------------------------------------------------------------------
523  // Typed input ports
524  // ----------------------------------------------------------------------
525 
528 
531 
533  Drv::InputByteStreamDataPort m_drvAsyncSendReturnIn_InputPort[NUM_DRVASYNCSENDRETURNIN_INPUT_PORTS];
534 
537 
540 
541  private:
542 
543  // ----------------------------------------------------------------------
544  // Typed output ports
545  // ----------------------------------------------------------------------
546 
549 
552 
555 
557  Fw::OutputBufferSendPort m_drvAsyncSendOut_OutputPort[NUM_DRVASYNCSENDOUT_OUTPUT_PORTS];
558 
560  Fw::OutputBufferSendPort m_drvReceiveReturnOut_OutputPort[NUM_DRVRECEIVERETURNOUT_OUTPUT_PORTS];
561 
564 
565  };
566 
567 }
568 
569 #endif
static constexpr FwIndexType getNum_dataIn_InputPorts()
bool isConnected_drvAsyncSendOut_OutputPort(FwIndexType portNum)
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 dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
I32 FwEnumStoreType
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
Drv::ByteStreamStatus drvSendOut_out(FwIndexType portNum, Fw::Buffer &sendBuffer)
Invoke output port drvSendOut.
void drvConnected_handlerBase(FwIndexType portNum)
Handler base-class function for input port drvConnected.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
bool isConnected_drvReceiveReturnOut_OutputPort(FwIndexType portNum)
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
void drvReceiveReturnOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port drvReceiveReturnOut.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
void drvAsyncSendOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port drvAsyncSendOut.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum)
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_drvSendOut_OutputPort(FwIndexType portNum)
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.
Drv::InputByteStreamDataPort * get_drvAsyncSendReturnIn_InputPort(FwIndexType portNum)
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].
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()
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition)
Invoke output port comStatusOut.
static constexpr FwIndexType getNum_drvAsyncSendReturnIn_InputPorts()
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
Success/Failure.
void drvAsyncSendReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &buffer, const Drv::ByteStreamStatus &status)
Handler base-class function for input port drvAsyncSendReturnIn.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
static constexpr FwIndexType getNum_drvReceiveIn_InputPorts()