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 <atomic>
11 
15 #include "Fw/Com/ComPortAc.hpp"
17 #include "Fw/FPrimeBasicTypes.hpp"
18 #include "Fw/Log/LogPortAc.hpp"
19 #include "Fw/Log/LogString.hpp"
20 #if FW_ENABLE_TEXT_LOGGING == 1
21 #include "Fw/Log/LogTextPortAc.hpp"
22 #endif
25 #include "Fw/Time/TimePortAc.hpp"
27 
28 namespace Svc {
29 
36  {
37 
38  // ----------------------------------------------------------------------
39  // Friend classes
40  // ----------------------------------------------------------------------
41 
43  friend class FprimeRouterTesterBase;
45  friend class FprimeRouterTester;
46 
47  PROTECTED:
48 
49  // ----------------------------------------------------------------------
50  // Constants
51  // ----------------------------------------------------------------------
52 
54  enum {
58  };
59 
61  enum {
65  };
66 
68  enum {
75  };
76 
78  enum {
81  };
82 
83  public:
84 
85  // ----------------------------------------------------------------------
86  // Component initialization
87  // ----------------------------------------------------------------------
88 
90  void init(
91  FwEnumStoreType instance = 0
92  );
93 
94  public:
95 
96  // ----------------------------------------------------------------------
97  // Getters for typed input ports
98  // ----------------------------------------------------------------------
99 
104  FwIndexType portNum
105  );
106 
111  FwIndexType portNum
112  );
113 
118  FwIndexType portNum
119  );
120 
121  public:
122 
123  // ----------------------------------------------------------------------
124  // Connect input ports to special output ports
125  // ----------------------------------------------------------------------
126 
129  FwIndexType portNum,
130  Fw::InputLogPort* port
131  );
132 
133 #if FW_ENABLE_TEXT_LOGGING == 1
134 
136  void set_logTextOut_OutputPort(
137  FwIndexType portNum,
138  Fw::InputLogTextPort* port
139  );
140 
141 #endif
142 
145  FwIndexType portNum,
146  Fw::InputTimePort* port
147  );
148 
149  public:
150 
151  // ----------------------------------------------------------------------
152  // Connect typed input ports to typed output ports
153  // ----------------------------------------------------------------------
154 
157  FwIndexType portNum,
159  );
160 
163  FwIndexType portNum,
165  );
166 
169  FwIndexType portNum,
170  Fw::InputComPort* port
171  );
172 
175  FwIndexType portNum,
177  );
178 
181  FwIndexType portNum,
183  );
184 
187  FwIndexType portNum,
189  );
190 
191 #if FW_PORT_SERIALIZATION
192 
193  public:
194 
195  // ----------------------------------------------------------------------
196  // Connect serial input ports to special output ports
197  // ----------------------------------------------------------------------
198 
201  FwIndexType portNum,
202  Fw::InputSerializePort* port
203  );
204 
205 #if FW_ENABLE_TEXT_LOGGING == 1
206 
208  void set_logTextOut_OutputPort(
209  FwIndexType portNum,
210  Fw::InputSerializePort* port
211  );
212 
213 #endif
214 
217  FwIndexType portNum,
218  Fw::InputSerializePort* port
219  );
220 
221 #endif
222 
223 #if FW_PORT_SERIALIZATION
224 
225  public:
226 
227  // ----------------------------------------------------------------------
228  // Connect serial input ports to typed output ports
229  // ----------------------------------------------------------------------
230 
233  FwIndexType portNum,
234  Fw::InputSerializePort* port
235  );
236 
239  FwIndexType portNum,
240  Fw::InputSerializePort* port
241  );
242 
245  FwIndexType portNum,
246  Fw::InputSerializePort* port
247  );
248 
251  FwIndexType portNum,
252  Fw::InputSerializePort* port
253  );
254 
257  FwIndexType portNum,
258  Fw::InputSerializePort* port
259  );
260 
261 #endif
262 
263  PROTECTED:
264 
265  // ----------------------------------------------------------------------
266  // Component construction and destruction
267  // ----------------------------------------------------------------------
268 
271  const char* compName = ""
272  );
273 
275  virtual ~FprimeRouterComponentBase();
276 
277  PROTECTED:
278 
279  // ----------------------------------------------------------------------
280  // Getters for numbers of typed input ports
281  // ----------------------------------------------------------------------
282 
287 
292 
297 
298  PROTECTED:
299 
300  // ----------------------------------------------------------------------
301  // Getters for numbers of special output ports
302  // ----------------------------------------------------------------------
303 
308 
309 #if FW_ENABLE_TEXT_LOGGING == 1
310 
314  FwIndexType getNum_logTextOut_OutputPorts() const;
315 
316 #endif
317 
322 
323  PROTECTED:
324 
325  // ----------------------------------------------------------------------
326  // Getters for numbers of typed output ports
327  // ----------------------------------------------------------------------
328 
333 
338 
343 
348 
353 
358 
359  PROTECTED:
360 
361  // ----------------------------------------------------------------------
362  // Connection status queries for special output ports
363  // ----------------------------------------------------------------------
364 
369  FwIndexType portNum
370  );
371 
372 #if FW_ENABLE_TEXT_LOGGING == 1
373 
377  bool isConnected_logTextOut_OutputPort(
378  FwIndexType portNum
379  );
380 
381 #endif
382 
387  FwIndexType portNum
388  );
389 
390  PROTECTED:
391 
392  // ----------------------------------------------------------------------
393  // Connection status queries for typed output ports
394  // ----------------------------------------------------------------------
395 
400  FwIndexType portNum
401  );
402 
407  FwIndexType portNum
408  );
409 
414  FwIndexType portNum
415  );
416 
421  FwIndexType portNum
422  );
423 
428  FwIndexType portNum
429  );
430 
435  FwIndexType portNum
436  );
437 
438  PROTECTED:
439 
440  // ----------------------------------------------------------------------
441  // Handlers to implement for typed input ports
442  // ----------------------------------------------------------------------
443 
445  virtual void cmdResponseIn_handler(
446  FwIndexType portNum,
447  FwOpcodeType opCode,
448  U32 cmdSeq,
449  const Fw::CmdResponse& response
450  ) = 0;
451 
453  virtual void dataIn_handler(
454  FwIndexType portNum,
455  Fw::Buffer& data,
456  const ComCfg::FrameContext& context
457  ) = 0;
458 
460  virtual void fileBufferReturnIn_handler(
461  FwIndexType portNum,
462  Fw::Buffer& fwBuffer
463  ) = 0;
464 
465  PROTECTED:
466 
467  // ----------------------------------------------------------------------
468  // Port handler base-class functions for typed input ports
469  //
470  // Call these functions directly to bypass the corresponding ports
471  // ----------------------------------------------------------------------
472 
475  FwIndexType portNum,
476  FwOpcodeType opCode,
477  U32 cmdSeq,
478  const Fw::CmdResponse& response
479  );
480 
482  void dataIn_handlerBase(
483  FwIndexType portNum,
484  Fw::Buffer& data,
485  const ComCfg::FrameContext& context
486  );
487 
490  FwIndexType portNum,
491  Fw::Buffer& fwBuffer
492  );
493 
494  PROTECTED:
495 
496  // ----------------------------------------------------------------------
497  // Invocation functions for typed output ports
498  // ----------------------------------------------------------------------
499 
502  FwIndexType portNum,
503  U32 size
504  );
505 
508  FwIndexType portNum,
509  Fw::Buffer& fwBuffer
510  );
511 
513  void commandOut_out(
514  FwIndexType portNum,
515  Fw::ComBuffer& data,
516  U32 context
517  );
518 
520  void dataReturnOut_out(
521  FwIndexType portNum,
522  Fw::Buffer& data,
523  const ComCfg::FrameContext& context
524  );
525 
527  void fileOut_out(
528  FwIndexType portNum,
529  Fw::Buffer& fwBuffer
530  );
531 
533  void unknownDataOut_out(
534  FwIndexType portNum,
535  Fw::Buffer& data,
536  const ComCfg::FrameContext& context
537  );
538 
539  PROTECTED:
540 
541  // ----------------------------------------------------------------------
542  // Event logging functions
543  // ----------------------------------------------------------------------
544 
549  U32 status
550  ) const;
551 
556  U32 status
557  ) const;
558 
559  PROTECTED:
560 
561  // ----------------------------------------------------------------------
562  // Time
563  // ----------------------------------------------------------------------
564 
568  Fw::Time getTime() const;
569 
570  PRIVATE:
571 
572  // ----------------------------------------------------------------------
573  // Calls for messages received on typed input ports
574  // ----------------------------------------------------------------------
575 
577  static void m_p_cmdResponseIn_in(
578  Fw::PassiveComponentBase* callComp,
579  FwIndexType portNum,
580  FwOpcodeType opCode,
581  U32 cmdSeq,
582  const Fw::CmdResponse& response
583  );
584 
586  static void m_p_dataIn_in(
587  Fw::PassiveComponentBase* callComp,
588  FwIndexType portNum,
589  Fw::Buffer& data,
590  const ComCfg::FrameContext& context
591  );
592 
594  static void m_p_fileBufferReturnIn_in(
595  Fw::PassiveComponentBase* callComp,
596  FwIndexType portNum,
597  Fw::Buffer& fwBuffer
598  );
599 
600  PRIVATE:
601 
602  // ----------------------------------------------------------------------
603  // Typed input ports
604  // ----------------------------------------------------------------------
605 
607  Fw::InputCmdResponsePort m_cmdResponseIn_InputPort[NUM_CMDRESPONSEIN_INPUT_PORTS];
608 
611 
613  Fw::InputBufferSendPort m_fileBufferReturnIn_InputPort[NUM_FILEBUFFERRETURNIN_INPUT_PORTS];
614 
615  PRIVATE:
616 
617  // ----------------------------------------------------------------------
618  // Special output ports
619  // ----------------------------------------------------------------------
620 
622  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
623 
624 #if FW_ENABLE_TEXT_LOGGING == 1
625 
627  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
628 
629 #endif
630 
632  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
633 
634  PRIVATE:
635 
636  // ----------------------------------------------------------------------
637  // Typed output ports
638  // ----------------------------------------------------------------------
639 
641  Fw::OutputBufferGetPort m_bufferAllocate_OutputPort[NUM_BUFFERALLOCATE_OUTPUT_PORTS];
642 
644  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
645 
647  Fw::OutputComPort m_commandOut_OutputPort[NUM_COMMANDOUT_OUTPUT_PORTS];
648 
651 
654 
657 
658  };
659 
660 }
661 
662 #endif
bool isConnected_bufferAllocate_OutputPort(FwIndexType portNum)
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.
friend class FprimeRouterTester
Friend class tester implementation to support white-box testing.
Definition: Time.hpp:9
virtual ~FprimeRouterComponentBase()
Destroy FprimeRouterComponentBase object.
FwIdType FwOpcodeType
The type of a command opcode.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
void fileBufferReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port fileBufferReturnIn.
I32 FwEnumStoreType
friend class FprimeRouterTesterBase
Friend class tester to support autocoded test harness.
bool isConnected_commandOut_OutputPort(FwIndexType portNum)
FprimeRouterComponentBase(const char *compName="")
Construct FprimeRouterComponentBase object.
Fw::Buffer bufferAllocate_out(FwIndexType portNum, U32 size)
Invoke output port bufferAllocate.
void fileOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port fileOut.
Enum representing a command response.
bool isConnected_fileOut_OutputPort(FwIndexType portNum)
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
bool isConnected_logOut_OutputPort(FwIndexType portNum)
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
Fw::InputCmdResponsePort * get_cmdResponseIn_InputPort(FwIndexType 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
An error occurred while deserializing a packet.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
FwIndexType getNum_bufferAllocate_OutputPorts() const
Fw::InputBufferSendPort * get_fileBufferReturnIn_InputPort(FwIndexType portNum)
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[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
Auto-generated base for FprimeRouter component.
void set_fileOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to fileOut[portNum].
An error occurred while serializing a com buffer.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
FwIndexType getNum_fileBufferReturnIn_InputPorts() const
void unknownDataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port unknownDataOut.
FwIndexType getNum_unknownDataOut_OutputPorts() const
void set_unknownDataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to unknownDataOut[portNum].
PlatformIndexType FwIndexType
void log_WARNING_HI_DeserializationError(U32 status) const
void log_WARNING_HI_SerializationError(U32 status) const
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
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.
bool isConnected_unknownDataOut_OutputPort(FwIndexType portNum)
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
FwIndexType getNum_dataReturnOut_OutputPorts() const
virtual void fileBufferReturnIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port fileBufferReturnIn.