F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
GenericHubComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title GenericHubComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for GenericHub component base class
5 // ======================================================================
6 
7 #ifndef Svc_GenericHubComponentAc_HPP
8 #define Svc_GenericHubComponentAc_HPP
9 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
17 #include "Fw/Tlm/TlmPortAc.hpp"
18 
19 static_assert(
21  "GenericHub component requires serialization"
22 );
23 
24 namespace Svc {
25 
32  {
33 
34  // ----------------------------------------------------------------------
35  // Friend classes
36  // ----------------------------------------------------------------------
37 
39  friend class GenericHubTesterBase;
41  friend class GenericHubTester;
42 
43  PROTECTED:
44 
45  // ----------------------------------------------------------------------
46  // Constants
47  // ----------------------------------------------------------------------
48 
50  enum {
55  };
56 
58  enum {
60  };
61 
63  enum {
71  };
72 
74  enum {
76  };
77 
78  public:
79 
80  // ----------------------------------------------------------------------
81  // Component initialization
82  // ----------------------------------------------------------------------
83 
85  void init(
86  FwEnumStoreType instance = 0
87  );
88 
89  public:
90 
91  // ----------------------------------------------------------------------
92  // Getters for typed input ports
93  // ----------------------------------------------------------------------
94 
99  FwIndexType portNum
100  );
101 
106  FwIndexType portNum
107  );
108 
113  FwIndexType portNum
114  );
115 
120  FwIndexType portNum
121  );
122 
123  public:
124 
125  // ----------------------------------------------------------------------
126  // Getters for serial input ports
127  // ----------------------------------------------------------------------
128 
132  Fw::InputSerializePort* get_portIn_InputPort(
133  FwIndexType portNum
134  );
135 
136  public:
137 
138  // ----------------------------------------------------------------------
139  // Connect typed input ports to typed output ports
140  // ----------------------------------------------------------------------
141 
144  FwIndexType portNum,
145  Fw::InputLogPort* port
146  );
147 
150  FwIndexType portNum,
151  Fw::InputTlmPort* port
152  );
153 
156  FwIndexType portNum,
158  );
159 
162  FwIndexType portNum,
164  );
165 
168  FwIndexType portNum,
170  );
171 
174  FwIndexType portNum,
176  );
177 
180  FwIndexType portNum,
182  );
183 
184 #if FW_PORT_SERIALIZATION
185 
186  public:
187 
188  // ----------------------------------------------------------------------
189  // Connect serial input ports to typed output ports
190  // ----------------------------------------------------------------------
191 
194  FwIndexType portNum,
195  Fw::InputSerializePort* port
196  );
197 
200  FwIndexType portNum,
201  Fw::InputSerializePort* port
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 #if FW_PORT_SERIALIZATION
231 
232  public:
233 
234  // ----------------------------------------------------------------------
235  // Connect serial input ports to serial output ports
236  // ----------------------------------------------------------------------
237 
239  void set_portOut_OutputPort(
240  FwIndexType portNum,
241  Fw::InputPortBase* port
242  );
243 
244 #endif
245 
246  PROTECTED:
247 
248  // ----------------------------------------------------------------------
249  // Component construction and destruction
250  // ----------------------------------------------------------------------
251 
254  const char* compName = ""
255  );
256 
258  virtual ~GenericHubComponentBase();
259 
260  PROTECTED:
261 
262  // ----------------------------------------------------------------------
263  // Getters for numbers of typed input ports
264  // ----------------------------------------------------------------------
265 
270 
275 
280 
285 
286  PROTECTED:
287 
288  // ----------------------------------------------------------------------
289  // Getters for numbers of serial input ports
290  // ----------------------------------------------------------------------
291 
296 
297  PROTECTED:
298 
299  // ----------------------------------------------------------------------
300  // Getters for numbers of typed output ports
301  // ----------------------------------------------------------------------
302 
307 
312 
317 
322 
327 
332 
337 
338  PROTECTED:
339 
340  // ----------------------------------------------------------------------
341  // Getters for numbers of serial output ports
342  // ----------------------------------------------------------------------
343 
348 
349  PROTECTED:
350 
351  // ----------------------------------------------------------------------
352  // Connection status queries for typed output ports
353  // ----------------------------------------------------------------------
354 
359  FwIndexType portNum
360  );
361 
366  FwIndexType portNum
367  );
368 
373  FwIndexType portNum
374  );
375 
380  FwIndexType portNum
381  );
382 
387  FwIndexType portNum
388  );
389 
394  FwIndexType portNum
395  );
396 
401  FwIndexType portNum
402  );
403 
404  PROTECTED:
405 
406  // ----------------------------------------------------------------------
407  // Connection status queries for serial output ports
408  // ----------------------------------------------------------------------
409 
414  FwIndexType portNum
415  );
416 
417  PROTECTED:
418 
419  // ----------------------------------------------------------------------
420  // Handlers to implement for typed input ports
421  // ----------------------------------------------------------------------
422 
424  virtual void LogRecv_handler(
425  FwIndexType portNum,
426  FwEventIdType id,
427  Fw::Time& timeTag,
428  const Fw::LogSeverity& severity,
429  Fw::LogBuffer& args
430  ) = 0;
431 
433  virtual void TlmRecv_handler(
434  FwIndexType portNum,
435  FwChanIdType id,
436  Fw::Time& timeTag,
437  Fw::TlmBuffer& val
438  ) = 0;
439 
441  virtual void buffersIn_handler(
442  FwIndexType portNum,
443  Fw::Buffer& fwBuffer
444  ) = 0;
445 
447  virtual void dataIn_handler(
448  FwIndexType portNum,
449  Fw::Buffer& fwBuffer
450  ) = 0;
451 
452  PROTECTED:
453 
454  // ----------------------------------------------------------------------
455  // Port handler base-class functions for typed input ports
456  //
457  // Call these functions directly to bypass the corresponding ports
458  // ----------------------------------------------------------------------
459 
461  void LogRecv_handlerBase(
462  FwIndexType portNum,
463  FwEventIdType id,
464  Fw::Time& timeTag,
465  const Fw::LogSeverity& severity,
466  Fw::LogBuffer& args
467  );
468 
470  void TlmRecv_handlerBase(
471  FwIndexType portNum,
472  FwChanIdType id,
473  Fw::Time& timeTag,
474  Fw::TlmBuffer& val
475  );
476 
479  FwIndexType portNum,
480  Fw::Buffer& fwBuffer
481  );
482 
484  void dataIn_handlerBase(
485  FwIndexType portNum,
486  Fw::Buffer& fwBuffer
487  );
488 
489  PROTECTED:
490 
491  // ----------------------------------------------------------------------
492  // Handlers to implement for serial input ports
493  // ----------------------------------------------------------------------
494 
496  virtual void portIn_handler(
497  FwIndexType portNum,
498  Fw::SerializeBufferBase& buffer
499  ) = 0;
500 
501  PROTECTED:
502 
503  // ----------------------------------------------------------------------
504  // Port handler base-class functions for serial input ports
505  //
506  // Call these functions directly to bypass the corresponding ports
507  // ----------------------------------------------------------------------
508 
510  void portIn_handlerBase(
511  FwIndexType portNum,
512  Fw::SerializeBufferBase& buffer
513  );
514 
515  PROTECTED:
516 
517  // ----------------------------------------------------------------------
518  // Invocation functions for typed output ports
519  // ----------------------------------------------------------------------
520 
522  void LogSend_out(
523  FwIndexType portNum,
524  FwEventIdType id,
525  Fw::Time& timeTag,
526  const Fw::LogSeverity& severity,
527  Fw::LogBuffer& args
528  );
529 
531  void TlmSend_out(
532  FwIndexType portNum,
533  FwChanIdType id,
534  Fw::Time& timeTag,
535  Fw::TlmBuffer& val
536  );
537 
540  FwIndexType portNum,
541  Fw::Buffer& fwBuffer
542  );
543 
545  void buffersOut_out(
546  FwIndexType portNum,
547  Fw::Buffer& fwBuffer
548  );
549 
552  FwIndexType portNum,
553  Fw::Buffer& fwBuffer
554  );
555 
557  void dataOut_out(
558  FwIndexType portNum,
559  Fw::Buffer& fwBuffer
560  );
561 
564  FwIndexType portNum,
565  U32 size
566  );
567 
568  PROTECTED:
569 
570  // ----------------------------------------------------------------------
571  // Invocation functions for serial output ports
572  // ----------------------------------------------------------------------
573 
576  FwIndexType portNum,
577  Fw::SerializeBufferBase& buffer
578  );
579 
580  PRIVATE:
581 
582  // ----------------------------------------------------------------------
583  // Calls for messages received on typed input ports
584  // ----------------------------------------------------------------------
585 
587  static void m_p_LogRecv_in(
588  Fw::PassiveComponentBase* callComp,
589  FwIndexType portNum,
590  FwEventIdType id,
591  Fw::Time& timeTag,
592  const Fw::LogSeverity& severity,
593  Fw::LogBuffer& args
594  );
595 
597  static void m_p_TlmRecv_in(
598  Fw::PassiveComponentBase* callComp,
599  FwIndexType portNum,
600  FwChanIdType id,
601  Fw::Time& timeTag,
602  Fw::TlmBuffer& val
603  );
604 
606  static void m_p_buffersIn_in(
607  Fw::PassiveComponentBase* callComp,
608  FwIndexType portNum,
609  Fw::Buffer& fwBuffer
610  );
611 
613  static void m_p_dataIn_in(
614  Fw::PassiveComponentBase* callComp,
615  FwIndexType portNum,
616  Fw::Buffer& fwBuffer
617  );
618 
619  PRIVATE:
620 
621  // ----------------------------------------------------------------------
622  // Calls for messages received on serial input ports
623  // ----------------------------------------------------------------------
624 
625 #if FW_PORT_SERIALIZATION
626 
628  static void m_p_portIn_in(
629  Fw::PassiveComponentBase* callComp,
630  FwIndexType portNum,
631  Fw::SerializeBufferBase& buffer
632  );
633 
634 #endif
635 
636  PRIVATE:
637 
638  // ----------------------------------------------------------------------
639  // Typed input ports
640  // ----------------------------------------------------------------------
641 
643  Fw::InputLogPort m_LogRecv_InputPort[NUM_LOGRECV_INPUT_PORTS];
644 
646  Fw::InputTlmPort m_TlmRecv_InputPort[NUM_TLMRECV_INPUT_PORTS];
647 
649  Fw::InputBufferSendPort m_buffersIn_InputPort[NUM_BUFFERSIN_INPUT_PORTS];
650 
653 
654  PRIVATE:
655 
656  // ----------------------------------------------------------------------
657  // Serial input ports
658  // ----------------------------------------------------------------------
659 
661  Fw::InputSerializePort m_portIn_InputPort[NUM_PORTIN_INPUT_PORTS];
662 
663  PRIVATE:
664 
665  // ----------------------------------------------------------------------
666  // Typed output ports
667  // ----------------------------------------------------------------------
668 
670  Fw::OutputLogPort m_LogSend_OutputPort[NUM_LOGSEND_OUTPUT_PORTS];
671 
673  Fw::OutputTlmPort m_TlmSend_OutputPort[NUM_TLMSEND_OUTPUT_PORTS];
674 
676  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
677 
679  Fw::OutputBufferSendPort m_buffersOut_OutputPort[NUM_BUFFERSOUT_OUTPUT_PORTS];
680 
682  Fw::OutputBufferSendPort m_dataInDeallocate_OutputPort[NUM_DATAINDEALLOCATE_OUTPUT_PORTS];
683 
686 
688  Fw::OutputBufferGetPort m_dataOutAllocate_OutputPort[NUM_DATAOUTALLOCATE_OUTPUT_PORTS];
689 
690  PRIVATE:
691 
692  // ----------------------------------------------------------------------
693  // Serial output ports
694  // ----------------------------------------------------------------------
695 
697  Fw::OutputSerializePort m_portOut_OutputPort[NUM_PORTOUT_OUTPUT_PORTS];
698 
699  };
700 
701 }
702 
703 #endif
void set_TlmSend_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to TlmSend[portNum].
FwIndexType getNum_TlmSend_OutputPorts() const
void set_dataOutAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to dataOutAllocate[portNum].
FwIndexType getNum_portIn_InputPorts() const
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
friend class GenericHubTester
Friend class tester implementation to support white-box testing.
Definition: Time.hpp:9
FwIndexType getNum_dataIn_InputPorts() const
void set_buffersOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to buffersOut[portNum].
FwIndexType getNum_LogRecv_InputPorts() const
virtual ~GenericHubComponentBase()
Destroy GenericHubComponentBase object.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port dataIn.
I32 FwEnumStoreType
void LogSend_out(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke output port LogSend.
void set_LogSend_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to LogSend[portNum].
U32 FwChanIdType
The type of a telemetry channel identifier.
void buffersIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffersIn.
virtual void LogRecv_handler(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
FwIndexType getNum_dataInDeallocate_OutputPorts() const
void dataOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port dataOut.
Fw::Buffer dataOutAllocate_out(FwIndexType portNum, U32 size)
Invoke output port dataOutAllocate.
void init()
Object initializer.
Definition: ObjBase.cpp:26
Fw::SerializeStatus portOut_out(FwIndexType portNum, Fw::SerializeBufferBase &buffer)
Invoke output port portOut.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
Auto-generated base for GenericHub component.
U32 FwEventIdType
The type of an event identifier.
SerializeStatus
forward declaration for string
bool isConnected_TlmSend_OutputPort(FwIndexType portNum)
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
void portIn_handlerBase(FwIndexType portNum, Fw::SerializeBufferBase &buffer)
Handler base-class function for input port portIn.
Fw::InputBufferSendPort * get_buffersIn_InputPort(FwIndexType portNum)
void buffersOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port buffersOut.
bool isConnected_portOut_OutputPort(FwIndexType portNum)
void set_dataInDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to dataInDeallocate[portNum].
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
Fw::InputSerializePort * get_portIn_InputPort(FwIndexType portNum)
virtual void portIn_handler(FwIndexType portNum, Fw::SerializeBufferBase &buffer)=0
Handler for input port portIn.
FwIndexType getNum_TlmRecv_InputPorts() const
bool isConnected_dataOutAllocate_OutputPort(FwIndexType portNum)
Fw::InputLogPort * get_LogRecv_InputPort(FwIndexType portNum)
FwIndexType getNum_bufferDeallocate_OutputPorts() const
friend class GenericHubTesterBase
Friend class tester to support autocoded test harness.
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
Enum representing event severity.
FwIndexType getNum_dataOut_OutputPorts() const
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
void TlmSend_out(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke output port TlmSend.
Fw::InputBufferSendPort * get_dataIn_InputPort(FwIndexType portNum)
bool isConnected_buffersOut_OutputPort(FwIndexType portNum)
bool isConnected_LogSend_OutputPort(FwIndexType portNum)
FwIndexType getNum_portOut_OutputPorts() const
PlatformIndexType FwIndexType
FwIndexType getNum_buffersOut_OutputPorts() const
void set_dataOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to dataOut[portNum].
RateGroupDivider component implementation.
void dataInDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port dataInDeallocate.
GenericHubComponentBase(const char *compName="")
Construct GenericHubComponentBase object.
bool isConnected_dataInDeallocate_OutputPort(FwIndexType portNum)
virtual void buffersIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffersIn.
FwIndexType getNum_buffersIn_InputPorts() const
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
FwIndexType getNum_dataOutAllocate_OutputPorts() const
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port dataIn.
#define FW_PORT_SERIALIZATION
for multi-note systems)
Definition: FpConfig.h:104
void LogRecv_handlerBase(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Handler base-class function for input port LogRecv.
FwIndexType getNum_LogSend_OutputPorts() const