F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FprimeFramerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FprimeFramerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for FprimeFramer 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  // ----------------------------------------------------------------------
17  // Component initialization
18  // ----------------------------------------------------------------------
19 
22  {
23  // Initialize base class
25 
26 #if !FW_DIRECT_PORT_CALLS
27  // Connect input port comStatusIn
28  for (
29  FwIndexType port = 0;
30  port < static_cast<FwIndexType>(this->getNum_comStatusIn_InputPorts());
31  port++
32  ) {
33  this->m_comStatusIn_InputPort[port].init();
34  this->m_comStatusIn_InputPort[port].addCallComp(
35  this,
36  m_p_comStatusIn_in
37  );
38  this->m_comStatusIn_InputPort[port].setPortNum(port);
39 
40 #if FW_OBJECT_NAMES == 1
41  Fw::ObjectName portName;
42  portName.format(
43  "%s_comStatusIn_InputPort[%" PRI_FwIndexType "]",
44  this->m_objName.toChar(),
45  port
46  );
47  this->m_comStatusIn_InputPort[port].setObjName(portName.toChar());
48 #endif
49  }
50 #endif
51 
52 #if !FW_DIRECT_PORT_CALLS
53  // Connect input port dataIn
54  for (
55  FwIndexType port = 0;
56  port < static_cast<FwIndexType>(this->getNum_dataIn_InputPorts());
57  port++
58  ) {
59  this->m_dataIn_InputPort[port].init();
60  this->m_dataIn_InputPort[port].addCallComp(
61  this,
62  m_p_dataIn_in
63  );
64  this->m_dataIn_InputPort[port].setPortNum(port);
65 
66 #if FW_OBJECT_NAMES == 1
67  Fw::ObjectName portName;
68  portName.format(
69  "%s_dataIn_InputPort[%" PRI_FwIndexType "]",
70  this->m_objName.toChar(),
71  port
72  );
73  this->m_dataIn_InputPort[port].setObjName(portName.toChar());
74 #endif
75  }
76 #endif
77 
78 #if !FW_DIRECT_PORT_CALLS
79  // Connect input port dataReturnIn
80  for (
81  FwIndexType port = 0;
82  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
83  port++
84  ) {
85  this->m_dataReturnIn_InputPort[port].init();
86  this->m_dataReturnIn_InputPort[port].addCallComp(
87  this,
88  m_p_dataReturnIn_in
89  );
90  this->m_dataReturnIn_InputPort[port].setPortNum(port);
91 
92 #if FW_OBJECT_NAMES == 1
93  Fw::ObjectName portName;
94  portName.format(
95  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
96  this->m_objName.toChar(),
97  port
98  );
99  this->m_dataReturnIn_InputPort[port].setObjName(portName.toChar());
100 #endif
101  }
102 #endif
103 
104 #if !FW_DIRECT_PORT_CALLS
105  // Connect output port logOut
106  for (
107  FwIndexType port = 0;
108  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
109  port++
110  ) {
111  this->m_logOut_OutputPort[port].init();
112 
113 #if FW_OBJECT_NAMES == 1
114  Fw::ObjectName portName;
115  portName.format(
116  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
117  this->m_objName.toChar(),
118  port
119  );
120  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
121 #endif
122  }
123 #endif
124 
125 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
126  // Connect output port logTextOut
127  for (
128  FwIndexType port = 0;
129  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
130  port++
131  ) {
132  this->m_logTextOut_OutputPort[port].init();
133 
134 #if FW_OBJECT_NAMES == 1
135  Fw::ObjectName portName;
136  portName.format(
137  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
138  this->m_objName.toChar(),
139  port
140  );
141  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
142 #endif
143  }
144 #endif
145 
146 #if !FW_DIRECT_PORT_CALLS
147  // Connect output port timeCaller
148  for (
149  FwIndexType port = 0;
150  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
151  port++
152  ) {
153  this->m_timeCaller_OutputPort[port].init();
154 
155 #if FW_OBJECT_NAMES == 1
156  Fw::ObjectName portName;
157  portName.format(
158  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
159  this->m_objName.toChar(),
160  port
161  );
162  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
163 #endif
164  }
165 #endif
166 
167 #if !FW_DIRECT_PORT_CALLS
168  // Connect output port bufferAllocate
169  for (
170  FwIndexType port = 0;
171  port < static_cast<FwIndexType>(this->getNum_bufferAllocate_OutputPorts());
172  port++
173  ) {
174  this->m_bufferAllocate_OutputPort[port].init();
175 
176 #if FW_OBJECT_NAMES == 1
177  Fw::ObjectName portName;
178  portName.format(
179  "%s_bufferAllocate_OutputPort[%" PRI_FwIndexType "]",
180  this->m_objName.toChar(),
181  port
182  );
183  this->m_bufferAllocate_OutputPort[port].setObjName(portName.toChar());
184 #endif
185  }
186 #endif
187 
188 #if !FW_DIRECT_PORT_CALLS
189  // Connect output port bufferDeallocate
190  for (
191  FwIndexType port = 0;
192  port < static_cast<FwIndexType>(this->getNum_bufferDeallocate_OutputPorts());
193  port++
194  ) {
195  this->m_bufferDeallocate_OutputPort[port].init();
196 
197 #if FW_OBJECT_NAMES == 1
198  Fw::ObjectName portName;
199  portName.format(
200  "%s_bufferDeallocate_OutputPort[%" PRI_FwIndexType "]",
201  this->m_objName.toChar(),
202  port
203  );
204  this->m_bufferDeallocate_OutputPort[port].setObjName(portName.toChar());
205 #endif
206  }
207 #endif
208 
209 #if !FW_DIRECT_PORT_CALLS
210  // Connect output port comStatusOut
211  for (
212  FwIndexType port = 0;
213  port < static_cast<FwIndexType>(this->getNum_comStatusOut_OutputPorts());
214  port++
215  ) {
216  this->m_comStatusOut_OutputPort[port].init();
217 
218 #if FW_OBJECT_NAMES == 1
219  Fw::ObjectName portName;
220  portName.format(
221  "%s_comStatusOut_OutputPort[%" PRI_FwIndexType "]",
222  this->m_objName.toChar(),
223  port
224  );
225  this->m_comStatusOut_OutputPort[port].setObjName(portName.toChar());
226 #endif
227  }
228 #endif
229 
230 #if !FW_DIRECT_PORT_CALLS
231  // Connect output port dataOut
232  for (
233  FwIndexType port = 0;
234  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
235  port++
236  ) {
237  this->m_dataOut_OutputPort[port].init();
238 
239 #if FW_OBJECT_NAMES == 1
240  Fw::ObjectName portName;
241  portName.format(
242  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
243  this->m_objName.toChar(),
244  port
245  );
246  this->m_dataOut_OutputPort[port].setObjName(portName.toChar());
247 #endif
248  }
249 #endif
250 
251 #if !FW_DIRECT_PORT_CALLS
252  // Connect output port dataReturnOut
253  for (
254  FwIndexType port = 0;
255  port < static_cast<FwIndexType>(this->getNum_dataReturnOut_OutputPorts());
256  port++
257  ) {
258  this->m_dataReturnOut_OutputPort[port].init();
259 
260 #if FW_OBJECT_NAMES == 1
261  Fw::ObjectName portName;
262  portName.format(
263  "%s_dataReturnOut_OutputPort[%" PRI_FwIndexType "]",
264  this->m_objName.toChar(),
265  port
266  );
267  this->m_dataReturnOut_OutputPort[port].setObjName(portName.toChar());
268 #endif
269  }
270 #endif
271  }
272 
273 #if !FW_DIRECT_PORT_CALLS
274 
275  // ----------------------------------------------------------------------
276  // Getters for typed input ports
277  // ----------------------------------------------------------------------
278 
281  {
282  FW_ASSERT(
283  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
284  static_cast<FwAssertArgType>(portNum)
285  );
286 
287  return &this->m_comStatusIn_InputPort[portNum];
288  }
289 
292  {
293  FW_ASSERT(
294  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
295  static_cast<FwAssertArgType>(portNum)
296  );
297 
298  return &this->m_dataIn_InputPort[portNum];
299  }
300 
303  {
304  FW_ASSERT(
305  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
306  static_cast<FwAssertArgType>(portNum)
307  );
308 
309  return &this->m_dataReturnIn_InputPort[portNum];
310  }
311 
312 #endif
313 
314 #if !FW_DIRECT_PORT_CALLS
315 
316  // ----------------------------------------------------------------------
317  // Connect input ports to special output ports
318  // ----------------------------------------------------------------------
319 
322  FwIndexType portNum,
323  Fw::InputLogPort* port
324  )
325  {
326  FW_ASSERT(
327  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
328  static_cast<FwAssertArgType>(portNum)
329  );
330 
331  this->m_logOut_OutputPort[portNum].addCallPort(port);
332  }
333 
334 #if FW_ENABLE_TEXT_LOGGING == 1
335 
336  void FprimeFramerComponentBase ::
337  set_logTextOut_OutputPort(
338  FwIndexType portNum,
340  )
341  {
342  FW_ASSERT(
343  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
344  static_cast<FwAssertArgType>(portNum)
345  );
346 
347  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
348  }
349 
350 #endif
351 
354  FwIndexType portNum,
355  Fw::InputTimePort* port
356  )
357  {
358  FW_ASSERT(
359  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
360  static_cast<FwAssertArgType>(portNum)
361  );
362 
363  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
364  }
365 
366 #endif
367 
368 #if !FW_DIRECT_PORT_CALLS
369 
370  // ----------------------------------------------------------------------
371  // Connect typed input ports to typed output ports
372  // ----------------------------------------------------------------------
373 
376  FwIndexType portNum,
378  )
379  {
380  FW_ASSERT(
381  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
382  static_cast<FwAssertArgType>(portNum)
383  );
384 
385  this->m_bufferAllocate_OutputPort[portNum].addCallPort(port);
386  }
387 
390  FwIndexType portNum,
392  )
393  {
394  FW_ASSERT(
395  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
396  static_cast<FwAssertArgType>(portNum)
397  );
398 
399  this->m_bufferDeallocate_OutputPort[portNum].addCallPort(port);
400  }
401 
404  FwIndexType portNum,
406  )
407  {
408  FW_ASSERT(
409  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
410  static_cast<FwAssertArgType>(portNum)
411  );
412 
413  this->m_comStatusOut_OutputPort[portNum].addCallPort(port);
414  }
415 
418  FwIndexType portNum,
420  )
421  {
422  FW_ASSERT(
423  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
424  static_cast<FwAssertArgType>(portNum)
425  );
426 
427  this->m_dataOut_OutputPort[portNum].addCallPort(port);
428  }
429 
432  FwIndexType portNum,
434  )
435  {
436  FW_ASSERT(
437  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
438  static_cast<FwAssertArgType>(portNum)
439  );
440 
441  this->m_dataReturnOut_OutputPort[portNum].addCallPort(port);
442  }
443 
444 #endif
445 
446 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
447 
448  // ----------------------------------------------------------------------
449  // Connect serial input ports to special output ports
450  // ----------------------------------------------------------------------
451 
454  FwIndexType portNum,
455  Fw::InputSerializePort* port
456  )
457  {
458  FW_ASSERT(
459  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
460  static_cast<FwAssertArgType>(portNum)
461  );
462 
463  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
464  }
465 
466 #if FW_ENABLE_TEXT_LOGGING == 1
467 
468  void FprimeFramerComponentBase ::
469  set_logTextOut_OutputPort(
470  FwIndexType portNum,
471  Fw::InputSerializePort* port
472  )
473  {
474  FW_ASSERT(
475  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
476  static_cast<FwAssertArgType>(portNum)
477  );
478 
479  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
480  }
481 
482 #endif
483 
486  FwIndexType portNum,
487  Fw::InputSerializePort* port
488  )
489  {
490  FW_ASSERT(
491  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
492  static_cast<FwAssertArgType>(portNum)
493  );
494 
495  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
496  }
497 
498 #endif
499 
500 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
501 
502  // ----------------------------------------------------------------------
503  // Connect serial input ports to typed output ports
504  // ----------------------------------------------------------------------
505 
508  FwIndexType portNum,
509  Fw::InputSerializePort* port
510  )
511  {
512  FW_ASSERT(
513  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
514  static_cast<FwAssertArgType>(portNum)
515  );
516 
517  this->m_bufferDeallocate_OutputPort[portNum].registerSerialPort(port);
518  }
519 
522  FwIndexType portNum,
523  Fw::InputSerializePort* port
524  )
525  {
526  FW_ASSERT(
527  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
528  static_cast<FwAssertArgType>(portNum)
529  );
530 
531  this->m_comStatusOut_OutputPort[portNum].registerSerialPort(port);
532  }
533 
536  FwIndexType portNum,
537  Fw::InputSerializePort* port
538  )
539  {
540  FW_ASSERT(
541  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
542  static_cast<FwAssertArgType>(portNum)
543  );
544 
545  this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
546  }
547 
550  FwIndexType portNum,
551  Fw::InputSerializePort* port
552  )
553  {
554  FW_ASSERT(
555  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
556  static_cast<FwAssertArgType>(portNum)
557  );
558 
559  this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
560  }
561 
562 #endif
563 
564  // ----------------------------------------------------------------------
565  // Component construction and destruction
566  // ----------------------------------------------------------------------
567 
569  FprimeFramerComponentBase(const char* compName) :
570  Fw::PassiveComponentBase(compName)
571  {
572  this->m_NoBufferAvailableThrottle = 0;
573  }
574 
577  {
578 
579  }
580 
581 #if !FW_DIRECT_PORT_CALLS
582 
583  // ----------------------------------------------------------------------
584  // Connection status queries for special output ports
585  // ----------------------------------------------------------------------
586 
589  {
590  FW_ASSERT(
591  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
592  static_cast<FwAssertArgType>(portNum)
593  );
594 
595  return this->m_logOut_OutputPort[portNum].isConnected();
596  }
597 
598 #if FW_ENABLE_TEXT_LOGGING == 1
599 
600  bool FprimeFramerComponentBase ::
601  isConnected_logTextOut_OutputPort(FwIndexType portNum) const
602  {
603  FW_ASSERT(
604  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
605  static_cast<FwAssertArgType>(portNum)
606  );
607 
608  return this->m_logTextOut_OutputPort[portNum].isConnected();
609  }
610 
611 #endif
612 
615  {
616  FW_ASSERT(
617  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
618  static_cast<FwAssertArgType>(portNum)
619  );
620 
621  return this->m_timeCaller_OutputPort[portNum].isConnected();
622  }
623 
624 #endif
625 
626 #if !FW_DIRECT_PORT_CALLS
627 
628  // ----------------------------------------------------------------------
629  // Connection status queries for typed output ports
630  // ----------------------------------------------------------------------
631 
634  {
635  FW_ASSERT(
636  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
637  static_cast<FwAssertArgType>(portNum)
638  );
639 
640  return this->m_bufferAllocate_OutputPort[portNum].isConnected();
641  }
642 
645  {
646  FW_ASSERT(
647  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
648  static_cast<FwAssertArgType>(portNum)
649  );
650 
651  return this->m_bufferDeallocate_OutputPort[portNum].isConnected();
652  }
653 
656  {
657  FW_ASSERT(
658  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
659  static_cast<FwAssertArgType>(portNum)
660  );
661 
662  return this->m_comStatusOut_OutputPort[portNum].isConnected();
663  }
664 
667  {
668  FW_ASSERT(
669  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
670  static_cast<FwAssertArgType>(portNum)
671  );
672 
673  return this->m_dataOut_OutputPort[portNum].isConnected();
674  }
675 
678  {
679  FW_ASSERT(
680  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
681  static_cast<FwAssertArgType>(portNum)
682  );
683 
684  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
685  }
686 
687 #endif
688 
689  // ----------------------------------------------------------------------
690  // Port handler base-class functions for typed input ports
691  //
692  // Call these functions directly to bypass the corresponding ports
693  // ----------------------------------------------------------------------
694 
697  FwIndexType portNum,
698  Fw::Success& condition
699  )
700  {
701  // Make sure port number is valid
702  FW_ASSERT(
703  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
704  static_cast<FwAssertArgType>(portNum)
705  );
706 
707  // Call handler function
708  this->comStatusIn_handler(
709  portNum,
710  condition
711  );
712  }
713 
716  FwIndexType portNum,
717  Fw::Buffer& data,
718  const ComCfg::FrameContext& context
719  )
720  {
721  // Make sure port number is valid
722  FW_ASSERT(
723  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
724  static_cast<FwAssertArgType>(portNum)
725  );
726 
727  // Call handler function
728  this->dataIn_handler(
729  portNum,
730  data,
731  context
732  );
733  }
734 
737  FwIndexType portNum,
738  Fw::Buffer& data,
739  const ComCfg::FrameContext& context
740  )
741  {
742  // Make sure port number is valid
743  FW_ASSERT(
744  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
745  static_cast<FwAssertArgType>(portNum)
746  );
747 
748  // Call handler function
749  this->dataReturnIn_handler(
750  portNum,
751  data,
752  context
753  );
754  }
755 
756 #if !FW_DIRECT_PORT_CALLS
757 
758  // ----------------------------------------------------------------------
759  // Invocation functions for typed output ports
760  // ----------------------------------------------------------------------
761 
764  FwIndexType portNum,
765  FwSizeType size
766  ) const
767  {
768  FW_ASSERT(
769  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
770  static_cast<FwAssertArgType>(portNum)
771  );
772 
773  FW_ASSERT(
774  this->m_bufferAllocate_OutputPort[portNum].isConnected(),
775  static_cast<FwAssertArgType>(portNum)
776  );
777  return this->m_bufferAllocate_OutputPort[portNum].invoke(
778  size
779  );
780  }
781 
784  FwIndexType portNum,
785  Fw::Buffer& fwBuffer
786  ) const
787  {
788  FW_ASSERT(
789  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
790  static_cast<FwAssertArgType>(portNum)
791  );
792 
793  FW_ASSERT(
794  this->m_bufferDeallocate_OutputPort[portNum].isConnected(),
795  static_cast<FwAssertArgType>(portNum)
796  );
797  this->m_bufferDeallocate_OutputPort[portNum].invoke(
798  fwBuffer
799  );
800  }
801 
804  FwIndexType portNum,
805  Fw::Success& condition
806  ) const
807  {
808  FW_ASSERT(
809  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
810  static_cast<FwAssertArgType>(portNum)
811  );
812 
813  FW_ASSERT(
814  this->m_comStatusOut_OutputPort[portNum].isConnected(),
815  static_cast<FwAssertArgType>(portNum)
816  );
817  this->m_comStatusOut_OutputPort[portNum].invoke(
818  condition
819  );
820  }
821 
824  FwIndexType portNum,
825  Fw::Buffer& data,
826  const ComCfg::FrameContext& context
827  ) const
828  {
829  FW_ASSERT(
830  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
831  static_cast<FwAssertArgType>(portNum)
832  );
833 
834  FW_ASSERT(
835  this->m_dataOut_OutputPort[portNum].isConnected(),
836  static_cast<FwAssertArgType>(portNum)
837  );
838  this->m_dataOut_OutputPort[portNum].invoke(
839  data,
840  context
841  );
842  }
843 
846  FwIndexType portNum,
847  Fw::Buffer& data,
848  const ComCfg::FrameContext& context
849  ) const
850  {
851  FW_ASSERT(
852  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
853  static_cast<FwAssertArgType>(portNum)
854  );
855 
856  FW_ASSERT(
857  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
858  static_cast<FwAssertArgType>(portNum)
859  );
860  this->m_dataReturnOut_OutputPort[portNum].invoke(
861  data,
862  context
863  );
864  }
865 
866 #endif
867 
868  // ----------------------------------------------------------------------
869  // Event logging functions
870  // ----------------------------------------------------------------------
871 
874  {
875  // Check throttle value
876  if (this->m_NoBufferAvailableThrottle >= EVENTID_NOBUFFERAVAILABLE_THROTTLE) {
877  return;
878  }
879  else {
880  this->m_NoBufferAvailableThrottle++;
881  }
882 
883  // Get the time
884  Fw::Time _logTime;
885  if (this->isConnected_timeCaller_OutputPort(0)) {
886  this->timeCaller_out(0, _logTime);
887  }
888 
889  const FwEventIdType _id = this->getIdBase() + EVENTID_NOBUFFERAVAILABLE;
890 
891  // Emit the event on the log port
892  if (this->isConnected_logOut_OutputPort(0)) {
893  Fw::LogBuffer _logBuff;
894 
895 #if FW_AMPCS_COMPATIBLE
897  // Serialize the number of arguments
898  _status = _logBuff.serializeFrom(static_cast<U8>(0));
899  FW_ASSERT(
900  _status == Fw::FW_SERIALIZE_OK,
901  static_cast<FwAssertArgType>(_status)
902  );
903 #endif
904 
905  this->logOut_out(
906  0,
907  _id,
908  _logTime,
910  _logBuff
911  );
912  }
913 
914  // Emit the event on the text log port
915 #if FW_ENABLE_TEXT_LOGGING
916  if (this->isConnected_logTextOut_OutputPort(0)) {
917 #if FW_OBJECT_NAMES == 1
918  const char* _formatString =
919  "(%s) %s: Failed to allocate a frame buffer: frame dropped";
920 #else
921  const char* _formatString =
922  "%s: Failed to allocate a frame buffer: frame dropped";
923 #endif
924 
925  Fw::TextLogString _logString;
926  (void) _logString.format(
927  _formatString,
928 #if FW_OBJECT_NAMES == 1
929  this->m_objName.toChar(),
930 #endif
931  "NoBufferAvailable "
932  );
933 
934  this->logTextOut_out(
935  0,
936  _id,
937  _logTime,
939  _logString
940  );
941  }
942 #endif
943  }
944 
945  // ----------------------------------------------------------------------
946  // Event throttle reset functions
947  // ----------------------------------------------------------------------
948 
951  {
952  // Reset throttle counter
953  this->m_NoBufferAvailableThrottle = 0;
954  }
955 
956  // ----------------------------------------------------------------------
957  // Time
958  // ----------------------------------------------------------------------
959 
961  getTime() const
962  {
963  if (this->isConnected_timeCaller_OutputPort(0)) {
964  Fw::Time _time;
965  this->timeCaller_out(0, _time);
966  return _time;
967  }
968  else {
969  return Fw::Time(TimeBase::TB_NONE, 0, 0);
970  }
971  }
972 
973  // ----------------------------------------------------------------------
974  // Calls for messages received on typed input ports
975  // ----------------------------------------------------------------------
976 
977  void FprimeFramerComponentBase ::
978  m_p_comStatusIn_in(
979  Fw::PassiveComponentBase* callComp,
980  FwIndexType portNum,
981  Fw::Success& condition
982  )
983  {
984  FW_ASSERT(callComp != nullptr);
985  FprimeFramerComponentBase* compPtr = static_cast<FprimeFramerComponentBase*>(callComp);
986  compPtr->comStatusIn_handlerBase(
987  portNum,
988  condition
989  );
990  }
991 
992  void FprimeFramerComponentBase ::
993  m_p_dataIn_in(
994  Fw::PassiveComponentBase* callComp,
995  FwIndexType portNum,
996  Fw::Buffer& data,
997  const ComCfg::FrameContext& context
998  )
999  {
1000  FW_ASSERT(callComp != nullptr);
1001  FprimeFramerComponentBase* compPtr = static_cast<FprimeFramerComponentBase*>(callComp);
1002  compPtr->dataIn_handlerBase(
1003  portNum,
1004  data,
1005  context
1006  );
1007  }
1008 
1009  void FprimeFramerComponentBase ::
1010  m_p_dataReturnIn_in(
1011  Fw::PassiveComponentBase* callComp,
1012  FwIndexType portNum,
1013  Fw::Buffer& data,
1014  const ComCfg::FrameContext& context
1015  )
1016  {
1017  FW_ASSERT(callComp != nullptr);
1018  FprimeFramerComponentBase* compPtr = static_cast<FprimeFramerComponentBase*>(callComp);
1019  compPtr->dataReturnIn_handlerBase(
1020  portNum,
1021  data,
1022  context
1023  );
1024  }
1025 
1026 #if !FW_DIRECT_PORT_CALLS
1027 
1028  // ----------------------------------------------------------------------
1029  // Invocation functions for special output ports
1030  // ----------------------------------------------------------------------
1031 
1032  void FprimeFramerComponentBase ::
1033  logOut_out(
1034  FwIndexType portNum,
1035  FwEventIdType id,
1036  Fw::Time& timeTag,
1037  const Fw::LogSeverity& severity,
1038  Fw::LogBuffer& args
1039  ) const
1040  {
1041  FW_ASSERT(
1042  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1043  static_cast<FwAssertArgType>(portNum)
1044  );
1045 
1046  FW_ASSERT(
1047  this->m_logOut_OutputPort[portNum].isConnected(),
1048  static_cast<FwAssertArgType>(portNum)
1049  );
1050  this->m_logOut_OutputPort[portNum].invoke(
1051  id,
1052  timeTag,
1053  severity,
1054  args
1055  );
1056  }
1057 
1058 #if FW_ENABLE_TEXT_LOGGING
1059 
1060  void FprimeFramerComponentBase ::
1061  logTextOut_out(
1062  FwIndexType portNum,
1063  FwEventIdType id,
1064  Fw::Time& timeTag,
1065  const Fw::LogSeverity& severity,
1066  Fw::TextLogString& text
1067  ) const
1068  {
1069  FW_ASSERT(
1070  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1071  static_cast<FwAssertArgType>(portNum)
1072  );
1073 
1074  FW_ASSERT(
1075  this->m_logTextOut_OutputPort[portNum].isConnected(),
1076  static_cast<FwAssertArgType>(portNum)
1077  );
1078  this->m_logTextOut_OutputPort[portNum].invoke(
1079  id,
1080  timeTag,
1081  severity,
1082  text
1083  );
1084  }
1085 
1086 #endif
1087 
1088  void FprimeFramerComponentBase ::
1089  timeCaller_out(
1090  FwIndexType portNum,
1091  Fw::Time& time
1092  ) const
1093  {
1094  FW_ASSERT(
1095  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1096  static_cast<FwAssertArgType>(portNum)
1097  );
1098 
1099  FW_ASSERT(
1100  this->m_timeCaller_OutputPort[portNum].isConnected(),
1101  static_cast<FwAssertArgType>(portNum)
1102  );
1103  this->m_timeCaller_OutputPort[portNum].invoke(
1104  time
1105  );
1106  }
1107 
1108 #endif
1109 
1110 }
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
Serialization/Deserialization operation was successful.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
PlatformSizeType FwSizeType
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
I32 FwEnumStoreType
Auto-generated base for FprimeFramer component.
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void log_WARNING_HI_NoBufferAvailable_ThrottleClear()
Reset throttle value for NoBufferAvailable.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
static constexpr FwIndexType getNum_comStatusIn_InputPorts()
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
static constexpr FwIndexType getNum_logOut_OutputPorts()
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum) const
void addCallPort(InputSuccessConditionPort *callPort)
Register an input port.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
void init()
Object initializer.
Definition: ObjBase.cpp:24
SerializeStatus
forward declaration for string
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
Fw::Buffer bufferAllocate_out(FwIndexType portNum, FwSizeType size) const
Invoke output port bufferAllocate.
FwIdType FwEventIdType
The type of an event identifier.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port connection.
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
virtual ~FprimeFramerComponentBase()
Destroy FprimeFramerComponentBase object.
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition) const
Invoke output port comStatusOut.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
void invoke(Fw::Success &condition) const
Invoke a port connection.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port connection.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
A serious but recoverable event.
void init()
Initialization function.
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
bool isConnected_bufferAllocate_OutputPort(FwIndexType portNum) const
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
static constexpr FwIndexType getNum_bufferAllocate_OutputPorts()
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void setPortNum(FwIndexType portNum)
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
Fw::Buffer invoke(FwSizeType size) const
void init()
Initialization function.
void init()
Initialization function.
No buffer was available to hold the frame, which was dropped.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
FprimeFramerComponentBase(const char *compName="")
Construct FprimeFramerComponentBase object.
PlatformIndexType FwIndexType
static constexpr FwIndexType getNum_dataOut_OutputPorts()
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
static constexpr FwIndexType getNum_bufferDeallocate_OutputPorts()
Type used to pass context info between components during framing/deframing.
void init()
Initialization function.
RateGroupDivider component implementation.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port bufferDeallocate.
Implementation of malloc based allocator.
void init()
Initialization function.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Success/Failure.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
static constexpr FwIndexType getNum_dataIn_InputPorts()