F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
SpacePacketFramerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SpacePacketFramerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for SpacePacketFramer component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace Ccsds {
17 
18  // ----------------------------------------------------------------------
19  // Component initialization
20  // ----------------------------------------------------------------------
21 
24  {
25  // Initialize base class
27 
28  // Connect input port comStatusIn
29  for (
30  FwIndexType port = 0;
31  port < static_cast<FwIndexType>(this->getNum_comStatusIn_InputPorts());
32  port++
33  ) {
34  this->m_comStatusIn_InputPort[port].init();
35  this->m_comStatusIn_InputPort[port].addCallComp(
36  this,
37  m_p_comStatusIn_in
38  );
39  this->m_comStatusIn_InputPort[port].setPortNum(port);
40 
41 #if FW_OBJECT_NAMES == 1
42  Fw::ObjectName portName;
43  portName.format(
44  "%s_comStatusIn_InputPort[%" PRI_FwIndexType "]",
45  this->m_objName.toChar(),
46  port
47  );
48  this->m_comStatusIn_InputPort[port].setObjName(portName.toChar());
49 #endif
50  }
51 
52  // Connect input port dataIn
53  for (
54  FwIndexType port = 0;
55  port < static_cast<FwIndexType>(this->getNum_dataIn_InputPorts());
56  port++
57  ) {
58  this->m_dataIn_InputPort[port].init();
59  this->m_dataIn_InputPort[port].addCallComp(
60  this,
61  m_p_dataIn_in
62  );
63  this->m_dataIn_InputPort[port].setPortNum(port);
64 
65 #if FW_OBJECT_NAMES == 1
66  Fw::ObjectName portName;
67  portName.format(
68  "%s_dataIn_InputPort[%" PRI_FwIndexType "]",
69  this->m_objName.toChar(),
70  port
71  );
72  this->m_dataIn_InputPort[port].setObjName(portName.toChar());
73 #endif
74  }
75 
76  // Connect input port dataReturnIn
77  for (
78  FwIndexType port = 0;
79  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
80  port++
81  ) {
82  this->m_dataReturnIn_InputPort[port].init();
83  this->m_dataReturnIn_InputPort[port].addCallComp(
84  this,
85  m_p_dataReturnIn_in
86  );
87  this->m_dataReturnIn_InputPort[port].setPortNum(port);
88 
89 #if FW_OBJECT_NAMES == 1
90  Fw::ObjectName portName;
91  portName.format(
92  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
93  this->m_objName.toChar(),
94  port
95  );
96  this->m_dataReturnIn_InputPort[port].setObjName(portName.toChar());
97 #endif
98  }
99 
100  // Connect output port logOut
101  for (
102  FwIndexType port = 0;
103  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
104  port++
105  ) {
106  this->m_logOut_OutputPort[port].init();
107 
108 #if FW_OBJECT_NAMES == 1
109  Fw::ObjectName portName;
110  portName.format(
111  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
112  this->m_objName.toChar(),
113  port
114  );
115  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
116 #endif
117  }
118 
119 #if FW_ENABLE_TEXT_LOGGING == 1
120  // Connect output port logTextOut
121  for (
122  FwIndexType port = 0;
123  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
124  port++
125  ) {
126  this->m_logTextOut_OutputPort[port].init();
127 
128 #if FW_OBJECT_NAMES == 1
129  Fw::ObjectName portName;
130  portName.format(
131  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
132  this->m_objName.toChar(),
133  port
134  );
135  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
136 #endif
137  }
138 #endif
139 
140  // Connect output port prmGetOut
141  for (
142  FwIndexType port = 0;
143  port < static_cast<FwIndexType>(this->getNum_prmGetOut_OutputPorts());
144  port++
145  ) {
146  this->m_prmGetOut_OutputPort[port].init();
147 
148 #if FW_OBJECT_NAMES == 1
149  Fw::ObjectName portName;
150  portName.format(
151  "%s_prmGetOut_OutputPort[%" PRI_FwIndexType "]",
152  this->m_objName.toChar(),
153  port
154  );
155  this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar());
156 #endif
157  }
158 
159  // Connect output port prmSetOut
160  for (
161  FwIndexType port = 0;
162  port < static_cast<FwIndexType>(this->getNum_prmSetOut_OutputPorts());
163  port++
164  ) {
165  this->m_prmSetOut_OutputPort[port].init();
166 
167 #if FW_OBJECT_NAMES == 1
168  Fw::ObjectName portName;
169  portName.format(
170  "%s_prmSetOut_OutputPort[%" PRI_FwIndexType "]",
171  this->m_objName.toChar(),
172  port
173  );
174  this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar());
175 #endif
176  }
177 
178  // Connect output port timeCaller
179  for (
180  FwIndexType port = 0;
181  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
182  port++
183  ) {
184  this->m_timeCaller_OutputPort[port].init();
185 
186 #if FW_OBJECT_NAMES == 1
187  Fw::ObjectName portName;
188  portName.format(
189  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
190  this->m_objName.toChar(),
191  port
192  );
193  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
194 #endif
195  }
196 
197  // Connect output port tlmOut
198  for (
199  FwIndexType port = 0;
200  port < static_cast<FwIndexType>(this->getNum_tlmOut_OutputPorts());
201  port++
202  ) {
203  this->m_tlmOut_OutputPort[port].init();
204 
205 #if FW_OBJECT_NAMES == 1
206  Fw::ObjectName portName;
207  portName.format(
208  "%s_tlmOut_OutputPort[%" PRI_FwIndexType "]",
209  this->m_objName.toChar(),
210  port
211  );
212  this->m_tlmOut_OutputPort[port].setObjName(portName.toChar());
213 #endif
214  }
215 
216  // Connect output port bufferAllocate
217  for (
218  FwIndexType port = 0;
219  port < static_cast<FwIndexType>(this->getNum_bufferAllocate_OutputPorts());
220  port++
221  ) {
222  this->m_bufferAllocate_OutputPort[port].init();
223 
224 #if FW_OBJECT_NAMES == 1
225  Fw::ObjectName portName;
226  portName.format(
227  "%s_bufferAllocate_OutputPort[%" PRI_FwIndexType "]",
228  this->m_objName.toChar(),
229  port
230  );
231  this->m_bufferAllocate_OutputPort[port].setObjName(portName.toChar());
232 #endif
233  }
234 
235  // Connect output port bufferDeallocate
236  for (
237  FwIndexType port = 0;
238  port < static_cast<FwIndexType>(this->getNum_bufferDeallocate_OutputPorts());
239  port++
240  ) {
241  this->m_bufferDeallocate_OutputPort[port].init();
242 
243 #if FW_OBJECT_NAMES == 1
244  Fw::ObjectName portName;
245  portName.format(
246  "%s_bufferDeallocate_OutputPort[%" PRI_FwIndexType "]",
247  this->m_objName.toChar(),
248  port
249  );
250  this->m_bufferDeallocate_OutputPort[port].setObjName(portName.toChar());
251 #endif
252  }
253 
254  // Connect output port comStatusOut
255  for (
256  FwIndexType port = 0;
257  port < static_cast<FwIndexType>(this->getNum_comStatusOut_OutputPorts());
258  port++
259  ) {
260  this->m_comStatusOut_OutputPort[port].init();
261 
262 #if FW_OBJECT_NAMES == 1
263  Fw::ObjectName portName;
264  portName.format(
265  "%s_comStatusOut_OutputPort[%" PRI_FwIndexType "]",
266  this->m_objName.toChar(),
267  port
268  );
269  this->m_comStatusOut_OutputPort[port].setObjName(portName.toChar());
270 #endif
271  }
272 
273  // Connect output port dataOut
274  for (
275  FwIndexType port = 0;
276  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
277  port++
278  ) {
279  this->m_dataOut_OutputPort[port].init();
280 
281 #if FW_OBJECT_NAMES == 1
282  Fw::ObjectName portName;
283  portName.format(
284  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
285  this->m_objName.toChar(),
286  port
287  );
288  this->m_dataOut_OutputPort[port].setObjName(portName.toChar());
289 #endif
290  }
291 
292  // Connect output port dataReturnOut
293  for (
294  FwIndexType port = 0;
295  port < static_cast<FwIndexType>(this->getNum_dataReturnOut_OutputPorts());
296  port++
297  ) {
298  this->m_dataReturnOut_OutputPort[port].init();
299 
300 #if FW_OBJECT_NAMES == 1
301  Fw::ObjectName portName;
302  portName.format(
303  "%s_dataReturnOut_OutputPort[%" PRI_FwIndexType "]",
304  this->m_objName.toChar(),
305  port
306  );
307  this->m_dataReturnOut_OutputPort[port].setObjName(portName.toChar());
308 #endif
309  }
310 
311  // Connect output port getApidSeqCount
312  for (
313  FwIndexType port = 0;
314  port < static_cast<FwIndexType>(this->getNum_getApidSeqCount_OutputPorts());
315  port++
316  ) {
317  this->m_getApidSeqCount_OutputPort[port].init();
318 
319 #if FW_OBJECT_NAMES == 1
320  Fw::ObjectName portName;
321  portName.format(
322  "%s_getApidSeqCount_OutputPort[%" PRI_FwIndexType "]",
323  this->m_objName.toChar(),
324  port
325  );
326  this->m_getApidSeqCount_OutputPort[port].setObjName(portName.toChar());
327 #endif
328  }
329  }
330 
331  // ----------------------------------------------------------------------
332  // Getters for typed input ports
333  // ----------------------------------------------------------------------
334 
337  {
338  FW_ASSERT(
339  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
340  static_cast<FwAssertArgType>(portNum)
341  );
342 
343  return &this->m_comStatusIn_InputPort[portNum];
344  }
345 
348  {
349  FW_ASSERT(
350  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
351  static_cast<FwAssertArgType>(portNum)
352  );
353 
354  return &this->m_dataIn_InputPort[portNum];
355  }
356 
359  {
360  FW_ASSERT(
361  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
362  static_cast<FwAssertArgType>(portNum)
363  );
364 
365  return &this->m_dataReturnIn_InputPort[portNum];
366  }
367 
368  // ----------------------------------------------------------------------
369  // Connect input ports to special output ports
370  // ----------------------------------------------------------------------
371 
374  FwIndexType portNum,
375  Fw::InputLogPort* port
376  )
377  {
378  FW_ASSERT(
379  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
380  static_cast<FwAssertArgType>(portNum)
381  );
382 
383  this->m_logOut_OutputPort[portNum].addCallPort(port);
384  }
385 
386 #if FW_ENABLE_TEXT_LOGGING == 1
387 
388  void SpacePacketFramerComponentBase ::
389  set_logTextOut_OutputPort(
390  FwIndexType portNum,
392  )
393  {
394  FW_ASSERT(
395  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
396  static_cast<FwAssertArgType>(portNum)
397  );
398 
399  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
400  }
401 
402 #endif
403 
406  FwIndexType portNum,
407  Fw::InputPrmGetPort* port
408  )
409  {
410  FW_ASSERT(
411  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
412  static_cast<FwAssertArgType>(portNum)
413  );
414 
415  this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
416  }
417 
420  FwIndexType portNum,
421  Fw::InputPrmSetPort* port
422  )
423  {
424  FW_ASSERT(
425  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
426  static_cast<FwAssertArgType>(portNum)
427  );
428 
429  this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
430  }
431 
434  FwIndexType portNum,
435  Fw::InputTimePort* port
436  )
437  {
438  FW_ASSERT(
439  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
440  static_cast<FwAssertArgType>(portNum)
441  );
442 
443  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
444  }
445 
448  FwIndexType portNum,
449  Fw::InputTlmPort* port
450  )
451  {
452  FW_ASSERT(
453  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
454  static_cast<FwAssertArgType>(portNum)
455  );
456 
457  this->m_tlmOut_OutputPort[portNum].addCallPort(port);
458  }
459 
460  // ----------------------------------------------------------------------
461  // Connect typed input ports to typed output ports
462  // ----------------------------------------------------------------------
463 
466  FwIndexType portNum,
468  )
469  {
470  FW_ASSERT(
471  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
472  static_cast<FwAssertArgType>(portNum)
473  );
474 
475  this->m_bufferAllocate_OutputPort[portNum].addCallPort(port);
476  }
477 
480  FwIndexType portNum,
482  )
483  {
484  FW_ASSERT(
485  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
486  static_cast<FwAssertArgType>(portNum)
487  );
488 
489  this->m_bufferDeallocate_OutputPort[portNum].addCallPort(port);
490  }
491 
494  FwIndexType portNum,
496  )
497  {
498  FW_ASSERT(
499  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
500  static_cast<FwAssertArgType>(portNum)
501  );
502 
503  this->m_comStatusOut_OutputPort[portNum].addCallPort(port);
504  }
505 
508  FwIndexType portNum,
510  )
511  {
512  FW_ASSERT(
513  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
514  static_cast<FwAssertArgType>(portNum)
515  );
516 
517  this->m_dataOut_OutputPort[portNum].addCallPort(port);
518  }
519 
522  FwIndexType portNum,
524  )
525  {
526  FW_ASSERT(
527  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
528  static_cast<FwAssertArgType>(portNum)
529  );
530 
531  this->m_dataReturnOut_OutputPort[portNum].addCallPort(port);
532  }
533 
536  FwIndexType portNum,
538  )
539  {
540  FW_ASSERT(
541  (0 <= portNum) && (portNum < this->getNum_getApidSeqCount_OutputPorts()),
542  static_cast<FwAssertArgType>(portNum)
543  );
544 
545  this->m_getApidSeqCount_OutputPort[portNum].addCallPort(port);
546  }
547 
548 #if FW_PORT_SERIALIZATION
549 
550  // ----------------------------------------------------------------------
551  // Connect serial input ports to special output ports
552  // ----------------------------------------------------------------------
553 
556  FwIndexType portNum,
557  Fw::InputSerializePort* port
558  )
559  {
560  FW_ASSERT(
561  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
562  static_cast<FwAssertArgType>(portNum)
563  );
564 
565  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
566  }
567 
568 #if FW_ENABLE_TEXT_LOGGING == 1
569 
570  void SpacePacketFramerComponentBase ::
571  set_logTextOut_OutputPort(
572  FwIndexType portNum,
573  Fw::InputSerializePort* port
574  )
575  {
576  FW_ASSERT(
577  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
578  static_cast<FwAssertArgType>(portNum)
579  );
580 
581  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
582  }
583 
584 #endif
585 
588  FwIndexType portNum,
589  Fw::InputSerializePort* port
590  )
591  {
592  FW_ASSERT(
593  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
594  static_cast<FwAssertArgType>(portNum)
595  );
596 
597  this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
598  }
599 
602  FwIndexType portNum,
603  Fw::InputSerializePort* port
604  )
605  {
606  FW_ASSERT(
607  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
608  static_cast<FwAssertArgType>(portNum)
609  );
610 
611  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
612  }
613 
616  FwIndexType portNum,
617  Fw::InputSerializePort* port
618  )
619  {
620  FW_ASSERT(
621  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
622  static_cast<FwAssertArgType>(portNum)
623  );
624 
625  this->m_tlmOut_OutputPort[portNum].registerSerialPort(port);
626  }
627 
628 #endif
629 
630 #if FW_PORT_SERIALIZATION
631 
632  // ----------------------------------------------------------------------
633  // Connect serial input ports to typed output ports
634  // ----------------------------------------------------------------------
635 
638  FwIndexType portNum,
639  Fw::InputSerializePort* port
640  )
641  {
642  FW_ASSERT(
643  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
644  static_cast<FwAssertArgType>(portNum)
645  );
646 
647  this->m_bufferDeallocate_OutputPort[portNum].registerSerialPort(port);
648  }
649 
652  FwIndexType portNum,
653  Fw::InputSerializePort* port
654  )
655  {
656  FW_ASSERT(
657  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
658  static_cast<FwAssertArgType>(portNum)
659  );
660 
661  this->m_comStatusOut_OutputPort[portNum].registerSerialPort(port);
662  }
663 
666  FwIndexType portNum,
667  Fw::InputSerializePort* port
668  )
669  {
670  FW_ASSERT(
671  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
672  static_cast<FwAssertArgType>(portNum)
673  );
674 
675  this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
676  }
677 
680  FwIndexType portNum,
681  Fw::InputSerializePort* port
682  )
683  {
684  FW_ASSERT(
685  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
686  static_cast<FwAssertArgType>(portNum)
687  );
688 
689  this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
690  }
691 
692 #endif
693 
694  // ----------------------------------------------------------------------
695  // Component construction and destruction
696  // ----------------------------------------------------------------------
697 
699  SpacePacketFramerComponentBase(const char* compName) :
700  Fw::PassiveComponentBase(compName)
701  {
702 
703  }
704 
707  {
708 
709  }
710 
711  // ----------------------------------------------------------------------
712  // Connection status queries for special output ports
713  // ----------------------------------------------------------------------
714 
717  {
718  FW_ASSERT(
719  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
720  static_cast<FwAssertArgType>(portNum)
721  );
722 
723  return this->m_logOut_OutputPort[portNum].isConnected();
724  }
725 
726 #if FW_ENABLE_TEXT_LOGGING == 1
727 
728  bool SpacePacketFramerComponentBase ::
729  isConnected_logTextOut_OutputPort(FwIndexType portNum)
730  {
731  FW_ASSERT(
732  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
733  static_cast<FwAssertArgType>(portNum)
734  );
735 
736  return this->m_logTextOut_OutputPort[portNum].isConnected();
737  }
738 
739 #endif
740 
743  {
744  FW_ASSERT(
745  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
746  static_cast<FwAssertArgType>(portNum)
747  );
748 
749  return this->m_prmGetOut_OutputPort[portNum].isConnected();
750  }
751 
754  {
755  FW_ASSERT(
756  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
757  static_cast<FwAssertArgType>(portNum)
758  );
759 
760  return this->m_prmSetOut_OutputPort[portNum].isConnected();
761  }
762 
765  {
766  FW_ASSERT(
767  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
768  static_cast<FwAssertArgType>(portNum)
769  );
770 
771  return this->m_timeCaller_OutputPort[portNum].isConnected();
772  }
773 
776  {
777  FW_ASSERT(
778  (0 <= portNum) && (portNum < this->getNum_tlmOut_OutputPorts()),
779  static_cast<FwAssertArgType>(portNum)
780  );
781 
782  return this->m_tlmOut_OutputPort[portNum].isConnected();
783  }
784 
785  // ----------------------------------------------------------------------
786  // Connection status queries for typed output ports
787  // ----------------------------------------------------------------------
788 
791  {
792  FW_ASSERT(
793  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
794  static_cast<FwAssertArgType>(portNum)
795  );
796 
797  return this->m_bufferAllocate_OutputPort[portNum].isConnected();
798  }
799 
802  {
803  FW_ASSERT(
804  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
805  static_cast<FwAssertArgType>(portNum)
806  );
807 
808  return this->m_bufferDeallocate_OutputPort[portNum].isConnected();
809  }
810 
813  {
814  FW_ASSERT(
815  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
816  static_cast<FwAssertArgType>(portNum)
817  );
818 
819  return this->m_comStatusOut_OutputPort[portNum].isConnected();
820  }
821 
824  {
825  FW_ASSERT(
826  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
827  static_cast<FwAssertArgType>(portNum)
828  );
829 
830  return this->m_dataOut_OutputPort[portNum].isConnected();
831  }
832 
835  {
836  FW_ASSERT(
837  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
838  static_cast<FwAssertArgType>(portNum)
839  );
840 
841  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
842  }
843 
846  {
847  FW_ASSERT(
848  (0 <= portNum) && (portNum < this->getNum_getApidSeqCount_OutputPorts()),
849  static_cast<FwAssertArgType>(portNum)
850  );
851 
852  return this->m_getApidSeqCount_OutputPort[portNum].isConnected();
853  }
854 
855  // ----------------------------------------------------------------------
856  // Port handler base-class functions for typed input ports
857  //
858  // Call these functions directly to bypass the corresponding ports
859  // ----------------------------------------------------------------------
860 
863  FwIndexType portNum,
864  Fw::Success& condition
865  )
866  {
867  // Make sure port number is valid
868  FW_ASSERT(
869  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
870  static_cast<FwAssertArgType>(portNum)
871  );
872 
873  // Call handler function
874  this->comStatusIn_handler(
875  portNum,
876  condition
877  );
878  }
879 
882  FwIndexType portNum,
883  Fw::Buffer& data,
884  const ComCfg::FrameContext& context
885  )
886  {
887  // Make sure port number is valid
888  FW_ASSERT(
889  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
890  static_cast<FwAssertArgType>(portNum)
891  );
892 
893  // Call handler function
894  this->dataIn_handler(
895  portNum,
896  data,
897  context
898  );
899  }
900 
903  FwIndexType portNum,
904  Fw::Buffer& data,
905  const ComCfg::FrameContext& context
906  )
907  {
908  // Make sure port number is valid
909  FW_ASSERT(
910  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
911  static_cast<FwAssertArgType>(portNum)
912  );
913 
914  // Call handler function
915  this->dataReturnIn_handler(
916  portNum,
917  data,
918  context
919  );
920  }
921 
922  // ----------------------------------------------------------------------
923  // Invocation functions for typed output ports
924  // ----------------------------------------------------------------------
925 
928  FwIndexType portNum,
929  FwSizeType size
930  )
931  {
932  FW_ASSERT(
933  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
934  static_cast<FwAssertArgType>(portNum)
935  );
936 
937  FW_ASSERT(
938  this->m_bufferAllocate_OutputPort[portNum].isConnected(),
939  static_cast<FwAssertArgType>(portNum)
940  );
941  return this->m_bufferAllocate_OutputPort[portNum].invoke(
942  size
943  );
944  }
945 
948  FwIndexType portNum,
949  Fw::Buffer& fwBuffer
950  )
951  {
952  FW_ASSERT(
953  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
954  static_cast<FwAssertArgType>(portNum)
955  );
956 
957  FW_ASSERT(
958  this->m_bufferDeallocate_OutputPort[portNum].isConnected(),
959  static_cast<FwAssertArgType>(portNum)
960  );
961  this->m_bufferDeallocate_OutputPort[portNum].invoke(
962  fwBuffer
963  );
964  }
965 
968  FwIndexType portNum,
969  Fw::Success& condition
970  )
971  {
972  FW_ASSERT(
973  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
974  static_cast<FwAssertArgType>(portNum)
975  );
976 
977  FW_ASSERT(
978  this->m_comStatusOut_OutputPort[portNum].isConnected(),
979  static_cast<FwAssertArgType>(portNum)
980  );
981  this->m_comStatusOut_OutputPort[portNum].invoke(
982  condition
983  );
984  }
985 
988  FwIndexType portNum,
989  Fw::Buffer& data,
990  const ComCfg::FrameContext& context
991  )
992  {
993  FW_ASSERT(
994  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
995  static_cast<FwAssertArgType>(portNum)
996  );
997 
998  FW_ASSERT(
999  this->m_dataOut_OutputPort[portNum].isConnected(),
1000  static_cast<FwAssertArgType>(portNum)
1001  );
1002  this->m_dataOut_OutputPort[portNum].invoke(
1003  data,
1004  context
1005  );
1006  }
1007 
1010  FwIndexType portNum,
1011  Fw::Buffer& data,
1012  const ComCfg::FrameContext& context
1013  )
1014  {
1015  FW_ASSERT(
1016  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
1017  static_cast<FwAssertArgType>(portNum)
1018  );
1019 
1020  FW_ASSERT(
1021  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
1022  static_cast<FwAssertArgType>(portNum)
1023  );
1024  this->m_dataReturnOut_OutputPort[portNum].invoke(
1025  data,
1026  context
1027  );
1028  }
1029 
1032  FwIndexType portNum,
1033  const ComCfg::Apid& apid,
1034  U16 sequenceCount
1035  )
1036  {
1037  FW_ASSERT(
1038  (0 <= portNum) && (portNum < this->getNum_getApidSeqCount_OutputPorts()),
1039  static_cast<FwAssertArgType>(portNum)
1040  );
1041 
1042  FW_ASSERT(
1043  this->m_getApidSeqCount_OutputPort[portNum].isConnected(),
1044  static_cast<FwAssertArgType>(portNum)
1045  );
1046  return this->m_getApidSeqCount_OutputPort[portNum].invoke(
1047  apid,
1048  sequenceCount
1049  );
1050  }
1051 
1052  // ----------------------------------------------------------------------
1053  // Time
1054  // ----------------------------------------------------------------------
1055 
1057  getTime() const
1058  {
1059  if (this->m_timeCaller_OutputPort[0].isConnected()) {
1060  Fw::Time _time;
1061  this->m_timeCaller_OutputPort[0].invoke(_time);
1062  return _time;
1063  }
1064  else {
1065  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1066  }
1067  }
1068 
1069  // ----------------------------------------------------------------------
1070  // Calls for messages received on typed input ports
1071  // ----------------------------------------------------------------------
1072 
1073  void SpacePacketFramerComponentBase ::
1074  m_p_comStatusIn_in(
1075  Fw::PassiveComponentBase* callComp,
1076  FwIndexType portNum,
1077  Fw::Success& condition
1078  )
1079  {
1080  FW_ASSERT(callComp);
1081  SpacePacketFramerComponentBase* compPtr = static_cast<SpacePacketFramerComponentBase*>(callComp);
1082  compPtr->comStatusIn_handlerBase(
1083  portNum,
1084  condition
1085  );
1086  }
1087 
1088  void SpacePacketFramerComponentBase ::
1089  m_p_dataIn_in(
1090  Fw::PassiveComponentBase* callComp,
1091  FwIndexType portNum,
1092  Fw::Buffer& data,
1093  const ComCfg::FrameContext& context
1094  )
1095  {
1096  FW_ASSERT(callComp);
1097  SpacePacketFramerComponentBase* compPtr = static_cast<SpacePacketFramerComponentBase*>(callComp);
1098  compPtr->dataIn_handlerBase(
1099  portNum,
1100  data,
1101  context
1102  );
1103  }
1104 
1105  void SpacePacketFramerComponentBase ::
1106  m_p_dataReturnIn_in(
1107  Fw::PassiveComponentBase* callComp,
1108  FwIndexType portNum,
1109  Fw::Buffer& data,
1110  const ComCfg::FrameContext& context
1111  )
1112  {
1113  FW_ASSERT(callComp);
1114  SpacePacketFramerComponentBase* compPtr = static_cast<SpacePacketFramerComponentBase*>(callComp);
1115  compPtr->dataReturnIn_handlerBase(
1116  portNum,
1117  data,
1118  context
1119  );
1120  }
1121 
1122  }
1123 
1124 }
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
SpacePacketFramerComponentBase(const char *compName="")
Construct SpacePacketFramerComponentBase object.
PlatformSizeType FwSizeType
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
I32 FwEnumStoreType
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
U16 getApidSeqCount_out(FwIndexType portNum, const ComCfg::Apid &apid, U16 sequenceCount)
Invoke output port getApidSeqCount.
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void addCallPort(InputPrmSetPort *callPort)
Register an input port.
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void init()
Initialization function.
Definition: TlmPortAc.cpp:144
No time base has been established (Required)
void addCallPort(InputSuccessConditionPort *callPort)
Register an input port.
static constexpr FwIndexType getNum_getApidSeqCount_OutputPorts()
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
void init()
Initialization function.
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:150
void addCallPort(InputPrmGetPort *callPort)
Register an input port.
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition)
Invoke output port comStatusOut.
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
void init()
Object initializer.
Definition: ObjBase.cpp:24
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
void set_getApidSeqCount_OutputPort(FwIndexType portNum, Svc::Ccsds::InputApidSequenceCountPort *port)
Connect port to getApidSeqCount[portNum].
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port interface.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
static constexpr FwIndexType getNum_bufferAllocate_OutputPorts()
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
void invoke(Fw::Success &condition) const
Invoke a port interface.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port interface.
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
void set_tlmOut_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to tlmOut[portNum].
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
void init()
Initialization function.
bool isConnected() const
Definition: PortBase.cpp:38
static constexpr FwIndexType getNum_bufferDeallocate_OutputPorts()
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:151
Auto-generated base for SpacePacketFramer component.
void setPortNum(FwIndexType portNum)
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
Fw::Buffer invoke(FwSizeType size) const
Invoke a port interface.
void init()
Initialization function.
void init()
Initialization function.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
U16 invoke(const ComCfg::Apid &apid, U16 sequenceCount) const
Invoke a port interface.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
Type used to pass context info between components during framing/deframing.
void init()
Initialization function.
RateGroupDivider component implementation.
Implementation of malloc based allocator.
virtual ~SpacePacketFramerComponentBase()
Destroy SpacePacketFramerComponentBase object.
void init()
Initialization function.
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
void init()
Initialization function.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF.
Definition: ApidEnumAc.hpp:17
Success/Failure.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
void init()
Initialization function.
Fw::Buffer bufferAllocate_out(FwIndexType portNum, FwSizeType size)
Invoke output port bufferAllocate.
void addCallPort(InputApidSequenceCountPort *callPort)
Register an input port.