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 
230 
235 
240 
245 
246  protected:
247 
248  // ----------------------------------------------------------------------
249  // Getters for numbers of typed output ports
250  // ----------------------------------------------------------------------
251 
256 
261 
266 
271 
276 
281 
282  protected:
283 
284  // ----------------------------------------------------------------------
285  // Connection status queries for typed output ports
286  // ----------------------------------------------------------------------
287 
292  FwIndexType portNum
293  );
294 
299  FwIndexType portNum
300  );
301 
306  FwIndexType portNum
307  );
308 
313  FwIndexType portNum
314  );
315 
320  FwIndexType portNum
321  );
322 
327  FwIndexType portNum
328  );
329 
330  protected:
331 
332  // ----------------------------------------------------------------------
333  // Handlers to implement for typed input ports
334  // ----------------------------------------------------------------------
335 
337  virtual void dataIn_handler(
338  FwIndexType portNum,
339  Fw::Buffer& data,
340  const ComCfg::FrameContext& context
341  ) = 0;
342 
344  virtual void dataReturnIn_handler(
345  FwIndexType portNum,
346  Fw::Buffer& data,
347  const ComCfg::FrameContext& context
348  ) = 0;
349 
351  virtual void drvAsyncSendReturnIn_handler(
352  FwIndexType portNum,
353  Fw::Buffer& buffer,
354  const Drv::ByteStreamStatus& status
355  ) = 0;
356 
358  virtual void drvConnected_handler(
359  FwIndexType portNum
360  ) = 0;
361 
363  virtual void drvReceiveIn_handler(
364  FwIndexType portNum,
365  Fw::Buffer& buffer,
366  const Drv::ByteStreamStatus& status
367  ) = 0;
368 
369  protected:
370 
371  // ----------------------------------------------------------------------
372  // Port handler base-class functions for typed input ports
373  //
374  // Call these functions directly to bypass the corresponding ports
375  // ----------------------------------------------------------------------
376 
378  void dataIn_handlerBase(
379  FwIndexType portNum,
380  Fw::Buffer& data,
381  const ComCfg::FrameContext& context
382  );
383 
386  FwIndexType portNum,
387  Fw::Buffer& data,
388  const ComCfg::FrameContext& context
389  );
390 
393  FwIndexType portNum,
394  Fw::Buffer& buffer,
395  const Drv::ByteStreamStatus& status
396  );
397 
400  FwIndexType portNum
401  );
402 
405  FwIndexType portNum,
406  Fw::Buffer& buffer,
407  const Drv::ByteStreamStatus& status
408  );
409 
410  protected:
411 
412  // ----------------------------------------------------------------------
413  // Invocation functions for typed output ports
414  // ----------------------------------------------------------------------
415 
417  void comStatusOut_out(
418  FwIndexType portNum,
419  Fw::Success& condition
420  );
421 
423  void dataOut_out(
424  FwIndexType portNum,
425  Fw::Buffer& data,
426  const ComCfg::FrameContext& context
427  );
428 
430  void dataReturnOut_out(
431  FwIndexType portNum,
432  Fw::Buffer& data,
433  const ComCfg::FrameContext& context
434  );
435 
437  void drvAsyncSendOut_out(
438  FwIndexType portNum,
439  Fw::Buffer& fwBuffer
440  );
441 
444  FwIndexType portNum,
445  Fw::Buffer& fwBuffer
446  );
447 
450  FwIndexType portNum,
451  Fw::Buffer& sendBuffer
452  );
453 
454  private:
455 
456  // ----------------------------------------------------------------------
457  // Calls for messages received on typed input ports
458  // ----------------------------------------------------------------------
459 
461  static void m_p_dataIn_in(
462  Fw::PassiveComponentBase* callComp,
463  FwIndexType portNum,
464  Fw::Buffer& data,
465  const ComCfg::FrameContext& context
466  );
467 
469  static void m_p_dataReturnIn_in(
470  Fw::PassiveComponentBase* callComp,
471  FwIndexType portNum,
472  Fw::Buffer& data,
473  const ComCfg::FrameContext& context
474  );
475 
477  static void m_p_drvAsyncSendReturnIn_in(
478  Fw::PassiveComponentBase* callComp,
479  FwIndexType portNum,
480  Fw::Buffer& buffer,
481  const Drv::ByteStreamStatus& status
482  );
483 
485  static void m_p_drvConnected_in(
486  Fw::PassiveComponentBase* callComp,
487  FwIndexType portNum
488  );
489 
491  static void m_p_drvReceiveIn_in(
492  Fw::PassiveComponentBase* callComp,
493  FwIndexType portNum,
494  Fw::Buffer& buffer,
495  const Drv::ByteStreamStatus& status
496  );
497 
498  private:
499 
500  // ----------------------------------------------------------------------
501  // Typed input ports
502  // ----------------------------------------------------------------------
503 
506 
509 
511  Drv::InputByteStreamDataPort m_drvAsyncSendReturnIn_InputPort[NUM_DRVASYNCSENDRETURNIN_INPUT_PORTS];
512 
515 
518 
519  private:
520 
521  // ----------------------------------------------------------------------
522  // Typed output ports
523  // ----------------------------------------------------------------------
524 
527 
530 
533 
535  Fw::OutputBufferSendPort m_drvAsyncSendOut_OutputPort[NUM_DRVASYNCSENDOUT_OUTPUT_PORTS];
536 
538  Fw::OutputBufferSendPort m_drvReceiveReturnOut_OutputPort[NUM_DRVRECEIVERETURNOUT_OUTPUT_PORTS];
539 
542 
543  };
544 
545 }
546 
547 #endif
bool isConnected_drvAsyncSendOut_OutputPort(FwIndexType portNum)
FwIndexType getNum_drvSendOut_OutputPorts() const
ComStubComponentBase(const char *compName="")
Construct ComStubComponentBase object.
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.
FwIndexType getNum_dataIn_InputPorts() const
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
I32 FwEnumStoreType
FwIndexType getNum_drvReceiveReturnOut_OutputPorts() const
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)
bool isConnected_drvReceiveReturnOut_OutputPort(FwIndexType portNum)
FwIndexType getNum_dataReturnOut_OutputPorts() const
FwIndexType getNum_drvConnected_InputPorts() 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
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.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
Drv::InputByteStreamReadyPort * get_drvConnected_InputPort(FwIndexType portNum)
bool isConnected_drvSendOut_OutputPort(FwIndexType portNum)
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.
FwIndexType getNum_drvReceiveIn_InputPorts() const
FwIndexType getNum_dataOut_OutputPorts() const
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)
FwIndexType getNum_drvAsyncSendReturnIn_InputPorts() const
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)
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.
FwIndexType getNum_dataReturnIn_InputPorts() const
FwIndexType getNum_comStatusOut_OutputPorts() const
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.
FwIndexType getNum_drvAsyncSendOut_OutputPorts() const