F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
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 
14 namespace Svc {
15 
16  // ----------------------------------------------------------------------
17  // Component initialization
18  // ----------------------------------------------------------------------
19 
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 
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 
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 
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 
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 ::
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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,
565  Fw::InputPortBase* port
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 
583  GenericHubComponentBase(const char* compName) :
584  Fw::PassiveComponentBase(compName)
585  {
586 
587  }
588 
591  {
592 
593  }
594 
595  // ----------------------------------------------------------------------
596  // Getters for numbers of typed input ports
597  // ----------------------------------------------------------------------
598 
601  {
602  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogRecv_InputPort));
603  }
604 
607  {
608  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_TlmRecv_InputPort));
609  }
610 
613  {
614  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_buffersIn_InputPort));
615  }
616 
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 
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 
639  {
640  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_LogSend_OutputPort));
641  }
642 
645  {
646  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_TlmSend_OutputPort));
647  }
648 
651  {
652  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_bufferDeallocate_OutputPort));
653  }
654 
657  {
658  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_buffersOut_OutputPort));
659  }
660 
663  {
664  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataInDeallocate_OutputPort));
665  }
666 
669  {
670  return static_cast<FwIndexType>(FW_NUM_ARRAY_ELEMENTS(this->m_dataOut_OutputPort));
671  }
672 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
920  FW_ASSERT(
921  this->m_LogSend_OutputPort[portNum].isConnected(),
922  static_cast<FwAssertArgType>(portNum)
923  );
924  this->m_LogSend_OutputPort[portNum].invoke(
925  id,
926  timeTag,
927  severity,
928  args
929  );
930  }
931 
934  FwIndexType portNum,
935  FwChanIdType id,
936  Fw::Time& timeTag,
937  Fw::TlmBuffer& val
938  )
939  {
940  FW_ASSERT(
941  portNum < this->getNum_TlmSend_OutputPorts(),
942  static_cast<FwAssertArgType>(portNum)
943  );
944 
945  FW_ASSERT(
946  this->m_TlmSend_OutputPort[portNum].isConnected(),
947  static_cast<FwAssertArgType>(portNum)
948  );
949  this->m_TlmSend_OutputPort[portNum].invoke(
950  id,
951  timeTag,
952  val
953  );
954  }
955 
958  FwIndexType portNum,
959  Fw::Buffer& fwBuffer
960  )
961  {
962  FW_ASSERT(
963  portNum < this->getNum_bufferDeallocate_OutputPorts(),
964  static_cast<FwAssertArgType>(portNum)
965  );
966 
967  FW_ASSERT(
968  this->m_bufferDeallocate_OutputPort[portNum].isConnected(),
969  static_cast<FwAssertArgType>(portNum)
970  );
971  this->m_bufferDeallocate_OutputPort[portNum].invoke(
972  fwBuffer
973  );
974  }
975 
978  FwIndexType portNum,
979  Fw::Buffer& fwBuffer
980  )
981  {
982  FW_ASSERT(
983  portNum < this->getNum_buffersOut_OutputPorts(),
984  static_cast<FwAssertArgType>(portNum)
985  );
986 
987  FW_ASSERT(
988  this->m_buffersOut_OutputPort[portNum].isConnected(),
989  static_cast<FwAssertArgType>(portNum)
990  );
991  this->m_buffersOut_OutputPort[portNum].invoke(
992  fwBuffer
993  );
994  }
995 
998  FwIndexType portNum,
999  Fw::Buffer& fwBuffer
1000  )
1001  {
1002  FW_ASSERT(
1003  portNum < this->getNum_dataInDeallocate_OutputPorts(),
1004  static_cast<FwAssertArgType>(portNum)
1005  );
1006 
1007  FW_ASSERT(
1008  this->m_dataInDeallocate_OutputPort[portNum].isConnected(),
1009  static_cast<FwAssertArgType>(portNum)
1010  );
1011  this->m_dataInDeallocate_OutputPort[portNum].invoke(
1012  fwBuffer
1013  );
1014  }
1015 
1018  FwIndexType portNum,
1019  Fw::Buffer& fwBuffer
1020  )
1021  {
1022  FW_ASSERT(
1023  portNum < this->getNum_dataOut_OutputPorts(),
1024  static_cast<FwAssertArgType>(portNum)
1025  );
1026 
1027  FW_ASSERT(
1028  this->m_dataOut_OutputPort[portNum].isConnected(),
1029  static_cast<FwAssertArgType>(portNum)
1030  );
1031  this->m_dataOut_OutputPort[portNum].invoke(
1032  fwBuffer
1033  );
1034  }
1035 
1038  FwIndexType portNum,
1039  U32 size
1040  )
1041  {
1042  FW_ASSERT(
1043  portNum < this->getNum_dataOutAllocate_OutputPorts(),
1044  static_cast<FwAssertArgType>(portNum)
1045  );
1046 
1047  FW_ASSERT(
1048  this->m_dataOutAllocate_OutputPort[portNum].isConnected(),
1049  static_cast<FwAssertArgType>(portNum)
1050  );
1051  return this->m_dataOutAllocate_OutputPort[portNum].invoke(
1052  size
1053  );
1054  }
1055 
1056  // ----------------------------------------------------------------------
1057  // Invocation functions for serial output ports
1058  // ----------------------------------------------------------------------
1059 
1062  FwIndexType portNum,
1063  Fw::SerializeBufferBase& buffer
1064  )
1065  {
1066  FW_ASSERT(
1067  portNum < this->getNum_portOut_OutputPorts(),
1068  static_cast<FwAssertArgType>(portNum)
1069  );
1070 
1071  FW_ASSERT(
1072  this->m_portOut_OutputPort[portNum].isConnected(),
1073  static_cast<FwAssertArgType>(portNum)
1074  );
1075  return this->m_portOut_OutputPort[portNum].invokeSerial(
1076  buffer
1077  );
1078  }
1079 
1080  // ----------------------------------------------------------------------
1081  // Calls for messages received on typed input ports
1082  // ----------------------------------------------------------------------
1083 
1084  void GenericHubComponentBase ::
1085  m_p_LogRecv_in(
1086  Fw::PassiveComponentBase* callComp,
1087  FwIndexType portNum,
1088  FwEventIdType id,
1089  Fw::Time& timeTag,
1090  const Fw::LogSeverity& severity,
1091  Fw::LogBuffer& args
1092  )
1093  {
1094  FW_ASSERT(callComp);
1095  GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1096  compPtr->LogRecv_handlerBase(
1097  portNum,
1098  id,
1099  timeTag,
1100  severity,
1101  args
1102  );
1103  }
1104 
1105  void GenericHubComponentBase ::
1106  m_p_TlmRecv_in(
1107  Fw::PassiveComponentBase* callComp,
1108  FwIndexType portNum,
1109  FwChanIdType id,
1110  Fw::Time& timeTag,
1111  Fw::TlmBuffer& val
1112  )
1113  {
1114  FW_ASSERT(callComp);
1115  GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1116  compPtr->TlmRecv_handlerBase(
1117  portNum,
1118  id,
1119  timeTag,
1120  val
1121  );
1122  }
1123 
1124  void GenericHubComponentBase ::
1125  m_p_buffersIn_in(
1126  Fw::PassiveComponentBase* callComp,
1127  FwIndexType portNum,
1128  Fw::Buffer& fwBuffer
1129  )
1130  {
1131  FW_ASSERT(callComp);
1132  GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1133  compPtr->buffersIn_handlerBase(
1134  portNum,
1135  fwBuffer
1136  );
1137  }
1138 
1139  void GenericHubComponentBase ::
1140  m_p_dataIn_in(
1141  Fw::PassiveComponentBase* callComp,
1142  FwIndexType portNum,
1143  Fw::Buffer& fwBuffer
1144  )
1145  {
1146  FW_ASSERT(callComp);
1147  GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1148  compPtr->dataIn_handlerBase(
1149  portNum,
1150  fwBuffer
1151  );
1152  }
1153 
1154  // ----------------------------------------------------------------------
1155  // Calls for messages received on serial input ports
1156  // ----------------------------------------------------------------------
1157 
1158 #if FW_PORT_SERIALIZATION
1159 
1160  void GenericHubComponentBase ::
1161  m_p_portIn_in(
1162  Fw::PassiveComponentBase* callComp,
1163  FwIndexType portNum,
1164  Fw::SerializeBufferBase& buffer
1165  )
1166  {
1167  FW_ASSERT(callComp);
1168  GenericHubComponentBase* compPtr = static_cast<GenericHubComponentBase*>(callComp);
1169  compPtr->portIn_handlerBase(
1170  portNum,
1171  buffer
1172  );
1173  }
1174 
1175 #endif
1176 
1177 }
void set_TlmSend_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to TlmSend[portNum].
FwIndexType getNum_TlmSend_OutputPorts() const
void set_dataOutAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to dataOutAllocate[portNum].
FwIndexType getNum_portIn_InputPorts() const
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
Definition: Time.hpp:9
FwIndexType getNum_dataIn_InputPorts() const
void set_buffersOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to buffersOut[portNum].
FwIndexType getNum_LogRecv_InputPorts() const
virtual ~GenericHubComponentBase()
Destroy GenericHubComponentBase object.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port dataIn.
void LogSend_out(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke output port LogSend.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Fw::Buffer invoke(U32 size) const
Invoke a port interface.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:62
void set_LogSend_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to LogSend[portNum].
void buffersIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffersIn.
virtual void LogRecv_handler(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
I32 FwEnumStoreType
Definition: FpConfig.h:64
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void init()
Initialization function.
Definition: TlmPortAc.cpp:56
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
FwIndexType getNum_dataInDeallocate_OutputPorts() const
void dataOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port dataOut.
Fw::Buffer dataOutAllocate_out(FwIndexType portNum, U32 size)
Invoke output port dataOutAllocate.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void init()
Object initializer.
Definition: ObjBase.cpp:26
Fw::SerializeStatus portOut_out(FwIndexType portNum, Fw::SerializeBufferBase &buffer)
Invoke output port portOut.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
Auto-generated base for GenericHub component.
SerializeStatus
forward declaration for string
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
bool isConnected_TlmSend_OutputPort(FwIndexType portNum)
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
void portIn_handlerBase(FwIndexType portNum, Fw::SerializeBufferBase &buffer)
Handler base-class function for input port portIn.
void init()
Initialization function.
Definition: LogPortAc.cpp:56
Fw::InputBufferSendPort * get_buffersIn_InputPort(FwIndexType portNum)
void buffersOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port buffersOut.
bool isConnected_portOut_OutputPort(FwIndexType portNum)
void set_dataInDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to dataInDeallocate[portNum].
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port interface.
Fw::InputSerializePort * get_portIn_InputPort(FwIndexType portNum)
void init()
Initialization function.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
virtual void portIn_handler(FwIndexType portNum, Fw::SerializeBufferBase &buffer)=0
Handler for input port portIn.
FwIndexType getNum_TlmRecv_InputPorts() const
bool isConnected_dataOutAllocate_OutputPort(FwIndexType portNum)
const char * toChar() const
Definition: ObjectName.hpp:50
Fw::InputLogPort * get_LogRecv_InputPort(FwIndexType portNum)
FwIndexType getNum_bufferDeallocate_OutputPorts() const
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected() const
Definition: PortBase.cpp:42
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
Enum representing event severity.
FwIndexType getNum_dataOut_OutputPorts() const
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
U32 FwEventIdType
Definition: FpConfig.h:103
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:55
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: LogPortAc.cpp:62
void setPortNum(FwIndexType portNum)
void TlmSend_out(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke output port TlmSend.
Fw::InputBufferSendPort * get_dataIn_InputPort(FwIndexType portNum)
bool isConnected_buffersOut_OutputPort(FwIndexType portNum)
void init()
Initialization function.
bool isConnected_LogSend_OutputPort(FwIndexType portNum)
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
FwIndexType getNum_portOut_OutputPorts() const
FwIndexType getNum_buffersOut_OutputPorts() const
#define FW_NUM_ARRAY_ELEMENTS(a)
number of elements in an array
Definition: BasicTypes.h:85
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void set_dataOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to dataOut[portNum].
void init()
Initialization function.
void dataInDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port dataInDeallocate.
GenericHubComponentBase(const char *compName="")
Construct GenericHubComponentBase object.
bool isConnected_dataInDeallocate_OutputPort(FwIndexType portNum)
virtual void buffersIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffersIn.
FwIndexType getNum_buffersIn_InputPorts() const
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
FwIndexType getNum_dataOutAllocate_OutputPorts() const
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port dataIn.
U32 FwChanIdType
Definition: FpConfig.h:95
void LogRecv_handlerBase(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Handler base-class function for input port LogRecv.
FwIndexType getNum_LogSend_OutputPorts() const