F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FprimeRouterComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FprimeRouterComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FprimeRouter component base class
5 // ======================================================================
6 
7 #ifndef Svc_FprimeRouterComponentAc_HPP
8 #define Svc_FprimeRouterComponentAc_HPP
9 
10 #include "FpConfig.hpp"
14 #include "Fw/Com/ComPortAc.hpp"
16 #include "Fw/Log/LogPortAc.hpp"
17 #include "Fw/Log/LogString.hpp"
18 #if FW_ENABLE_TEXT_LOGGING == 1
19 #include "Fw/Log/LogTextPortAc.hpp"
20 #endif
23 #include "Fw/Time/TimePortAc.hpp"
24 
25 namespace Svc {
26 
33  {
34 
35  // ----------------------------------------------------------------------
36  // Friend classes
37  // ----------------------------------------------------------------------
38 
41 
42  PROTECTED:
43 
44  // ----------------------------------------------------------------------
45  // Constants
46  // ----------------------------------------------------------------------
47 
49  enum {
52  };
53 
55  enum {
59  };
60 
62  enum {
67  };
68 
70  enum {
73  };
74 
75  public:
76 
77  // ----------------------------------------------------------------------
78  // Component initialization
79  // ----------------------------------------------------------------------
80 
82  void init(
83  FwEnumStoreType instance = 0
84  );
85 
86  public:
87 
88  // ----------------------------------------------------------------------
89  // Getters for typed input ports
90  // ----------------------------------------------------------------------
91 
96  FwIndexType portNum
97  );
98 
103  FwIndexType portNum
104  );
105 
106  public:
107 
108  // ----------------------------------------------------------------------
109  // Connect input ports to special output ports
110  // ----------------------------------------------------------------------
111 
114  FwIndexType portNum,
115  Fw::InputLogPort* port
116  );
117 
118 #if FW_ENABLE_TEXT_LOGGING == 1
119 
121  void set_logTextOut_OutputPort(
122  FwIndexType portNum,
123  Fw::InputLogTextPort* port
124  );
125 
126 #endif
127 
130  FwIndexType portNum,
131  Fw::InputTimePort* port
132  );
133 
134  public:
135 
136  // ----------------------------------------------------------------------
137  // Connect typed input ports to typed output ports
138  // ----------------------------------------------------------------------
139 
142  FwIndexType portNum,
144  );
145 
148  FwIndexType portNum,
149  Fw::InputComPort* port
150  );
151 
154  FwIndexType portNum,
156  );
157 
160  FwIndexType portNum,
162  );
163 
164 #if FW_PORT_SERIALIZATION
165 
166  public:
167 
168  // ----------------------------------------------------------------------
169  // Connect serial input ports to special output ports
170  // ----------------------------------------------------------------------
171 
174  FwIndexType portNum,
175  Fw::InputSerializePort* port
176  );
177 
178 #if FW_ENABLE_TEXT_LOGGING == 1
179 
181  void set_logTextOut_OutputPort(
182  FwIndexType portNum,
183  Fw::InputSerializePort* port
184  );
185 
186 #endif
187 
190  FwIndexType portNum,
191  Fw::InputSerializePort* port
192  );
193 
194 #endif
195 
196 #if FW_PORT_SERIALIZATION
197 
198  public:
199 
200  // ----------------------------------------------------------------------
201  // Connect serial input ports to typed output ports
202  // ----------------------------------------------------------------------
203 
206  FwIndexType portNum,
207  Fw::InputSerializePort* port
208  );
209 
212  FwIndexType portNum,
213  Fw::InputSerializePort* port
214  );
215 
218  FwIndexType portNum,
219  Fw::InputSerializePort* port
220  );
221 
224  FwIndexType portNum,
225  Fw::InputSerializePort* port
226  );
227 
228 #endif
229 
230  PROTECTED:
231 
232  // ----------------------------------------------------------------------
233  // Component construction and destruction
234  // ----------------------------------------------------------------------
235 
238  const char* compName = ""
239  );
240 
242  virtual ~FprimeRouterComponentBase();
243 
244  PROTECTED:
245 
246  // ----------------------------------------------------------------------
247  // Getters for numbers of typed input ports
248  // ----------------------------------------------------------------------
249 
254 
259 
260  PROTECTED:
261 
262  // ----------------------------------------------------------------------
263  // Getters for numbers of special output ports
264  // ----------------------------------------------------------------------
265 
270 
271 #if FW_ENABLE_TEXT_LOGGING == 1
272 
276  FwIndexType getNum_logTextOut_OutputPorts() const;
277 
278 #endif
279 
284 
285  PROTECTED:
286 
287  // ----------------------------------------------------------------------
288  // Getters for numbers of typed output ports
289  // ----------------------------------------------------------------------
290 
295 
300 
305 
310 
311  PROTECTED:
312 
313  // ----------------------------------------------------------------------
314  // Connection status queries for special output ports
315  // ----------------------------------------------------------------------
316 
321  FwIndexType portNum
322  );
323 
324 #if FW_ENABLE_TEXT_LOGGING == 1
325 
329  bool isConnected_logTextOut_OutputPort(
330  FwIndexType portNum
331  );
332 
333 #endif
334 
339  FwIndexType portNum
340  );
341 
342  PROTECTED:
343 
344  // ----------------------------------------------------------------------
345  // Connection status queries for typed output ports
346  // ----------------------------------------------------------------------
347 
352  FwIndexType portNum
353  );
354 
359  FwIndexType portNum
360  );
361 
366  FwIndexType portNum
367  );
368 
373  FwIndexType portNum
374  );
375 
376  PROTECTED:
377 
378  // ----------------------------------------------------------------------
379  // Handlers to implement for typed input ports
380  // ----------------------------------------------------------------------
381 
383  virtual void cmdResponseIn_handler(
384  FwIndexType portNum,
385  FwOpcodeType opCode,
386  U32 cmdSeq,
387  const Fw::CmdResponse& response
388  ) = 0;
389 
391  virtual void dataIn_handler(
392  FwIndexType portNum,
393  Fw::Buffer& data,
394  Fw::Buffer& context
395  ) = 0;
396 
397  PROTECTED:
398 
399  // ----------------------------------------------------------------------
400  // Port handler base-class functions for typed input ports
401  //
402  // Call these functions directly to bypass the corresponding ports
403  // ----------------------------------------------------------------------
404 
407  FwIndexType portNum,
408  FwOpcodeType opCode,
409  U32 cmdSeq,
410  const Fw::CmdResponse& response
411  );
412 
414  void dataIn_handlerBase(
415  FwIndexType portNum,
416  Fw::Buffer& data,
417  Fw::Buffer& context
418  );
419 
420  PROTECTED:
421 
422  // ----------------------------------------------------------------------
423  // Invocation functions for typed output ports
424  // ----------------------------------------------------------------------
425 
428  FwIndexType portNum,
429  Fw::Buffer& fwBuffer
430  );
431 
433  void commandOut_out(
434  FwIndexType portNum,
435  Fw::ComBuffer& data,
436  U32 context
437  );
438 
440  void fileOut_out(
441  FwIndexType portNum,
442  Fw::Buffer& fwBuffer
443  );
444 
446  void unknownDataOut_out(
447  FwIndexType portNum,
448  Fw::Buffer& data,
449  Fw::Buffer& context
450  );
451 
452  PROTECTED:
453 
454  // ----------------------------------------------------------------------
455  // Event logging functions
456  // ----------------------------------------------------------------------
457 
462  U32 status
463  ) const;
464 
469  U32 status
470  ) const;
471 
472  PROTECTED:
473 
474  // ----------------------------------------------------------------------
475  // Time
476  // ----------------------------------------------------------------------
477 
481  Fw::Time getTime();
482 
483  PRIVATE:
484 
485  // ----------------------------------------------------------------------
486  // Calls for messages received on typed input ports
487  // ----------------------------------------------------------------------
488 
490  static void m_p_cmdResponseIn_in(
491  Fw::PassiveComponentBase* callComp,
492  FwIndexType portNum,
493  FwOpcodeType opCode,
494  U32 cmdSeq,
495  const Fw::CmdResponse& response
496  );
497 
499  static void m_p_dataIn_in(
500  Fw::PassiveComponentBase* callComp,
501  FwIndexType portNum,
502  Fw::Buffer& data,
503  Fw::Buffer& context
504  );
505 
506  PRIVATE:
507 
508  // ----------------------------------------------------------------------
509  // Typed input ports
510  // ----------------------------------------------------------------------
511 
513  Fw::InputCmdResponsePort m_cmdResponseIn_InputPort[NUM_CMDRESPONSEIN_INPUT_PORTS];
514 
517 
518  PRIVATE:
519 
520  // ----------------------------------------------------------------------
521  // Special output ports
522  // ----------------------------------------------------------------------
523 
525  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
526 
527 #if FW_ENABLE_TEXT_LOGGING == 1
528 
530  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
531 
532 #endif
533 
535  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
536 
537  PRIVATE:
538 
539  // ----------------------------------------------------------------------
540  // Typed output ports
541  // ----------------------------------------------------------------------
542 
544  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
545 
547  Fw::OutputComPort m_commandOut_OutputPort[NUM_COMMANDOUT_OUTPUT_PORTS];
548 
551 
554 
555  };
556 
557 }
558 
559 #endif
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void commandOut_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context)
Invoke output port commandOut.
Definition: Time.hpp:9
virtual ~FprimeRouterComponentBase()
Destroy FprimeRouterComponentBase object.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, Fw::Buffer &context)
Handler base-class function for input port dataIn.
bool isConnected_commandOut_OutputPort(FwIndexType portNum)
FprimeRouterComponentBase(const char *compName="")
Construct FprimeRouterComponentBase object.
An error occurred while serializing a com buffer.
An error occurred while deserializing a packet.
I32 FwEnumStoreType
Definition: FpConfig.h:64
void fileOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port fileOut.
Enum representing a command response.
bool isConnected_fileOut_OutputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
Fw::InputCmdResponsePort * get_cmdResponseIn_InputPort(FwIndexType portNum)
void set_unknownDataOut_OutputPort(FwIndexType portNum, Fw::InputDataWithContextPort *port)
Connect port to unknownDataOut[portNum].
void init()
Object initializer.
Definition: ObjBase.cpp:26
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
FwIndexType getNum_bufferDeallocate_OutputPorts() const
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void cmdResponseIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)
Handler base-class function for input port cmdResponseIn.
FwIndexType getNum_cmdResponseIn_InputPorts() const
U32 FwOpcodeType
Definition: FpConfig.h:91
friend class FprimeRouterComponentBaseFriend
Friend class for white-box testing.
Auto-generated base for FprimeRouter component.
void set_fileOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to fileOut[portNum].
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
C++-compatible configuration header for fprime configuration.
FwIndexType getNum_unknownDataOut_OutputPorts() const
Fw::InputDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void unknownDataOut_out(FwIndexType portNum, Fw::Buffer &data, Fw::Buffer &context)
Invoke output port unknownDataOut.
void log_WARNING_HI_DeserializationError(U32 status) const
void log_WARNING_HI_SerializationError(U32 status) const
void set_commandOut_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to commandOut[portNum].
virtual void cmdResponseIn_handler(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response)=0
Handler for input port cmdResponseIn.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, Fw::Buffer &context)=0
Handler for input port dataIn.
bool isConnected_unknownDataOut_OutputPort(FwIndexType portNum)