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
17 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 #if !FW_DIRECT_PORT_CALLS
22 #endif
23 #include "Fw/Time/TimePortAc.hpp"
25 
26 namespace Svc {
27 
34  {
35 
36  // ----------------------------------------------------------------------
37  // Friend classes
38  // ----------------------------------------------------------------------
39 
44 
45  protected:
46 
47  // ----------------------------------------------------------------------
48  // Constants
49  // ----------------------------------------------------------------------
50 
52  enum {
55  };
56 
58  enum {
62  };
63 
65  enum {
68  };
69 
70  public:
71 
72  // ----------------------------------------------------------------------
73  // Component initialization
74  // ----------------------------------------------------------------------
75 
77  void init(
78  FwEnumStoreType instance = 0
79  );
80 
81 #if !FW_DIRECT_PORT_CALLS
82 
83  public:
84 
85  // ----------------------------------------------------------------------
86  // Getters for typed input ports
87  // ----------------------------------------------------------------------
88 
93  FwIndexType portNum
94  );
95 
100  FwIndexType portNum
101  );
102 
103 #endif
104 
105 #if !FW_DIRECT_PORT_CALLS
106 
107  public:
108 
109  // ----------------------------------------------------------------------
110  // Connect input ports to special output ports
111  // ----------------------------------------------------------------------
112 
115  FwIndexType portNum,
116  Fw::InputLogPort* port
117  );
118 
119 #if FW_ENABLE_TEXT_LOGGING == 1
120 
122  void set_logTextOut_OutputPort(
123  FwIndexType portNum,
124  Fw::InputLogTextPort* port
125  );
126 
127 #endif
128 
131  FwIndexType portNum,
132  Fw::InputTimePort* port
133  );
134 
135 #endif
136 
137 #if !FW_DIRECT_PORT_CALLS
138 
139  public:
140 
141  // ----------------------------------------------------------------------
142  // Connect typed input ports to typed output ports
143  // ----------------------------------------------------------------------
144 
147  FwIndexType portNum,
149  );
150 
153  FwIndexType portNum,
155  );
156 
157 #endif
158 
159 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
160 
161  public:
162 
163  // ----------------------------------------------------------------------
164  // Connect serial input ports to special output ports
165  // ----------------------------------------------------------------------
166 
169  FwIndexType portNum,
170  Fw::InputSerializePort* port
171  );
172 
173 #if FW_ENABLE_TEXT_LOGGING == 1
174 
176  void set_logTextOut_OutputPort(
177  FwIndexType portNum,
178  Fw::InputSerializePort* port
179  );
180 
181 #endif
182 
185  FwIndexType portNum,
186  Fw::InputSerializePort* port
187  );
188 
189 #endif
190 
191 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
192 
193  public:
194 
195  // ----------------------------------------------------------------------
196  // Connect serial input ports to typed output ports
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 
226 
227  protected:
228 
229  // ----------------------------------------------------------------------
230  // Getters for numbers of typed input ports
231  // ----------------------------------------------------------------------
232 
238  }
239 
244  return NUM_DATAIN_INPUT_PORTS;
245  }
246 
247  protected:
248 
249  // ----------------------------------------------------------------------
250  // Getters for numbers of special output ports
251  // ----------------------------------------------------------------------
252 
258  }
259 
260 #if FW_ENABLE_TEXT_LOGGING == 1
261 
265  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
267  }
268 
269 #endif
270 
276  }
277 
278  protected:
279 
280  // ----------------------------------------------------------------------
281  // Getters for numbers of typed output ports
282  // ----------------------------------------------------------------------
283 
289  }
290 
296  }
297 
298  protected:
299 
300  // ----------------------------------------------------------------------
301  // Connection status queries for special output ports
302  // ----------------------------------------------------------------------
303 
308  FwIndexType portNum
309  ) const;
310 
311 #if FW_ENABLE_TEXT_LOGGING == 1
312 
316  bool isConnected_logTextOut_OutputPort(
317  FwIndexType portNum
318  ) const;
319 
320 #endif
321 
326  FwIndexType portNum
327  ) const;
328 
329  protected:
330 
331  // ----------------------------------------------------------------------
332  // Connection status queries for typed output ports
333  // ----------------------------------------------------------------------
334 
339  FwIndexType portNum
340  ) const;
341 
346  FwIndexType portNum
347  ) const;
348 
349  protected:
350 
351  // ----------------------------------------------------------------------
352  // Handlers to implement for typed input ports
353  // ----------------------------------------------------------------------
354 
356  virtual void allPacketsReturnIn_handler(
357  FwIndexType portNum,
358  Fw::Buffer& fwBuffer
359  ) = 0;
360 
362  virtual void dataIn_handler(
363  FwIndexType portNum,
364  Fw::Buffer& data,
365  const ComCfg::FrameContext& context
366  ) = 0;
367 
368 #if FW_DIRECT_PORT_CALLS
369  public:
370 #else
371  protected:
372 #endif
373 
374  // ----------------------------------------------------------------------
375  // Port handler base-class functions for typed input ports
376  //
377  // Call these functions directly to bypass the corresponding ports
378  // ----------------------------------------------------------------------
379 
382  FwIndexType portNum,
383  Fw::Buffer& fwBuffer
384  );
385 
387  void dataIn_handlerBase(
388  FwIndexType portNum,
389  Fw::Buffer& data,
390  const ComCfg::FrameContext& context
391  );
392 
393  protected:
394 
395  // ----------------------------------------------------------------------
396  // Invocation functions for typed output ports
397  // ----------------------------------------------------------------------
398 
400  void allPacketsOut_out(
401  FwIndexType portNum,
402  Fw::Buffer& fwBuffer
403  ) const;
404 
406  void dataReturnOut_out(
407  FwIndexType portNum,
408  Fw::Buffer& data,
409  const ComCfg::FrameContext& context
410  ) const;
411 
412  protected:
413 
414  // ----------------------------------------------------------------------
415  // Time
416  // ----------------------------------------------------------------------
417 
421  Fw::Time getTime() const;
422 
423  private:
424 
425  // ----------------------------------------------------------------------
426  // Calls for messages received on typed input ports
427  // ----------------------------------------------------------------------
428 
430  static void m_p_allPacketsReturnIn_in(
431  Fw::PassiveComponentBase* callComp,
432  FwIndexType portNum,
433  Fw::Buffer& fwBuffer
434  );
435 
437  static void m_p_dataIn_in(
438  Fw::PassiveComponentBase* callComp,
439  FwIndexType portNum,
440  Fw::Buffer& data,
441  const ComCfg::FrameContext& context
442  );
443 
444  private:
445 
446  // ----------------------------------------------------------------------
447  // Invocation functions for special output ports
448  // ----------------------------------------------------------------------
449 
451  void timeCaller_out(
452  FwIndexType portNum,
453  Fw::Time& time
454  ) const;
455 
456 #if !FW_DIRECT_PORT_CALLS
457 
458  private:
459 
460  // ----------------------------------------------------------------------
461  // Typed input ports
462  // ----------------------------------------------------------------------
463 
465  Fw::InputBufferSendPort m_allPacketsReturnIn_InputPort[NUM_ALLPACKETSRETURNIN_INPUT_PORTS];
466 
469 
470 #endif
471 
472 #if !FW_DIRECT_PORT_CALLS
473 
474  private:
475 
476  // ----------------------------------------------------------------------
477  // Special output ports
478  // ----------------------------------------------------------------------
479 
481  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
482 
483 #if FW_ENABLE_TEXT_LOGGING == 1
484 
486  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
487 
488 #endif
489 
491  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
492 
493 #endif
494 
495 #if !FW_DIRECT_PORT_CALLS
496 
497  private:
498 
499  // ----------------------------------------------------------------------
500  // Typed output ports
501  // ----------------------------------------------------------------------
502 
504  Fw::OutputBufferSendPort m_allPacketsOut_OutputPort[NUM_ALLPACKETSOUT_OUTPUT_PORTS];
505 
508 
509 #endif
510 
511  };
512 
513 }
514 
515 #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