F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
PassThroughRouterComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title PassThroughRouterComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for PassThroughRouter component base class
5 // ======================================================================
6 
7 #ifndef Svc_PassThroughRouterComponentAc_HPP
8 #define Svc_PassThroughRouterComponentAc_HPP
9 
12 #include "Fw/FPrimeBasicTypes.hpp"
13 #include "Fw/Log/LogPortAc.hpp"
14 #if FW_ENABLE_TEXT_LOGGING == 1
15 #include "Fw/Log/LogTextPortAc.hpp"
16 #endif
19 #include "Fw/Time/TimePortAc.hpp"
21 
22 namespace Svc {
23 
30  {
31 
32  // ----------------------------------------------------------------------
33  // Friend classes
34  // ----------------------------------------------------------------------
35 
40 
41  protected:
42 
43  // ----------------------------------------------------------------------
44  // Constants
45  // ----------------------------------------------------------------------
46 
48  enum {
51  };
52 
54  enum {
58  };
59 
61  enum {
64  };
65 
66  public:
67 
68  // ----------------------------------------------------------------------
69  // Component initialization
70  // ----------------------------------------------------------------------
71 
73  void init(
74  FwEnumStoreType instance = 0
75  );
76 
77  public:
78 
79  // ----------------------------------------------------------------------
80  // Getters for typed input ports
81  // ----------------------------------------------------------------------
82 
87  FwIndexType portNum
88  );
89 
94  FwIndexType portNum
95  );
96 
97  public:
98 
99  // ----------------------------------------------------------------------
100  // Connect input ports to special output ports
101  // ----------------------------------------------------------------------
102 
105  FwIndexType portNum,
106  Fw::InputLogPort* port
107  );
108 
109 #if FW_ENABLE_TEXT_LOGGING == 1
110 
112  void set_logTextOut_OutputPort(
113  FwIndexType portNum,
114  Fw::InputLogTextPort* port
115  );
116 
117 #endif
118 
121  FwIndexType portNum,
122  Fw::InputTimePort* port
123  );
124 
125  public:
126 
127  // ----------------------------------------------------------------------
128  // Connect typed input ports to typed output ports
129  // ----------------------------------------------------------------------
130 
133  FwIndexType portNum,
135  );
136 
139  FwIndexType portNum,
141  );
142 
143 #if FW_PORT_SERIALIZATION
144 
145  public:
146 
147  // ----------------------------------------------------------------------
148  // Connect serial input ports to special output ports
149  // ----------------------------------------------------------------------
150 
153  FwIndexType portNum,
154  Fw::InputSerializePort* port
155  );
156 
157 #if FW_ENABLE_TEXT_LOGGING == 1
158 
160  void set_logTextOut_OutputPort(
161  FwIndexType portNum,
162  Fw::InputSerializePort* port
163  );
164 
165 #endif
166 
169  FwIndexType portNum,
170  Fw::InputSerializePort* port
171  );
172 
173 #endif
174 
175 #if FW_PORT_SERIALIZATION
176 
177  public:
178 
179  // ----------------------------------------------------------------------
180  // Connect serial input ports to typed output ports
181  // ----------------------------------------------------------------------
182 
185  FwIndexType portNum,
186  Fw::InputSerializePort* port
187  );
188 
191  FwIndexType portNum,
192  Fw::InputSerializePort* port
193  );
194 
195 #endif
196 
197  protected:
198 
199  // ----------------------------------------------------------------------
200  // Component construction and destruction
201  // ----------------------------------------------------------------------
202 
205  const char* compName = ""
206  );
207 
210 
211  protected:
212 
213  // ----------------------------------------------------------------------
214  // Getters for numbers of typed input ports
215  // ----------------------------------------------------------------------
216 
222  }
223 
228  return NUM_DATAIN_INPUT_PORTS;
229  }
230 
231  protected:
232 
233  // ----------------------------------------------------------------------
234  // Getters for numbers of special output ports
235  // ----------------------------------------------------------------------
236 
242  }
243 
244 #if FW_ENABLE_TEXT_LOGGING == 1
245 
249  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
251  }
252 
253 #endif
254 
260  }
261 
262  protected:
263 
264  // ----------------------------------------------------------------------
265  // Getters for numbers of typed output ports
266  // ----------------------------------------------------------------------
267 
273  }
274 
280  }
281 
282  protected:
283 
284  // ----------------------------------------------------------------------
285  // Connection status queries for special output ports
286  // ----------------------------------------------------------------------
287 
292  FwIndexType portNum
293  );
294 
295 #if FW_ENABLE_TEXT_LOGGING == 1
296 
300  bool isConnected_logTextOut_OutputPort(
301  FwIndexType portNum
302  );
303 
304 #endif
305 
310  FwIndexType portNum
311  );
312 
313  protected:
314 
315  // ----------------------------------------------------------------------
316  // Connection status queries for typed output ports
317  // ----------------------------------------------------------------------
318 
323  FwIndexType portNum
324  );
325 
330  FwIndexType portNum
331  );
332 
333  protected:
334 
335  // ----------------------------------------------------------------------
336  // Handlers to implement for typed input ports
337  // ----------------------------------------------------------------------
338 
340  virtual void allPacketsReturnIn_handler(
341  FwIndexType portNum,
342  Fw::Buffer& fwBuffer
343  ) = 0;
344 
346  virtual void dataIn_handler(
347  FwIndexType portNum,
348  Fw::Buffer& data,
349  const ComCfg::FrameContext& context
350  ) = 0;
351 
352  protected:
353 
354  // ----------------------------------------------------------------------
355  // Port handler base-class functions for typed input ports
356  //
357  // Call these functions directly to bypass the corresponding ports
358  // ----------------------------------------------------------------------
359 
362  FwIndexType portNum,
363  Fw::Buffer& fwBuffer
364  );
365 
367  void dataIn_handlerBase(
368  FwIndexType portNum,
369  Fw::Buffer& data,
370  const ComCfg::FrameContext& context
371  );
372 
373  protected:
374 
375  // ----------------------------------------------------------------------
376  // Invocation functions for typed output ports
377  // ----------------------------------------------------------------------
378 
380  void allPacketsOut_out(
381  FwIndexType portNum,
382  Fw::Buffer& fwBuffer
383  );
384 
386  void dataReturnOut_out(
387  FwIndexType portNum,
388  Fw::Buffer& data,
389  const ComCfg::FrameContext& context
390  );
391 
392  protected:
393 
394  // ----------------------------------------------------------------------
395  // Time
396  // ----------------------------------------------------------------------
397 
401  Fw::Time getTime() const;
402 
403  private:
404 
405  // ----------------------------------------------------------------------
406  // Calls for messages received on typed input ports
407  // ----------------------------------------------------------------------
408 
410  static void m_p_allPacketsReturnIn_in(
411  Fw::PassiveComponentBase* callComp,
412  FwIndexType portNum,
413  Fw::Buffer& fwBuffer
414  );
415 
417  static void m_p_dataIn_in(
418  Fw::PassiveComponentBase* callComp,
419  FwIndexType portNum,
420  Fw::Buffer& data,
421  const ComCfg::FrameContext& context
422  );
423 
424  private:
425 
426  // ----------------------------------------------------------------------
427  // Typed input ports
428  // ----------------------------------------------------------------------
429 
431  Fw::InputBufferSendPort m_allPacketsReturnIn_InputPort[NUM_ALLPACKETSRETURNIN_INPUT_PORTS];
432 
435 
436  private:
437 
438  // ----------------------------------------------------------------------
439  // Special output ports
440  // ----------------------------------------------------------------------
441 
443  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
444 
445 #if FW_ENABLE_TEXT_LOGGING == 1
446 
448  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
449 
450 #endif
451 
453  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
454 
455  private:
456 
457  // ----------------------------------------------------------------------
458  // Typed output ports
459  // ----------------------------------------------------------------------
460 
462  Fw::OutputBufferSendPort m_allPacketsOut_OutputPort[NUM_ALLPACKETSOUT_OUTPUT_PORTS];
463 
466 
467  };
468 
469 }
470 
471 #endif
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
friend class PassThroughRouterTester
Friend class tester implementation to support white-box testing.
I32 FwEnumStoreType
bool isConnected_allPacketsOut_OutputPort(FwIndexType portNum)
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
friend class PassThroughRouterTesterBase
Friend class tester to support autocoded test harness.
static constexpr FwIndexType getNum_allPacketsReturnIn_InputPorts()
void init()
Object initializer.
Definition: ObjBase.cpp:24
static constexpr FwIndexType getNum_allPacketsOut_OutputPorts()
void allPacketsOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port allPacketsOut.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
Fw::InputBufferSendPort * get_allPacketsReturnIn_InputPort(FwIndexType portNum)
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
void set_allPacketsOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to allPacketsOut[portNum].
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
virtual void allPacketsReturnIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port allPacketsReturnIn.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
PassThroughRouterComponentBase(const char *compName="")
Construct PassThroughRouterComponentBase object.
PlatformIndexType FwIndexType
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
virtual ~PassThroughRouterComponentBase()
Destroy PassThroughRouterComponentBase object.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
Auto-generated base for PassThroughRouter component.
void allPacketsReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port allPacketsReturnIn.
static constexpr FwIndexType getNum_dataIn_InputPorts()
static constexpr FwIndexType getNum_logOut_OutputPorts()