F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
19static_assert(
21 "GenericHub component requires serialization"
22);
23
24namespace 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 NATIVE_INT_TYPE instance = 0
85 );
86
87 public:
88
89 // ----------------------------------------------------------------------
90 // Getters for typed input ports
91 // ----------------------------------------------------------------------
92
97 NATIVE_INT_TYPE portNum
98 );
99
104 NATIVE_INT_TYPE portNum
105 );
106
111 NATIVE_INT_TYPE portNum
112 );
113
118 NATIVE_INT_TYPE portNum
119 );
120
121 public:
122
123 // ----------------------------------------------------------------------
124 // Getters for serial input ports
125 // ----------------------------------------------------------------------
126
130 Fw::InputSerializePort* get_portIn_InputPort(
131 NATIVE_INT_TYPE portNum
132 );
133
134 public:
135
136 // ----------------------------------------------------------------------
137 // Connect typed input ports to typed output ports
138 // ----------------------------------------------------------------------
139
142 NATIVE_INT_TYPE portNum,
143 Fw::InputLogPort* port
144 );
145
148 NATIVE_INT_TYPE portNum,
149 Fw::InputTlmPort* port
150 );
151
154 NATIVE_INT_TYPE portNum,
156 );
157
160 NATIVE_INT_TYPE portNum,
162 );
163
166 NATIVE_INT_TYPE portNum,
168 );
169
172 NATIVE_INT_TYPE portNum,
174 );
175
178 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum,
193 Fw::InputSerializePort* port
194 );
195
198 NATIVE_INT_TYPE portNum,
199 Fw::InputSerializePort* port
200 );
201
204 NATIVE_INT_TYPE portNum,
205 Fw::InputSerializePort* port
206 );
207
210 NATIVE_INT_TYPE portNum,
211 Fw::InputSerializePort* port
212 );
213
216 NATIVE_INT_TYPE portNum,
217 Fw::InputSerializePort* port
218 );
219
222 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum
358 );
359
364 NATIVE_INT_TYPE portNum
365 );
366
371 NATIVE_INT_TYPE portNum
372 );
373
378 NATIVE_INT_TYPE portNum
379 );
380
385 NATIVE_INT_TYPE portNum
386 );
387
392 NATIVE_INT_TYPE portNum
393 );
394
399 NATIVE_INT_TYPE portNum
400 );
401
402 PROTECTED:
403
404 // ----------------------------------------------------------------------
405 // Connection status queries for serial output ports
406 // ----------------------------------------------------------------------
407
412 NATIVE_INT_TYPE portNum
413 );
414
415 PROTECTED:
416
417 // ----------------------------------------------------------------------
418 // Handlers to implement for typed input ports
419 // ----------------------------------------------------------------------
420
422 virtual void LogRecv_handler(
423 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum,
433 FwChanIdType id,
434 Fw::Time& timeTag,
435 Fw::TlmBuffer& val
436 ) = 0;
437
439 virtual void buffersIn_handler(
440 NATIVE_INT_TYPE portNum,
441 Fw::Buffer& fwBuffer
442 ) = 0;
443
445 virtual void dataIn_handler(
446 NATIVE_INT_TYPE 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
460 NATIVE_INT_TYPE portNum,
461 FwEventIdType id,
462 Fw::Time& timeTag,
463 const Fw::LogSeverity& severity,
464 Fw::LogBuffer& args
465 );
466
469 NATIVE_INT_TYPE portNum,
470 FwChanIdType id,
471 Fw::Time& timeTag,
472 Fw::TlmBuffer& val
473 );
474
477 NATIVE_INT_TYPE portNum,
478 Fw::Buffer& fwBuffer
479 );
480
483 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum,
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
509 NATIVE_INT_TYPE portNum,
511 );
512
513 PROTECTED:
514
515 // ----------------------------------------------------------------------
516 // Invocation functions for typed output ports
517 // ----------------------------------------------------------------------
518
520 void LogSend_out(
521 NATIVE_INT_TYPE portNum,
522 FwEventIdType id,
523 Fw::Time& timeTag,
524 const Fw::LogSeverity& severity,
525 Fw::LogBuffer& args
526 );
527
529 void TlmSend_out(
530 NATIVE_INT_TYPE portNum,
531 FwChanIdType id,
532 Fw::Time& timeTag,
533 Fw::TlmBuffer& val
534 );
535
538 NATIVE_INT_TYPE portNum,
539 Fw::Buffer& fwBuffer
540 );
541
543 void buffersOut_out(
544 NATIVE_INT_TYPE portNum,
545 Fw::Buffer& fwBuffer
546 );
547
550 NATIVE_INT_TYPE portNum,
551 Fw::Buffer& fwBuffer
552 );
553
555 void dataOut_out(
556 NATIVE_INT_TYPE portNum,
557 Fw::Buffer& fwBuffer
558 );
559
562 NATIVE_INT_TYPE portNum,
563 U32 size
564 );
565
566 PROTECTED:
567
568 // ----------------------------------------------------------------------
569 // Invocation functions for serial output ports
570 // ----------------------------------------------------------------------
571
574 NATIVE_INT_TYPE portNum,
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 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum,
607 Fw::Buffer& fwBuffer
608 );
609
611 static void m_p_dataIn_in(
612 Fw::PassiveComponentBase* callComp,
613 NATIVE_INT_TYPE 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 NATIVE_INT_TYPE portNum,
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
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
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
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
U32 FwChanIdType
Definition FpConfig.h:59
U32 FwEventIdType
Definition FpConfig.h:62
#define FW_PORT_SERIALIZATION
Definition FpConfig.h:136
C++-compatible configuration header for fprime configuration.
Enum representing event severity.
void init()
Object initializer.
Definition ObjBase.cpp:27
Auto-generated base for GenericHub component.
void TlmRecv_handlerBase(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void dataInDeallocate_out(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Invoke output port dataInDeallocate.
void dataIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port dataIn.
NATIVE_INT_TYPE getNum_dataIn_InputPorts() const
bool isConnected_dataOut_OutputPort(NATIVE_INT_TYPE portNum)
void set_buffersOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputBufferSendPort *port)
Connect port to buffersOut[portNum].
virtual void dataIn_handler(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)=0
Handler for input port dataIn.
virtual void buffersIn_handler(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffersIn.
bool isConnected_TlmSend_OutputPort(NATIVE_INT_TYPE portNum)
void bufferDeallocate_out(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
void set_bufferDeallocate_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
NATIVE_INT_TYPE getNum_TlmSend_OutputPorts() const
NATIVE_INT_TYPE getNum_buffersIn_InputPorts() const
friend class GenericHubComponentBaseFriend
Friend class for white-box testing.
bool isConnected_dataOutAllocate_OutputPort(NATIVE_INT_TYPE portNum)
void TlmSend_out(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke output port TlmSend.
void set_LogSend_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputLogPort *port)
Connect port to LogSend[portNum].
void LogRecv_handlerBase(NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Handler base-class function for input port LogRecv.
NATIVE_INT_TYPE getNum_dataInDeallocate_OutputPorts() const
NATIVE_INT_TYPE getNum_TlmRecv_InputPorts() const
Fw::SerializeStatus portOut_out(NATIVE_INT_TYPE portNum, Fw::SerializeBufferBase &buffer)
Invoke output port portOut.
virtual void LogRecv_handler(NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
NATIVE_INT_TYPE getNum_dataOutAllocate_OutputPorts() const
bool isConnected_portOut_OutputPort(NATIVE_INT_TYPE portNum)
virtual void portIn_handler(NATIVE_INT_TYPE portNum, Fw::SerializeBufferBase &buffer)=0
Handler for input port portIn.
void buffersOut_out(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Invoke output port buffersOut.
void buffersIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffersIn.
NATIVE_INT_TYPE getNum_portOut_OutputPorts() const
void LogSend_out(NATIVE_INT_TYPE portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke output port LogSend.
void set_dataOutAllocate_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputBufferGetPort *port)
Connect port to dataOutAllocate[portNum].
Fw::InputBufferSendPort * get_dataIn_InputPort(NATIVE_INT_TYPE portNum)
bool isConnected_buffersOut_OutputPort(NATIVE_INT_TYPE portNum)
virtual ~GenericHubComponentBase()
Destroy GenericHubComponentBase object.
bool isConnected_LogSend_OutputPort(NATIVE_INT_TYPE portNum)
void portIn_handlerBase(NATIVE_INT_TYPE portNum, Fw::SerializeBufferBase &buffer)
Handler base-class function for input port portIn.
NATIVE_INT_TYPE getNum_LogRecv_InputPorts() const
Fw::InputLogPort * get_LogRecv_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_portIn_InputPorts() const
Fw::InputBufferSendPort * get_buffersIn_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_LogSend_OutputPorts() const
void dataOut_out(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
Invoke output port dataOut.
Fw::InputSerializePort * get_portIn_InputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_bufferDeallocate_OutputPorts() const
bool isConnected_bufferDeallocate_OutputPort(NATIVE_INT_TYPE portNum)
NATIVE_INT_TYPE getNum_buffersOut_OutputPorts() const
virtual void TlmRecv_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
void set_dataInDeallocate_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputBufferSendPort *port)
Connect port to dataInDeallocate[portNum].
NATIVE_INT_TYPE getNum_dataOut_OutputPorts() const
GenericHubComponentBase(const char *compName="")
Construct GenericHubComponentBase object.
void set_dataOut_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputBufferSendPort *port)
Connect port to dataOut[portNum].
Fw::Buffer dataOutAllocate_out(NATIVE_INT_TYPE portNum, U32 size)
Invoke output port dataOutAllocate.
Fw::InputTlmPort * get_TlmRecv_InputPort(NATIVE_INT_TYPE portNum)
bool isConnected_dataInDeallocate_OutputPort(NATIVE_INT_TYPE portNum)
void set_TlmSend_OutputPort(NATIVE_INT_TYPE portNum, Fw::InputTlmPort *port)
Connect port to TlmSend[portNum].
SerializeStatus
forward declaration for string