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 #include "Fw/Log/LogTextPortAc.hpp"
15 #if !FW_DIRECT_PORT_CALLS
17 #endif
18 #if !FW_DIRECT_PORT_CALLS
20 #endif
21 #include "Fw/Time/TimePortAc.hpp"
23 
24 namespace Svc {
25 
32  {
33 
34  // ----------------------------------------------------------------------
35  // Friend classes
36  // ----------------------------------------------------------------------
37 
42 
43  protected:
44 
45  // ----------------------------------------------------------------------
46  // Constants
47  // ----------------------------------------------------------------------
48 
50  enum {
53  };
54 
56  enum {
60  };
61 
63  enum {
66  };
67 
68  public:
69 
70  // ----------------------------------------------------------------------
71  // Component initialization
72  // ----------------------------------------------------------------------
73 
75  void init(
76  FwEnumStoreType instance = 0
77  );
78 
79 #if !FW_DIRECT_PORT_CALLS
80 
81  public:
82 
83  // ----------------------------------------------------------------------
84  // Getters for typed input ports
85  // ----------------------------------------------------------------------
86 
91  FwIndexType portNum
92  );
93 
98  FwIndexType portNum
99  );
100 
101 #endif
102 
103 #if !FW_DIRECT_PORT_CALLS
104 
105  public:
106 
107  // ----------------------------------------------------------------------
108  // Connect input ports to special output ports
109  // ----------------------------------------------------------------------
110 
113  FwIndexType portNum,
114  Fw::InputLogPort* port
115  );
116 
117 #if FW_ENABLE_TEXT_LOGGING == 1
118 
120  void set_logTextOut_OutputPort(
121  FwIndexType portNum,
122  Fw::InputLogTextPort* port
123  );
124 
125 #endif
126 
129  FwIndexType portNum,
130  Fw::InputTimePort* port
131  );
132 
133 #endif
134 
135 #if !FW_DIRECT_PORT_CALLS
136 
137  public:
138 
139  // ----------------------------------------------------------------------
140  // Connect typed input ports to typed output ports
141  // ----------------------------------------------------------------------
142 
145  FwIndexType portNum,
147  );
148 
151  FwIndexType portNum,
153  );
154 
155 #endif
156 
157 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
158 
159  public:
160 
161  // ----------------------------------------------------------------------
162  // Connect serial input ports to special output ports
163  // ----------------------------------------------------------------------
164 
167  FwIndexType portNum,
168  Fw::InputSerializePort* port
169  );
170 
171 #if FW_ENABLE_TEXT_LOGGING == 1
172 
174  void set_logTextOut_OutputPort(
175  FwIndexType portNum,
176  Fw::InputSerializePort* port
177  );
178 
179 #endif
180 
183  FwIndexType portNum,
184  Fw::InputSerializePort* port
185  );
186 
187 #endif
188 
189 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
190 
191  public:
192 
193  // ----------------------------------------------------------------------
194  // Connect serial input ports to typed output ports
195  // ----------------------------------------------------------------------
196 
199  FwIndexType portNum,
200  Fw::InputSerializePort* port
201  );
202 
205  FwIndexType portNum,
206  Fw::InputSerializePort* port
207  );
208 
209 #endif
210 
211  protected:
212 
213  // ----------------------------------------------------------------------
214  // Component construction and destruction
215  // ----------------------------------------------------------------------
216 
219  const char* compName = ""
220  );
221 
224 
225  protected:
226 
227  // ----------------------------------------------------------------------
228  // Getters for numbers of typed input ports
229  // ----------------------------------------------------------------------
230 
236  }
237 
242  return NUM_DATAIN_INPUT_PORTS;
243  }
244 
245  protected:
246 
247  // ----------------------------------------------------------------------
248  // Getters for numbers of special output ports
249  // ----------------------------------------------------------------------
250 
256  }
257 
258 #if FW_ENABLE_TEXT_LOGGING == 1
259 
263  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
265  }
266 
267 #endif
268 
274  }
275 
276  protected:
277 
278  // ----------------------------------------------------------------------
279  // Getters for numbers of typed output ports
280  // ----------------------------------------------------------------------
281 
287  }
288 
294  }
295 
296  protected:
297 
298  // ----------------------------------------------------------------------
299  // Connection status queries for special output ports
300  // ----------------------------------------------------------------------
301 
306  FwIndexType portNum
307  ) const;
308 
309 #if FW_ENABLE_TEXT_LOGGING == 1
310 
314  bool isConnected_logTextOut_OutputPort(
315  FwIndexType portNum
316  ) const;
317 
318 #endif
319 
324  FwIndexType portNum
325  ) const;
326 
327  protected:
328 
329  // ----------------------------------------------------------------------
330  // Connection status queries for typed output ports
331  // ----------------------------------------------------------------------
332 
337  FwIndexType portNum
338  ) const;
339 
344  FwIndexType portNum
345  ) const;
346 
347  protected:
348 
349  // ----------------------------------------------------------------------
350  // Handlers to implement for typed input ports
351  // ----------------------------------------------------------------------
352 
354  virtual void allPacketsReturnIn_handler(
355  FwIndexType portNum,
356  Fw::Buffer& fwBuffer
357  ) = 0;
358 
360  virtual void dataIn_handler(
361  FwIndexType portNum,
362  Fw::Buffer& data,
363  const ComCfg::FrameContext& context
364  ) = 0;
365 
366 #if FW_DIRECT_PORT_CALLS
367  public:
368 #else
369  protected:
370 #endif
371 
372  // ----------------------------------------------------------------------
373  // Port handler base-class functions for typed input ports
374  //
375  // Call these functions directly to bypass the corresponding ports
376  // ----------------------------------------------------------------------
377 
380  FwIndexType portNum,
381  Fw::Buffer& fwBuffer
382  );
383 
385  void dataIn_handlerBase(
386  FwIndexType portNum,
387  Fw::Buffer& data,
388  const ComCfg::FrameContext& context
389  );
390 
391  protected:
392 
393  // ----------------------------------------------------------------------
394  // Invocation functions for typed output ports
395  // ----------------------------------------------------------------------
396 
398  void allPacketsOut_out(
399  FwIndexType portNum,
400  Fw::Buffer& fwBuffer
401  ) const;
402 
404  void dataReturnOut_out(
405  FwIndexType portNum,
406  Fw::Buffer& data,
407  const ComCfg::FrameContext& context
408  ) const;
409 
410  protected:
411 
412  // ----------------------------------------------------------------------
413  // Time
414  // ----------------------------------------------------------------------
415 
419  Fw::Time getTime() const;
420 
421  private:
422 
423  // ----------------------------------------------------------------------
424  // Calls for messages received on typed input ports
425  // ----------------------------------------------------------------------
426 
428  static void m_p_allPacketsReturnIn_in(
429  Fw::PassiveComponentBase* callComp,
430  FwIndexType portNum,
431  Fw::Buffer& fwBuffer
432  );
433 
435  static void m_p_dataIn_in(
436  Fw::PassiveComponentBase* callComp,
437  FwIndexType portNum,
438  Fw::Buffer& data,
439  const ComCfg::FrameContext& context
440  );
441 
442  private:
443 
444  // ----------------------------------------------------------------------
445  // Invocation functions for special output ports
446  // ----------------------------------------------------------------------
447 
449  void timeCaller_out(
450  FwIndexType portNum,
451  Fw::Time& time
452  ) const;
453 
454 #if !FW_DIRECT_PORT_CALLS
455 
456  private:
457 
458  // ----------------------------------------------------------------------
459  // Typed input ports
460  // ----------------------------------------------------------------------
461 
463  Fw::InputBufferSendPort m_allPacketsReturnIn_InputPort[NUM_ALLPACKETSRETURNIN_INPUT_PORTS];
464 
467 
468 #endif
469 
470 #if !FW_DIRECT_PORT_CALLS
471 
472  private:
473 
474  // ----------------------------------------------------------------------
475  // Special output ports
476  // ----------------------------------------------------------------------
477 
479  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
480 
481 #if FW_ENABLE_TEXT_LOGGING == 1
482 
484  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
485 
486 #endif
487 
489  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
490 
491 #endif
492 
493 #if !FW_DIRECT_PORT_CALLS
494 
495  private:
496 
497  // ----------------------------------------------------------------------
498  // Typed output ports
499  // ----------------------------------------------------------------------
500 
502  Fw::OutputBufferSendPort m_allPacketsOut_OutputPort[NUM_ALLPACKETSOUT_OUTPUT_PORTS];
503 
506 
507 #endif
508 
509  };
510 
511 }
512 
513 #endif
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
friend class PassThroughRouterTester
Friend class tester implementation to support white-box testing.
I32 FwEnumStoreType
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
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 set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
Fw::InputBufferSendPort * get_allPacketsReturnIn_InputPort(FwIndexType portNum)
bool isConnected_allPacketsOut_OutputPort(FwIndexType portNum) const
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
void set_allPacketsOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to allPacketsOut[portNum].
void allPacketsOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port allPacketsOut.
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.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
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()
bool isConnected_logOut_OutputPort(FwIndexType portNum) const