F´ Flight Software - C/C++ Documentation devel
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
GenericHubComponentAc.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title GenericHubComponentAc.cpp
3// \author Generated by fpp-to-cpp
4// \brief cpp file for GenericHub component base class
5// ======================================================================
6
7#include <cstdio>
8
10#include "Fw/Types/Assert.hpp"
11#if FW_ENABLE_TEXT_LOGGING
12#include "Fw/Types/String.hpp"
13#endif
14
15namespace Svc {
16
17 // ----------------------------------------------------------------------
18 // Component initialization
19 // ----------------------------------------------------------------------
20
21 void GenericHubComponentBase ::
22 init(NATIVE_INT_TYPE instance)
23 {
24 // Initialize base class
26
27 // Connect input port LogRecv
28 for (
29 PlatformIntType port = 0;
30 port < static_cast<PlatformIntType>(this->getNum_LogRecv_InputPorts());
31 port++
32 ) {
33 this->m_LogRecv_InputPort[port].init();
34 this->m_LogRecv_InputPort[port].addCallComp(
35 this,
36 m_p_LogRecv_in
37 );
38 this->m_LogRecv_InputPort[port].setPortNum(port);
39
40#if FW_OBJECT_NAMES == 1
41 char portName[120];
42 (void) snprintf(
43 portName,
44 sizeof(portName),
45 "%s_LogRecv_InputPort[%" PRI_PlatformIntType "]",
46 this->m_objName,
47 port
48 );
49 this->m_LogRecv_InputPort[port].setObjName(portName);
50#endif
51 }
52
53 // Connect input port TlmRecv
54 for (
55 PlatformIntType port = 0;
56 port < static_cast<PlatformIntType>(this->getNum_TlmRecv_InputPorts());
57 port++
58 ) {
59 this->m_TlmRecv_InputPort[port].init();
60 this->m_TlmRecv_InputPort[port].addCallComp(
61 this,
62 m_p_TlmRecv_in
63 );
64 this->m_TlmRecv_InputPort[port].setPortNum(port);
65
66#if FW_OBJECT_NAMES == 1
67 char portName[120];
68 (void) snprintf(
69 portName,
70 sizeof(portName),
71 "%s_TlmRecv_InputPort[%" PRI_PlatformIntType "]",
72 this->m_objName,
73 port
74 );
75 this->m_TlmRecv_InputPort[port].setObjName(portName);
76#endif
77 }
78
79 // Connect input port buffersIn
80 for (
81 PlatformIntType port = 0;
82 port < static_cast<PlatformIntType>(this->getNum_buffersIn_InputPorts());
83 port++
84 ) {
85 this->m_buffersIn_InputPort[port].init();
86 this->m_buffersIn_InputPort[port].addCallComp(
87 this,
88 m_p_buffersIn_in
89 );
90 this->m_buffersIn_InputPort[port].setPortNum(port);
91
92#if FW_OBJECT_NAMES == 1
93 char portName[120];
94 (void) snprintf(
95 portName,
96 sizeof(portName),
97 "%s_buffersIn_InputPort[%" PRI_PlatformIntType "]",
98 this->m_objName,
99 port
100 );
101 this->m_buffersIn_InputPort[port].setObjName(portName);
102#endif
103 }
104
105 // Connect input port dataIn
106 for (
107 PlatformIntType port = 0;
108 port < static_cast<PlatformIntType>(this->getNum_dataIn_InputPorts());
109 port++
110 ) {
111 this->m_dataIn_InputPort[port].init();
112 this->m_dataIn_InputPort[port].addCallComp(
113 this,
114 m_p_dataIn_in
115 );
116 this->m_dataIn_InputPort[port].setPortNum(port);
117
118#if FW_OBJECT_NAMES == 1
119 char portName[120];
120 (void) snprintf(
121 portName,
122 sizeof(portName),
123 "%s_dataIn_InputPort[%" PRI_PlatformIntType "]",
124 this->m_objName,
125 port
126 );
127 this->m_dataIn_InputPort[port].setObjName(portName);
128#endif
129 }
130
131 // Connect input port portIn
132 for (
133 PlatformIntType port = 0;
134 port < static_cast<PlatformIntType>(this->getNum_portIn_InputPorts());
135 port++
136 ) {
137 this->m_portIn_InputPort[port].init();
138 this->m_portIn_InputPort[port].addCallComp(
139 this,
140 m_p_portIn_in
141 );
142 this->m_portIn_InputPort[port].setPortNum(port);
143
144#if FW_OBJECT_NAMES == 1
145 char portName[120];
146 (void) snprintf(
147 portName,
148 sizeof(portName),
149 "%s_portIn_InputPort[%" PRI_PlatformIntType "]",
150 this->m_objName,
151 port
152 );
153 this->m_portIn_InputPort[port].setObjName(portName);
154#endif
155 }
156
157 // Connect output port LogSend
158 for (
159 PlatformIntType port = 0;
160 port < static_cast<PlatformIntType>(this->getNum_LogSend_OutputPorts());
161 port++
162 ) {
163 this->m_LogSend_OutputPort[port].init();
164
165#if FW_OBJECT_NAMES == 1
166 char portName[120];
167 (void) snprintf(
168 portName,
169 sizeof(portName),
170 "%s_LogSend_OutputPort[%" PRI_PlatformIntType "]",
171 this->m_objName,
172 port
173 );
174 this->m_LogSend_OutputPort[port].setObjName(portName);
175#endif
176 }
177
178 // Connect output port TlmSend
179 for (
180 PlatformIntType port = 0;
181 port < static_cast<PlatformIntType>(this->getNum_TlmSend_OutputPorts());
182 port++
183 ) {
184 this->m_TlmSend_OutputPort[port].init();
185
186#if FW_OBJECT_NAMES == 1
187 char portName[120];
188 (void) snprintf(
189 portName,
190 sizeof(portName),
191 "%s_TlmSend_OutputPort[%" PRI_PlatformIntType "]",
192 this->m_objName,
193 port
194 );
195 this->m_TlmSend_OutputPort[port].setObjName(portName);
196#endif
197 }
198
199 // Connect output port bufferDeallocate
200 for (
201 PlatformIntType port = 0;
202 port < static_cast<PlatformIntType>(this->getNum_bufferDeallocate_OutputPorts());
203 port++
204 ) {
205 this->m_bufferDeallocate_OutputPort[port].init();
206
207#if FW_OBJECT_NAMES == 1
208 char portName[120];
209 (void) snprintf(
210 portName,
211 sizeof(portName),
212 "%s_bufferDeallocate_OutputPort[%" PRI_PlatformIntType "]",
213 this->m_objName,
214 port
215 );
216 this->m_bufferDeallocate_OutputPort[port].setObjName(portName);
217#endif
218 }
219
220 // Connect output port buffersOut
221 for (
222 PlatformIntType port = 0;
223 port < static_cast<PlatformIntType>(this->getNum_buffersOut_OutputPorts());
224 port++
225 ) {
226 this->m_buffersOut_OutputPort[port].init();
227
228#if FW_OBJECT_NAMES == 1
229 char portName[120];
230 (void) snprintf(
231 portName,
232 sizeof(portName),
233 "%s_buffersOut_OutputPort[%" PRI_PlatformIntType "]",
234 this->m_objName,
235 port
236 );
237 this->m_buffersOut_OutputPort[port].setObjName(portName);
238#endif
239 }
240
241 // Connect output port dataInDeallocate
242 for (
243 PlatformIntType port = 0;
244 port < static_cast<PlatformIntType>(this->getNum_dataInDeallocate_OutputPorts());
245 port++
246 ) {
247 this->m_dataInDeallocate_OutputPort[port].init();
248
249#if FW_OBJECT_NAMES == 1
250 char portName[120];
251 (void) snprintf(
252 portName,
253 sizeof(portName),
254 "%s_dataInDeallocate_OutputPort[%" PRI_PlatformIntType "]",
255 this->m_objName,
256 port
257 );
258 this->m_dataInDeallocate_OutputPort[port].setObjName(portName);
259#endif
260 }
261
262 // Connect output port dataOut
263 for (
264 PlatformIntType port = 0;
265 port < static_cast<PlatformIntType>(this->getNum_dataOut_OutputPorts());
266 port++
267 ) {
268 this->m_dataOut_OutputPort[port].init();
269
270#if FW_OBJECT_NAMES == 1
271 char portName[120];
272 (void) snprintf(
273 portName,
274 sizeof(portName),
275 "%s_dataOut_OutputPort[%" PRI_PlatformIntType "]",
276 this->m_objName,
277 port
278 );
279 this->m_dataOut_OutputPort[port].setObjName(portName);
280#endif
281 }
282
283 // Connect output port dataOutAllocate
284 for (
285 PlatformIntType port = 0;
286 port < static_cast<PlatformIntType>(this->getNum_dataOutAllocate_OutputPorts());
287 port++
288 ) {
289 this->m_dataOutAllocate_OutputPort[port].init();
290
291#if FW_OBJECT_NAMES == 1
292 char portName[120];
293 (void) snprintf(
294 portName,
295 sizeof(portName),
296 "%s_dataOutAllocate_OutputPort[%" PRI_PlatformIntType "]",
297 this->m_objName,
298 port
299 );
300 this->m_dataOutAllocate_OutputPort[port].setObjName(portName);
301#endif
302 }
303
304 // Connect output port portOut
305 for (
306 PlatformIntType port = 0;
307 port < static_cast<PlatformIntType>(this->getNum_portOut_OutputPorts());
308 port++
309 ) {
310 this->m_portOut_OutputPort[port].init();
311
312#if FW_OBJECT_NAMES == 1
313 char portName[120];
314 (void) snprintf(
315 portName,
316 sizeof(portName),
317 "%s_portOut_OutputPort[%" PRI_PlatformIntType "]",
318 this->m_objName,
319 port
320 );
321 this->m_portOut_OutputPort[port].setObjName(portName);
322#endif
323 }
324 }
325
326 // ----------------------------------------------------------------------
327 // Getters for typed input ports
328 // ----------------------------------------------------------------------
329
330 Fw::InputLogPort* GenericHubComponentBase ::
331 get_LogRecv_InputPort(NATIVE_INT_TYPE portNum)
332 {
333 FW_ASSERT(
334 portNum < this->getNum_LogRecv_InputPorts(),
335 static_cast<FwAssertArgType>(portNum)
336 );
337
338 return &this->m_LogRecv_InputPort[portNum];
339 }
340
341 Fw::InputTlmPort* GenericHubComponentBase ::
342 get_TlmRecv_InputPort(NATIVE_INT_TYPE portNum)
343 {
344 FW_ASSERT(
345 portNum < this->getNum_TlmRecv_InputPorts(),
346 static_cast<FwAssertArgType>(portNum)
347 );
348
349 return &this->m_TlmRecv_InputPort[portNum];
350 }
351
352 Fw::InputBufferSendPort* GenericHubComponentBase ::
353 get_buffersIn_InputPort(NATIVE_INT_TYPE portNum)
354 {
355 FW_ASSERT(
356 portNum < this->getNum_buffersIn_InputPorts(),
357 static_cast<FwAssertArgType>(portNum)
358 );
359
360 return &this->m_buffersIn_InputPort[portNum];
361 }
362
363 Fw::InputBufferSendPort* GenericHubComponentBase ::
364 get_dataIn_InputPort(NATIVE_INT_TYPE portNum)
365 {
366 FW_ASSERT(
367 portNum < this->getNum_dataIn_InputPorts(),
368 static_cast<FwAssertArgType>(portNum)
369 );
370
371 return &this->m_dataIn_InputPort[portNum];
372 }
373
374 // ----------------------------------------------------------------------
375 // Getters for serial input ports
376 // ----------------------------------------------------------------------
377
378 Fw::InputSerializePort* GenericHubComponentBase ::
379 get_portIn_InputPort(NATIVE_INT_TYPE portNum)
380 {
381 FW_ASSERT(
382 portNum < this->getNum_portIn_InputPorts(),
383 static_cast<FwAssertArgType>(portNum)
384 );
385
386 return &this->m_portIn_InputPort[portNum];
387 }
388
389 // ----------------------------------------------------------------------
390 // Connect typed input ports to typed output ports
391 // ----------------------------------------------------------------------
392
393 void GenericHubComponentBase ::
394 set_LogSend_OutputPort(
395 NATIVE_INT_TYPE portNum,
396 Fw::InputLogPort* port
397 )
398 {
399 FW_ASSERT(
400 portNum < this->getNum_LogSend_OutputPorts(),
401 static_cast<FwAssertArgType>(portNum)
402 );
403
404 this->m_LogSend_OutputPort[portNum].addCallPort(port);
405 }
406
407 void GenericHubComponentBase ::
408 set_TlmSend_OutputPort(
409 NATIVE_INT_TYPE portNum,
410 Fw::InputTlmPort* port
411 )
412 {
413 FW_ASSERT(
414 portNum < this->getNum_TlmSend_OutputPorts(),
415 static_cast<FwAssertArgType>(portNum)
416 );
417
418 this->m_TlmSend_OutputPort[portNum].addCallPort(port);
419 }
420
421 void GenericHubComponentBase ::
422 set_bufferDeallocate_OutputPort(
423 NATIVE_INT_TYPE portNum,
425 )
426 {
427 FW_ASSERT(
428 portNum < this->getNum_bufferDeallocate_OutputPorts(),
429 static_cast<FwAssertArgType>(portNum)
430 );
431
432 this->m_bufferDeallocate_OutputPort[portNum].addCallPort(port);
433 }
434
435 void GenericHubComponentBase ::
436 set_buffersOut_OutputPort(
437 NATIVE_INT_TYPE portNum,
439 )
440 {
441 FW_ASSERT(
442 portNum < this->getNum_buffersOut_OutputPorts(),
443 static_cast<FwAssertArgType>(portNum)
444 );
445
446 this->m_buffersOut_OutputPort[portNum].addCallPort(port);
447 }
448
449 void GenericHubComponentBase ::
450 set_dataInDeallocate_OutputPort(
451 NATIVE_INT_TYPE portNum,
453 )
454 {
455 FW_ASSERT(
456 portNum < this->getNum_dataInDeallocate_OutputPorts(),
457 static_cast<FwAssertArgType>(portNum)
458 );
459
460 this->m_dataInDeallocate_OutputPort[portNum].addCallPort(port);
461 }
462
463 void GenericHubComponentBase ::
464 set_dataOut_OutputPort(
465 NATIVE_INT_TYPE portNum,
467 )
468 {
469 FW_ASSERT(
470 portNum < this->getNum_dataOut_OutputPorts(),
471 static_cast<FwAssertArgType>(portNum)
472 );
473
474 this->m_dataOut_OutputPort[portNum].addCallPort(port);
475 }
476
477 void GenericHubComponentBase ::
478 set_dataOutAllocate_OutputPort(
479 NATIVE_INT_TYPE portNum,
481 )
482 {
483 FW_ASSERT(
484 portNum < this->getNum_dataOutAllocate_OutputPorts(),
485 static_cast<FwAssertArgType>(portNum)
486 );
487
488 this->m_dataOutAllocate_OutputPort[portNum].addCallPort(port);
489 }
490
491#if FW_PORT_SERIALIZATION
492
493 // ----------------------------------------------------------------------
494 // Connect serial input ports to typed output ports
495 // ----------------------------------------------------------------------
496
497 void GenericHubComponentBase ::
498 set_LogSend_OutputPort(
499 NATIVE_INT_TYPE portNum,
500 Fw::InputSerializePort* port
501 )
502 {
503 FW_ASSERT(
504 portNum < this->getNum_LogSend_OutputPorts(),
505 static_cast<FwAssertArgType>(portNum)
506 );
507
508 this->m_LogSend_OutputPort[portNum].registerSerialPort(port);
509 }
510
511 void GenericHubComponentBase ::
512 set_TlmSend_OutputPort(
513 NATIVE_INT_TYPE portNum,
514 Fw::InputSerializePort* port
515 )
516 {
517 FW_ASSERT(
518 portNum < this->getNum_TlmSend_OutputPorts(),
519 static_cast<FwAssertArgType>(portNum)
520 );
521
522 this->m_TlmSend_OutputPort[portNum].registerSerialPort(port);
523 }
524
525 void GenericHubComponentBase ::
526 set_bufferDeallocate_OutputPort(
527 NATIVE_INT_TYPE portNum,
528 Fw::InputSerializePort* port
529 )
530 {
531 FW_ASSERT(
532 portNum < this->getNum_bufferDeallocate_OutputPorts(),
533 static_cast<FwAssertArgType>(portNum)
534 );
535
536 this->m_bufferDeallocate_OutputPort[portNum].registerSerialPort(port);
537 }
538
539 void GenericHubComponentBase ::
540 set_buffersOut_OutputPort(
541 NATIVE_INT_TYPE portNum,
542 Fw::InputSerializePort* port
543 )
544 {
545 FW_ASSERT(
546 portNum < this->getNum_buffersOut_OutputPorts(),
547 static_cast<FwAssertArgType>(portNum)
548 );
549
550 this->m_buffersOut_OutputPort[portNum].registerSerialPort(port);
551 }
552
553 void GenericHubComponentBase ::
554 set_dataInDeallocate_OutputPort(
555 NATIVE_INT_TYPE portNum,
556 Fw::InputSerializePort* port
557 )
558 {
559 FW_ASSERT(
560 portNum < this->getNum_dataInDeallocate_OutputPorts(),
561 static_cast<FwAssertArgType>(portNum)
562 );
563
564 this->m_dataInDeallocate_OutputPort[portNum].registerSerialPort(port);
565 }
566
567 void GenericHubComponentBase ::
568 set_dataOut_OutputPort(
569 NATIVE_INT_TYPE portNum,
570 Fw::InputSerializePort* port
571 )
572 {
573 FW_ASSERT(
574 portNum < this->getNum_dataOut_OutputPorts(),
575 static_cast<FwAssertArgType>(portNum)
576 );
577
578 this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
579 }
580
581#endif
582
583#if FW_PORT_SERIALIZATION
584
585 // ----------------------------------------------------------------------
586 // Connect serial input ports to serial output ports
587 // ----------------------------------------------------------------------
588
589 void GenericHubComponentBase ::
590 set_portOut_OutputPort(
591 NATIVE_INT_TYPE portNum,
593 )
594 {
595 FW_ASSERT(
596 portNum < this->getNum_portOut_OutputPorts(),
597 static_cast<FwAssertArgType>(portNum)
598 );
599
600 this->m_portOut_OutputPort[portNum].registerSerialPort(port);
601 }
602
603#endif
604
605 // ----------------------------------------------------------------------
606 // Component construction and destruction
607 // ----------------------------------------------------------------------
608
609 GenericHubComponentBase ::
610 GenericHubComponentBase(const char* compName) :
611 Fw::PassiveComponentBase(compName)
612 {
613
614 }
615
616 GenericHubComponentBase ::
617 ~GenericHubComponentBase()
618 {
619
620 }
621
622 // ----------------------------------------------------------------------
623 // Getters for numbers of typed input ports
624 // ----------------------------------------------------------------------
625
626 NATIVE_INT_TYPE GenericHubComponentBase ::
627 getNum_LogRecv_InputPorts() const
628 {
629 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_LogRecv_InputPort));
630 }
631
632 NATIVE_INT_TYPE GenericHubComponentBase ::
633 getNum_TlmRecv_InputPorts() const
634 {
635 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_TlmRecv_InputPort));
636 }
637
638 NATIVE_INT_TYPE GenericHubComponentBase ::
639 getNum_buffersIn_InputPorts() const
640 {
641 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_buffersIn_InputPort));
642 }
643
644 NATIVE_INT_TYPE GenericHubComponentBase ::
645 getNum_dataIn_InputPorts() const
646 {
647 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_dataIn_InputPort));
648 }
649
650 // ----------------------------------------------------------------------
651 // Getters for numbers of serial input ports
652 // ----------------------------------------------------------------------
653
654 NATIVE_INT_TYPE GenericHubComponentBase ::
655 getNum_portIn_InputPorts() const
656 {
657 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_portIn_InputPort));
658 }
659
660 // ----------------------------------------------------------------------
661 // Getters for numbers of typed output ports
662 // ----------------------------------------------------------------------
663
664 NATIVE_INT_TYPE GenericHubComponentBase ::
665 getNum_LogSend_OutputPorts() const
666 {
667 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_LogSend_OutputPort));
668 }
669
670 NATIVE_INT_TYPE GenericHubComponentBase ::
671 getNum_TlmSend_OutputPorts() const
672 {
673 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_TlmSend_OutputPort));
674 }
675
676 NATIVE_INT_TYPE GenericHubComponentBase ::
677 getNum_bufferDeallocate_OutputPorts() const
678 {
679 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferDeallocate_OutputPort));
680 }
681
682 NATIVE_INT_TYPE GenericHubComponentBase ::
683 getNum_buffersOut_OutputPorts() const
684 {
685 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_buffersOut_OutputPort));
686 }
687
688 NATIVE_INT_TYPE GenericHubComponentBase ::
689 getNum_dataInDeallocate_OutputPorts() const
690 {
691 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_dataInDeallocate_OutputPort));
692 }
693
694 NATIVE_INT_TYPE GenericHubComponentBase ::
695 getNum_dataOut_OutputPorts() const
696 {
697 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_dataOut_OutputPort));
698 }
699
700 NATIVE_INT_TYPE GenericHubComponentBase ::
701 getNum_dataOutAllocate_OutputPorts() const
702 {
703 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_dataOutAllocate_OutputPort));
704 }
705
706 // ----------------------------------------------------------------------
707 // Getters for numbers of serial output ports
708 // ----------------------------------------------------------------------
709
710 NATIVE_INT_TYPE GenericHubComponentBase ::
711 getNum_portOut_OutputPorts() const
712 {
713 return static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_portOut_OutputPort));
714 }
715
716 // ----------------------------------------------------------------------
717 // Connection status queries for typed output ports
718 // ----------------------------------------------------------------------
719
720 bool GenericHubComponentBase ::
721 isConnected_LogSend_OutputPort(NATIVE_INT_TYPE portNum)
722 {
723 FW_ASSERT(
724 portNum < this->getNum_LogSend_OutputPorts(),
725 static_cast<FwAssertArgType>(portNum)
726 );
727
728 return this->m_LogSend_OutputPort[portNum].isConnected();
729 }
730
731 bool GenericHubComponentBase ::
732 isConnected_TlmSend_OutputPort(NATIVE_INT_TYPE portNum)
733 {
734 FW_ASSERT(
735 portNum < this->getNum_TlmSend_OutputPorts(),
736 static_cast<FwAssertArgType>(portNum)
737 );
738
739 return this->m_TlmSend_OutputPort[portNum].isConnected();
740 }
741
742 bool GenericHubComponentBase ::
743 isConnected_bufferDeallocate_OutputPort(NATIVE_INT_TYPE portNum)
744 {
745 FW_ASSERT(
746 portNum < this->getNum_bufferDeallocate_OutputPorts(),
747 static_cast<FwAssertArgType>(portNum)
748 );
749
750 return this->m_bufferDeallocate_OutputPort[portNum].isConnected();
751 }
752
753 bool GenericHubComponentBase ::
754 isConnected_buffersOut_OutputPort(NATIVE_INT_TYPE portNum)
755 {
756 FW_ASSERT(
757 portNum < this->getNum_buffersOut_OutputPorts(),
758 static_cast<FwAssertArgType>(portNum)
759 );
760
761 return this->m_buffersOut_OutputPort[portNum].isConnected();
762 }
763
764 bool GenericHubComponentBase ::
765 isConnected_dataInDeallocate_OutputPort(NATIVE_INT_TYPE portNum)
766 {
767 FW_ASSERT(
768 portNum < this->getNum_dataInDeallocate_OutputPorts(),
769 static_cast<FwAssertArgType>(portNum)
770 );
771
772 return this->m_dataInDeallocate_OutputPort[portNum].isConnected();
773 }
774
775 bool GenericHubComponentBase ::
776 isConnected_dataOut_OutputPort(NATIVE_INT_TYPE portNum)
777 {
778 FW_ASSERT(
779 portNum < this->getNum_dataOut_OutputPorts(),
780 static_cast<FwAssertArgType>(portNum)
781 );
782
783 return this->m_dataOut_OutputPort[portNum].isConnected();
784 }
785
786 bool GenericHubComponentBase ::
787 isConnected_dataOutAllocate_OutputPort(NATIVE_INT_TYPE portNum)
788 {
789 FW_ASSERT(
790 portNum < this->getNum_dataOutAllocate_OutputPorts(),
791 static_cast<FwAssertArgType>(portNum)
792 );
793
794 return this->m_dataOutAllocate_OutputPort[portNum].isConnected();
795 }
796
797 // ----------------------------------------------------------------------
798 // Connection status queries for serial output ports
799 // ----------------------------------------------------------------------
800
801 bool GenericHubComponentBase ::
802 isConnected_portOut_OutputPort(NATIVE_INT_TYPE portNum)
803 {
804 FW_ASSERT(
805 portNum < this->getNum_portOut_OutputPorts(),
806 static_cast<FwAssertArgType>(portNum)
807 );
808
809 return this->m_portOut_OutputPort[portNum].isConnected();
810 }
811
812 // ----------------------------------------------------------------------
813 // Port handler base-class functions for typed input ports
814 //
815 // Call these functions directly to bypass the corresponding ports
816 // ----------------------------------------------------------------------
817
818 void GenericHubComponentBase ::
819 LogRecv_handlerBase(
820 NATIVE_INT_TYPE portNum,
821 FwEventIdType id,
822 Fw::Time& timeTag,
823 const Fw::LogSeverity& severity,
824 Fw::LogBuffer& args
825 )
826 {
827 // Make sure port number is valid
828 FW_ASSERT(
829 portNum < this->getNum_LogRecv_InputPorts(),
830 static_cast<FwAssertArgType>(portNum)
831 );
832
833 // Down call to pure virtual handler method implemented in Impl class
834 this->LogRecv_handler(
835 portNum,
836 id,
837 timeTag,
838 severity,
839 args
840 );
841 }
842
843 void GenericHubComponentBase ::
844 TlmRecv_handlerBase(
845 NATIVE_INT_TYPE portNum,
846 FwChanIdType id,
847 Fw::Time& timeTag,
848 Fw::TlmBuffer& val
849 )
850 {
851 // Make sure port number is valid
852 FW_ASSERT(
853 portNum < this->getNum_TlmRecv_InputPorts(),
854 static_cast<FwAssertArgType>(portNum)
855 );
856
857 // Down call to pure virtual handler method implemented in Impl class
858 this->TlmRecv_handler(
859 portNum,
860 id,
861 timeTag,
862 val
863 );
864 }
865
866 void GenericHubComponentBase ::
867 buffersIn_handlerBase(
868 NATIVE_INT_TYPE portNum,
869 Fw::Buffer& fwBuffer
870 )
871 {
872 // Make sure port number is valid
873 FW_ASSERT(
874 portNum < this->getNum_buffersIn_InputPorts(),
875 static_cast<FwAssertArgType>(portNum)
876 );
877
878 // Down call to pure virtual handler method implemented in Impl class
879 this->buffersIn_handler(
880 portNum,
881 fwBuffer
882 );
883 }
884
885 void GenericHubComponentBase ::
886 dataIn_handlerBase(
887 NATIVE_INT_TYPE portNum,
888 Fw::Buffer& fwBuffer
889 )
890 {
891 // Make sure port number is valid
892 FW_ASSERT(
893 portNum < this->getNum_dataIn_InputPorts(),
894 static_cast<FwAssertArgType>(portNum)
895 );
896
897 // Down call to pure virtual handler method implemented in Impl class
898 this->dataIn_handler(
899 portNum,
900 fwBuffer
901 );
902 }
903
904 // ----------------------------------------------------------------------
905 // Port handler base-class functions for serial input ports
906 //
907 // Call these functions directly to bypass the corresponding ports
908 // ----------------------------------------------------------------------
909
910 void GenericHubComponentBase ::
911 portIn_handlerBase(
912 NATIVE_INT_TYPE portNum,
914 )
915 {
916 // Make sure port number is valid
917 FW_ASSERT(
918 portNum < this->getNum_portIn_InputPorts(),
919 static_cast<FwAssertArgType>(portNum)
920 );
921
922 // Down call to pure virtual handler method implemented in Impl class
923 this->portIn_handler(
924 portNum,
925 buffer
926 );
927 }
928
929 // ----------------------------------------------------------------------
930 // Invocation functions for typed output ports
931 // ----------------------------------------------------------------------
932
933 void GenericHubComponentBase ::
934 LogSend_out(
935 NATIVE_INT_TYPE portNum,
936 FwEventIdType id,
937 Fw::Time& timeTag,
938 const Fw::LogSeverity& severity,
939 Fw::LogBuffer& args
940 )
941 {
942 FW_ASSERT(
943 portNum < this->getNum_LogSend_OutputPorts(),
944 static_cast<FwAssertArgType>(portNum)
945 );
946 this->m_LogSend_OutputPort[portNum].invoke(
947 id,
948 timeTag,
949 severity,
950 args
951 );
952 }
953
954 void GenericHubComponentBase ::
955 TlmSend_out(
956 NATIVE_INT_TYPE portNum,
957 FwChanIdType id,
958 Fw::Time& timeTag,
959 Fw::TlmBuffer& val
960 )
961 {
962 FW_ASSERT(
963 portNum < this->getNum_TlmSend_OutputPorts(),
964 static_cast<FwAssertArgType>(portNum)
965 );
966 this->m_TlmSend_OutputPort[portNum].invoke(
967 id,
968 timeTag,
969 val
970 );
971 }
972
973 void GenericHubComponentBase ::
974 bufferDeallocate_out(
975 NATIVE_INT_TYPE portNum,
976 Fw::Buffer& fwBuffer
977 )
978 {
979 FW_ASSERT(
980 portNum < this->getNum_bufferDeallocate_OutputPorts(),
981 static_cast<FwAssertArgType>(portNum)
982 );
983 this->m_bufferDeallocate_OutputPort[portNum].invoke(
984 fwBuffer
985 );
986 }
987
988 void GenericHubComponentBase ::
989 buffersOut_out(
990 NATIVE_INT_TYPE portNum,
991 Fw::Buffer& fwBuffer
992 )
993 {
994 FW_ASSERT(
995 portNum < this->getNum_buffersOut_OutputPorts(),
996 static_cast<FwAssertArgType>(portNum)
997 );
998 this->m_buffersOut_OutputPort[portNum].invoke(
999 fwBuffer
1000 );
1001 }
1002
1003 void GenericHubComponentBase ::
1004 dataInDeallocate_out(
1005 NATIVE_INT_TYPE portNum,
1006 Fw::Buffer& fwBuffer
1007 )
1008 {
1009 FW_ASSERT(
1010 portNum < this->getNum_dataInDeallocate_OutputPorts(),
1011 static_cast<FwAssertArgType>(portNum)
1012 );
1013 this->m_dataInDeallocate_OutputPort[portNum].invoke(
1014 fwBuffer
1015 );
1016 }
1017
1018 void GenericHubComponentBase ::
1019 dataOut_out(
1020 NATIVE_INT_TYPE portNum,
1021 Fw::Buffer& fwBuffer
1022 )
1023 {
1024 FW_ASSERT(
1025 portNum < this->getNum_dataOut_OutputPorts(),
1026 static_cast<FwAssertArgType>(portNum)
1027 );
1028 this->m_dataOut_OutputPort[portNum].invoke(
1029 fwBuffer
1030 );
1031 }
1032
1033 Fw::Buffer GenericHubComponentBase ::
1034 dataOutAllocate_out(
1035 NATIVE_INT_TYPE portNum,
1036 U32 size
1037 )
1038 {
1039 FW_ASSERT(
1040 portNum < this->getNum_dataOutAllocate_OutputPorts(),
1041 static_cast<FwAssertArgType>(portNum)
1042 );
1043 return this->m_dataOutAllocate_OutputPort[portNum].invoke(
1044 size
1045 );
1046 }
1047
1048 // ----------------------------------------------------------------------
1049 // Invocation functions for serial output ports
1050 // ----------------------------------------------------------------------
1051
1052 Fw::SerializeStatus GenericHubComponentBase ::
1053 portOut_out(
1054 NATIVE_INT_TYPE portNum,
1056 )
1057 {
1058 FW_ASSERT(
1059 portNum < this->getNum_portOut_OutputPorts(),
1060 static_cast<FwAssertArgType>(portNum)
1061 );
1062 return this->m_portOut_OutputPort[portNum].invokeSerial(
1063 buffer
1064 );
1065 }
1066
1067 // ----------------------------------------------------------------------
1068 // Calls for messages received on typed input ports
1069 // ----------------------------------------------------------------------
1070
1071 void GenericHubComponentBase ::
1072 m_p_LogRecv_in(
1073 Fw::PassiveComponentBase* callComp,
1074 NATIVE_INT_TYPE portNum,
1075 FwEventIdType id,
1076 Fw::Time& timeTag,
1077 const Fw::LogSeverity& severity,
1078 Fw::LogBuffer& args
1079 )
1080 {
1081 FW_ASSERT(callComp);
1082 GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1083 compPtr->LogRecv_handlerBase(
1084 portNum,
1085 id,
1086 timeTag,
1087 severity,
1088 args
1089 );
1090 }
1091
1092 void GenericHubComponentBase ::
1093 m_p_TlmRecv_in(
1094 Fw::PassiveComponentBase* callComp,
1095 NATIVE_INT_TYPE portNum,
1096 FwChanIdType id,
1097 Fw::Time& timeTag,
1098 Fw::TlmBuffer& val
1099 )
1100 {
1101 FW_ASSERT(callComp);
1102 GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1103 compPtr->TlmRecv_handlerBase(
1104 portNum,
1105 id,
1106 timeTag,
1107 val
1108 );
1109 }
1110
1111 void GenericHubComponentBase ::
1112 m_p_buffersIn_in(
1113 Fw::PassiveComponentBase* callComp,
1114 NATIVE_INT_TYPE portNum,
1115 Fw::Buffer& fwBuffer
1116 )
1117 {
1118 FW_ASSERT(callComp);
1119 GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1120 compPtr->buffersIn_handlerBase(
1121 portNum,
1122 fwBuffer
1123 );
1124 }
1125
1126 void GenericHubComponentBase ::
1127 m_p_dataIn_in(
1128 Fw::PassiveComponentBase* callComp,
1129 NATIVE_INT_TYPE portNum,
1130 Fw::Buffer& fwBuffer
1131 )
1132 {
1133 FW_ASSERT(callComp);
1134 GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1135 compPtr->dataIn_handlerBase(
1136 portNum,
1137 fwBuffer
1138 );
1139 }
1140
1141 // ----------------------------------------------------------------------
1142 // Calls for messages received on serial input ports
1143 // ----------------------------------------------------------------------
1144
1145#if FW_PORT_SERIALIZATION
1146
1147 void GenericHubComponentBase ::
1148 m_p_portIn_in(
1149 Fw::PassiveComponentBase* callComp,
1150 NATIVE_INT_TYPE portNum,
1152 )
1153 {
1154 FW_ASSERT(callComp);
1155 GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1156 compPtr->portIn_handlerBase(
1157 portNum,
1158 buffer
1159 );
1160 }
1161
1162#endif
1163
1164}
#define FW_ASSERT(...)
Definition Assert.hpp:7
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition BasicTypes.h:66
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define PRI_PlatformIntType
PlatformAssertArgType FwAssertArgType
Definition FpConfig.h:21
U32 FwChanIdType
Definition FpConfig.h:59
U32 FwEventIdType
Definition FpConfig.h:62
Input BufferGet port.
Input BufferSend port.
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 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.
SerializeStatus
forward declaration for string