F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GenericHubComponentAc.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 
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 
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  this->m_LogSend_OutputPort[portNum].invoke(
920  id,
921  timeTag,
922  severity,
923  args
924  );
925  }
926 
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 
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 
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 
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 
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 
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 
1026  portOut_out(
1027  FwIndexType portNum,
1028  Fw::SerializeBufferBase& buffer
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,
1124  Fw::SerializeBufferBase& buffer
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
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: LogPortAc.cpp:62
void init()
Initialization function.
Definition: LogPortAc.cpp:56
void setPortNum(NATIVE_INT_TYPE portNum)
void init()
Initialization function.
Definition: TlmPortAc.cpp:56
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: TlmPortAc.cpp:62
Enum representing event severity.
void init()
Object initializer.
Definition: ObjBase.cpp:27
const char * toChar() const
Definition: ObjectName.hpp:50
void init()
Initialization function.
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
Fw::Buffer invoke(U32 size)
Invoke a port interface.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Buffer &fwBuffer)
Invoke a port interface.
void init()
Initialization function.
void init()
Initialization function.
Definition: LogPortAc.cpp:151
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke a port interface.
Definition: LogPortAc.cpp:170
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke a port interface.
Definition: TlmPortAc.cpp:163
bool isConnected()
Definition: PortBase.cpp:41
void format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:56
Definition: Time.hpp:9
Auto-generated base for GenericHub component.
bool isConnected_dataInDeallocate_OutputPort(FwIndexType portNum)
virtual void portIn_handler(FwIndexType portNum, Fw::SerializeBufferBase &buffer)=0
Handler for input port portIn.
void set_TlmSend_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to TlmSend[portNum].
void LogRecv_handlerBase(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Handler base-class function for input port LogRecv.
virtual void buffersIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port buffersIn.
FwIndexType getNum_LogRecv_InputPorts() const
Fw::InputTlmPort * get_TlmRecv_InputPort(FwIndexType portNum)
FwIndexType getNum_LogSend_OutputPorts() const
FwIndexType getNum_dataOut_OutputPorts() const
FwIndexType getNum_dataIn_InputPorts() const
FwIndexType getNum_bufferDeallocate_OutputPorts() const
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
void set_dataInDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to dataInDeallocate[portNum].
Fw::InputLogPort * get_LogRecv_InputPort(FwIndexType portNum)
bool isConnected_buffersOut_OutputPort(FwIndexType portNum)
bool isConnected_portOut_OutputPort(FwIndexType portNum)
void set_buffersOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to buffersOut[portNum].
void set_dataOutAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to dataOutAllocate[portNum].
Fw::InputBufferSendPort * get_dataIn_InputPort(FwIndexType portNum)
FwIndexType getNum_dataOutAllocate_OutputPorts() const
Fw::InputSerializePort * get_portIn_InputPort(FwIndexType portNum)
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)
bool isConnected_LogSend_OutputPort(FwIndexType portNum)
void portIn_handlerBase(FwIndexType portNum, Fw::SerializeBufferBase &buffer)
Handler base-class function for input port portIn.
Fw::InputBufferSendPort * get_buffersIn_InputPort(FwIndexType portNum)
FwIndexType getNum_portOut_OutputPorts() const
FwIndexType getNum_TlmRecv_InputPorts() const
Fw::Buffer dataOutAllocate_out(FwIndexType portNum, U32 size)
Invoke output port dataOutAllocate.
void buffersOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port buffersOut.
void set_LogSend_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to LogSend[portNum].
virtual ~GenericHubComponentBase()
Destroy GenericHubComponentBase object.
FwIndexType getNum_portIn_InputPorts() const
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
void dataOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port dataOut.
virtual void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)=0
Handler for input port TlmRecv.
Fw::SerializeStatus portOut_out(FwIndexType portNum, Fw::SerializeBufferBase &buffer)
Invoke output port portOut.
FwIndexType getNum_buffersIn_InputPorts() const
bool isConnected_dataOutAllocate_OutputPort(FwIndexType portNum)
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port dataIn.
GenericHubComponentBase(const char *compName="")
Construct GenericHubComponentBase object.
void dataInDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port dataInDeallocate.
FwIndexType getNum_TlmSend_OutputPorts() const
bool isConnected_TlmSend_OutputPort(FwIndexType portNum)
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
virtual void LogRecv_handler(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
void LogSend_out(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Invoke output port LogSend.
FwIndexType getNum_buffersOut_OutputPorts() const
void TlmSend_out(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Invoke output port TlmSend.
void set_dataOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to dataOut[portNum].
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port dataIn.
void TlmRecv_handlerBase(FwIndexType portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val)
Handler base-class function for input port TlmRecv.
void buffersIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port buffersIn.
FwIndexType getNum_dataInDeallocate_OutputPorts() const
SerializeStatus
forward declaration for string