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