F´ Flight Software - C/C++ Documentation  devel
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 
10 #include "FpConfig.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 
40 
41  PROTECTED:
42 
43  // ----------------------------------------------------------------------
44  // Constants
45  // ----------------------------------------------------------------------
46 
48  enum {
53  };
54 
56  enum {
58  };
59 
61  enum {
69  };
70 
72  enum {
74  };
75 
76  public:
77 
78  // ----------------------------------------------------------------------
79  // Component initialization
80  // ----------------------------------------------------------------------
81 
83  void init(
84  FwEnumStoreType instance = 0
85  );
86 
87  public:
88 
89  // ----------------------------------------------------------------------
90  // Getters for typed input ports
91  // ----------------------------------------------------------------------
92 
97  FwIndexType portNum
98  );
99 
104  FwIndexType portNum
105  );
106 
111  FwIndexType portNum
112  );
113 
118  FwIndexType portNum
119  );
120 
121  public:
122 
123  // ----------------------------------------------------------------------
124  // Getters for serial input ports
125  // ----------------------------------------------------------------------
126 
130  Fw::InputSerializePort* get_portIn_InputPort(
131  FwIndexType portNum
132  );
133 
134  public:
135 
136  // ----------------------------------------------------------------------
137  // Connect typed input ports to typed output ports
138  // ----------------------------------------------------------------------
139 
142  FwIndexType portNum,
143  Fw::InputLogPort* port
144  );
145 
148  FwIndexType portNum,
149  Fw::InputTlmPort* port
150  );
151 
154  FwIndexType portNum,
156  );
157 
160  FwIndexType portNum,
162  );
163 
166  FwIndexType portNum,
168  );
169 
172  FwIndexType portNum,
174  );
175 
178  FwIndexType portNum,
180  );
181 
182 #if FW_PORT_SERIALIZATION
183 
184  public:
185 
186  // ----------------------------------------------------------------------
187  // Connect serial input ports to typed output ports
188  // ----------------------------------------------------------------------
189 
192  FwIndexType portNum,
193  Fw::InputSerializePort* port
194  );
195 
198  FwIndexType portNum,
199  Fw::InputSerializePort* port
200  );
201 
204  FwIndexType portNum,
205  Fw::InputSerializePort* port
206  );
207 
210  FwIndexType portNum,
211  Fw::InputSerializePort* port
212  );
213 
216  FwIndexType portNum,
217  Fw::InputSerializePort* port
218  );
219 
222  FwIndexType portNum,
223  Fw::InputSerializePort* port
224  );
225 
226 #endif
227 
228 #if FW_PORT_SERIALIZATION
229 
230  public:
231 
232  // ----------------------------------------------------------------------
233  // Connect serial input ports to serial output ports
234  // ----------------------------------------------------------------------
235 
237  void set_portOut_OutputPort(
238  FwIndexType portNum,
239  Fw::InputPortBase* port
240  );
241 
242 #endif
243 
244  PROTECTED:
245 
246  // ----------------------------------------------------------------------
247  // Component construction and destruction
248  // ----------------------------------------------------------------------
249 
252  const char* compName = ""
253  );
254 
256  virtual ~GenericHubComponentBase();
257 
258  PROTECTED:
259 
260  // ----------------------------------------------------------------------
261  // Getters for numbers of typed input ports
262  // ----------------------------------------------------------------------
263 
268 
273 
278 
283 
284  PROTECTED:
285 
286  // ----------------------------------------------------------------------
287  // Getters for numbers of serial input ports
288  // ----------------------------------------------------------------------
289 
294 
295  PROTECTED:
296 
297  // ----------------------------------------------------------------------
298  // Getters for numbers of typed output ports
299  // ----------------------------------------------------------------------
300 
305 
310 
315 
320 
325 
330 
335 
336  PROTECTED:
337 
338  // ----------------------------------------------------------------------
339  // Getters for numbers of serial output ports
340  // ----------------------------------------------------------------------
341 
346 
347  PROTECTED:
348 
349  // ----------------------------------------------------------------------
350  // Connection status queries for typed output ports
351  // ----------------------------------------------------------------------
352 
357  FwIndexType portNum
358  );
359 
364  FwIndexType portNum
365  );
366 
371  FwIndexType portNum
372  );
373 
378  FwIndexType portNum
379  );
380 
385  FwIndexType portNum
386  );
387 
392  FwIndexType portNum
393  );
394 
399  FwIndexType portNum
400  );
401 
402  PROTECTED:
403 
404  // ----------------------------------------------------------------------
405  // Connection status queries for serial output ports
406  // ----------------------------------------------------------------------
407 
412  FwIndexType portNum
413  );
414 
415  PROTECTED:
416 
417  // ----------------------------------------------------------------------
418  // Handlers to implement for typed input ports
419  // ----------------------------------------------------------------------
420 
422  virtual void LogRecv_handler(
423  FwIndexType portNum,
424  FwEventIdType id,
425  Fw::Time& timeTag,
426  const Fw::LogSeverity& severity,
427  Fw::LogBuffer& args
428  ) = 0;
429 
431  virtual void TlmRecv_handler(
432  FwIndexType portNum,
433  FwChanIdType id,
434  Fw::Time& timeTag,
435  Fw::TlmBuffer& val
436  ) = 0;
437 
439  virtual void buffersIn_handler(
440  FwIndexType portNum,
441  Fw::Buffer& fwBuffer
442  ) = 0;
443 
445  virtual void dataIn_handler(
446  FwIndexType portNum,
447  Fw::Buffer& fwBuffer
448  ) = 0;
449 
450  PROTECTED:
451 
452  // ----------------------------------------------------------------------
453  // Port handler base-class functions for typed input ports
454  //
455  // Call these functions directly to bypass the corresponding ports
456  // ----------------------------------------------------------------------
457 
459  void LogRecv_handlerBase(
460  FwIndexType portNum,
461  FwEventIdType id,
462  Fw::Time& timeTag,
463  const Fw::LogSeverity& severity,
464  Fw::LogBuffer& args
465  );
466 
468  void TlmRecv_handlerBase(
469  FwIndexType portNum,
470  FwChanIdType id,
471  Fw::Time& timeTag,
472  Fw::TlmBuffer& val
473  );
474 
477  FwIndexType portNum,
478  Fw::Buffer& fwBuffer
479  );
480 
482  void dataIn_handlerBase(
483  FwIndexType portNum,
484  Fw::Buffer& fwBuffer
485  );
486 
487  PROTECTED:
488 
489  // ----------------------------------------------------------------------
490  // Handlers to implement for serial input ports
491  // ----------------------------------------------------------------------
492 
494  virtual void portIn_handler(
495  FwIndexType portNum,
496  Fw::SerializeBufferBase& buffer
497  ) = 0;
498 
499  PROTECTED:
500 
501  // ----------------------------------------------------------------------
502  // Port handler base-class functions for serial input ports
503  //
504  // Call these functions directly to bypass the corresponding ports
505  // ----------------------------------------------------------------------
506 
508  void portIn_handlerBase(
509  FwIndexType portNum,
510  Fw::SerializeBufferBase& buffer
511  );
512 
513  PROTECTED:
514 
515  // ----------------------------------------------------------------------
516  // Invocation functions for typed output ports
517  // ----------------------------------------------------------------------
518 
520  void LogSend_out(
521  FwIndexType portNum,
522  FwEventIdType id,
523  Fw::Time& timeTag,
524  const Fw::LogSeverity& severity,
525  Fw::LogBuffer& args
526  );
527 
529  void TlmSend_out(
530  FwIndexType portNum,
531  FwChanIdType id,
532  Fw::Time& timeTag,
533  Fw::TlmBuffer& val
534  );
535 
538  FwIndexType portNum,
539  Fw::Buffer& fwBuffer
540  );
541 
543  void buffersOut_out(
544  FwIndexType portNum,
545  Fw::Buffer& fwBuffer
546  );
547 
550  FwIndexType portNum,
551  Fw::Buffer& fwBuffer
552  );
553 
555  void dataOut_out(
556  FwIndexType portNum,
557  Fw::Buffer& fwBuffer
558  );
559 
562  FwIndexType portNum,
563  U32 size
564  );
565 
566  PROTECTED:
567 
568  // ----------------------------------------------------------------------
569  // Invocation functions for serial output ports
570  // ----------------------------------------------------------------------
571 
574  FwIndexType portNum,
575  Fw::SerializeBufferBase& buffer
576  );
577 
578  PRIVATE:
579 
580  // ----------------------------------------------------------------------
581  // Calls for messages received on typed input ports
582  // ----------------------------------------------------------------------
583 
585  static void m_p_LogRecv_in(
586  Fw::PassiveComponentBase* callComp,
587  FwIndexType portNum,
588  FwEventIdType id,
589  Fw::Time& timeTag,
590  const Fw::LogSeverity& severity,
591  Fw::LogBuffer& args
592  );
593 
595  static void m_p_TlmRecv_in(
596  Fw::PassiveComponentBase* callComp,
597  FwIndexType portNum,
598  FwChanIdType id,
599  Fw::Time& timeTag,
600  Fw::TlmBuffer& val
601  );
602 
604  static void m_p_buffersIn_in(
605  Fw::PassiveComponentBase* callComp,
606  FwIndexType portNum,
607  Fw::Buffer& fwBuffer
608  );
609 
611  static void m_p_dataIn_in(
612  Fw::PassiveComponentBase* callComp,
613  FwIndexType portNum,
614  Fw::Buffer& fwBuffer
615  );
616 
617  PRIVATE:
618 
619  // ----------------------------------------------------------------------
620  // Calls for messages received on serial input ports
621  // ----------------------------------------------------------------------
622 
623 #if FW_PORT_SERIALIZATION
624 
626  static void m_p_portIn_in(
627  Fw::PassiveComponentBase* callComp,
628  FwIndexType portNum,
629  Fw::SerializeBufferBase& buffer
630  );
631 
632 #endif
633 
634  PRIVATE:
635 
636  // ----------------------------------------------------------------------
637  // Typed input ports
638  // ----------------------------------------------------------------------
639 
641  Fw::InputLogPort m_LogRecv_InputPort[NUM_LOGRECV_INPUT_PORTS];
642 
644  Fw::InputTlmPort m_TlmRecv_InputPort[NUM_TLMRECV_INPUT_PORTS];
645 
647  Fw::InputBufferSendPort m_buffersIn_InputPort[NUM_BUFFERSIN_INPUT_PORTS];
648 
651 
652  PRIVATE:
653 
654  // ----------------------------------------------------------------------
655  // Serial input ports
656  // ----------------------------------------------------------------------
657 
659  Fw::InputSerializePort m_portIn_InputPort[NUM_PORTIN_INPUT_PORTS];
660 
661  PRIVATE:
662 
663  // ----------------------------------------------------------------------
664  // Typed output ports
665  // ----------------------------------------------------------------------
666 
668  Fw::OutputLogPort m_LogSend_OutputPort[NUM_LOGSEND_OUTPUT_PORTS];
669 
671  Fw::OutputTlmPort m_TlmSend_OutputPort[NUM_TLMSEND_OUTPUT_PORTS];
672 
674  Fw::OutputBufferSendPort m_bufferDeallocate_OutputPort[NUM_BUFFERDEALLOCATE_OUTPUT_PORTS];
675 
677  Fw::OutputBufferSendPort m_buffersOut_OutputPort[NUM_BUFFERSOUT_OUTPUT_PORTS];
678 
680  Fw::OutputBufferSendPort m_dataInDeallocate_OutputPort[NUM_DATAINDEALLOCATE_OUTPUT_PORTS];
681 
684 
686  Fw::OutputBufferGetPort m_dataOutAllocate_OutputPort[NUM_DATAOUTALLOCATE_OUTPUT_PORTS];
687 
688  PRIVATE:
689 
690  // ----------------------------------------------------------------------
691  // Serial output ports
692  // ----------------------------------------------------------------------
693 
695  Fw::OutputSerializePort m_portOut_OutputPort[NUM_PORTOUT_OUTPUT_PORTS];
696 
697  };
698 
699 }
700 
701 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:64
U32 FwChanIdType
Definition: FpConfig.h:95
U32 FwEventIdType
Definition: FpConfig.h:103
#define FW_PORT_SERIALIZATION
for multi-note systems)
Definition: FpConfig.h:204
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
Enum representing event severity.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Definition: Time.hpp:9
Auto-generated base for GenericHub component.
bool isConnected_dataInDeallocate_OutputPort(FwIndexType portNum)
virtual void portIn_handler(FwIndexType portNum, Fw::SerializeBufferBase &buffer)=0
Handler for input port portIn.
void set_TlmSend_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to TlmSend[portNum].
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.
virtual void buffersIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffersIn.
FwIndexType getNum_LogRecv_InputPorts() const
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
FwIndexType getNum_LogSend_OutputPorts() const
FwIndexType getNum_dataOut_OutputPorts() const
FwIndexType getNum_dataIn_InputPorts() const
FwIndexType getNum_bufferDeallocate_OutputPorts() const
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
void set_dataInDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to dataInDeallocate[portNum].
Fw::InputLogPort * get_LogRecv_InputPort(FwIndexType portNum)
bool isConnected_buffersOut_OutputPort(FwIndexType portNum)
bool isConnected_portOut_OutputPort(FwIndexType portNum)
friend class GenericHubComponentBaseFriend
Friend class for white-box testing.
void set_buffersOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to buffersOut[portNum].
void set_dataOutAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to dataOutAllocate[portNum].
Fw::InputBufferSendPort * get_dataIn_InputPort(FwIndexType portNum)
FwIndexType getNum_dataOutAllocate_OutputPorts() const
Fw::InputSerializePort * get_portIn_InputPort(FwIndexType portNum)
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
bool isConnected_LogSend_OutputPort(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)
FwIndexType getNum_portOut_OutputPorts() const
FwIndexType getNum_TlmRecv_InputPorts() const
Fw::Buffer dataOutAllocate_out(FwIndexType portNum, U32 size)
Invoke output port dataOutAllocate.
void buffersOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port buffersOut.
void set_LogSend_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to LogSend[portNum].
virtual ~GenericHubComponentBase()
Destroy GenericHubComponentBase object.
FwIndexType getNum_portIn_InputPorts() const
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
void dataOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port dataOut.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
Fw::SerializeStatus portOut_out(FwIndexType portNum, Fw::SerializeBufferBase &buffer)
Invoke output port portOut.
FwIndexType getNum_buffersIn_InputPorts() const
bool isConnected_dataOutAllocate_OutputPort(FwIndexType portNum)
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port dataIn.
GenericHubComponentBase(const char *compName="")
Construct GenericHubComponentBase object.
void dataInDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port dataInDeallocate.
FwIndexType getNum_TlmSend_OutputPorts() const
bool isConnected_TlmSend_OutputPort(FwIndexType portNum)
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
virtual void LogRecv_handler(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
void LogSend_out(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke output port LogSend.
FwIndexType getNum_buffersOut_OutputPorts() const
void TlmSend_out(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke output port TlmSend.
void set_dataOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to dataOut[portNum].
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port dataIn.
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void buffersIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffersIn.
FwIndexType getNum_dataInDeallocate_OutputPorts() const
SerializeStatus
forward declaration for string