F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FrameAccumulatorComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FrameAccumulatorComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for FrameAccumulator 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  // Connect input port dataIn
27  for (
28  FwIndexType port = 0;
29  port < static_cast<FwIndexType>(this->getNum_dataIn_InputPorts());
30  port++
31  ) {
32  this->m_dataIn_InputPort[port].init();
33  this->m_dataIn_InputPort[port].addCallComp(
34  this,
35  m_p_dataIn_in
36  );
37  this->m_dataIn_InputPort[port].setPortNum(port);
38 
39 #if FW_OBJECT_NAMES == 1
40  Fw::ObjectName portName;
41  portName.format(
42  "%s_dataIn_InputPort[%" PRI_FwIndexType "]",
43  this->m_objName.toChar(),
44  port
45  );
46  this->m_dataIn_InputPort[port].setObjName(portName.toChar());
47 #endif
48  }
49 
50  // Connect input port dataReturnIn
51  for (
52  FwIndexType port = 0;
53  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
54  port++
55  ) {
56  this->m_dataReturnIn_InputPort[port].init();
57  this->m_dataReturnIn_InputPort[port].addCallComp(
58  this,
59  m_p_dataReturnIn_in
60  );
61  this->m_dataReturnIn_InputPort[port].setPortNum(port);
62 
63 #if FW_OBJECT_NAMES == 1
64  Fw::ObjectName portName;
65  portName.format(
66  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
67  this->m_objName.toChar(),
68  port
69  );
70  this->m_dataReturnIn_InputPort[port].setObjName(portName.toChar());
71 #endif
72  }
73 
74  // Connect output port logOut
75  for (
76  FwIndexType port = 0;
77  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
78  port++
79  ) {
80  this->m_logOut_OutputPort[port].init();
81 
82 #if FW_OBJECT_NAMES == 1
83  Fw::ObjectName portName;
84  portName.format(
85  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
86  this->m_objName.toChar(),
87  port
88  );
89  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
90 #endif
91  }
92 
93 #if FW_ENABLE_TEXT_LOGGING == 1
94  // Connect output port logTextOut
95  for (
96  FwIndexType port = 0;
97  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
98  port++
99  ) {
100  this->m_logTextOut_OutputPort[port].init();
101 
102 #if FW_OBJECT_NAMES == 1
103  Fw::ObjectName portName;
104  portName.format(
105  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
106  this->m_objName.toChar(),
107  port
108  );
109  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
110 #endif
111  }
112 #endif
113 
114  // Connect output port timeCaller
115  for (
116  FwIndexType port = 0;
117  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
118  port++
119  ) {
120  this->m_timeCaller_OutputPort[port].init();
121 
122 #if FW_OBJECT_NAMES == 1
123  Fw::ObjectName portName;
124  portName.format(
125  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
126  this->m_objName.toChar(),
127  port
128  );
129  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
130 #endif
131  }
132 
133  // Connect output port bufferAllocate
134  for (
135  FwIndexType port = 0;
136  port < static_cast<FwIndexType>(this->getNum_bufferAllocate_OutputPorts());
137  port++
138  ) {
139  this->m_bufferAllocate_OutputPort[port].init();
140 
141 #if FW_OBJECT_NAMES == 1
142  Fw::ObjectName portName;
143  portName.format(
144  "%s_bufferAllocate_OutputPort[%" PRI_FwIndexType "]",
145  this->m_objName.toChar(),
146  port
147  );
148  this->m_bufferAllocate_OutputPort[port].setObjName(portName.toChar());
149 #endif
150  }
151 
152  // Connect output port bufferDeallocate
153  for (
154  FwIndexType port = 0;
155  port < static_cast<FwIndexType>(this->getNum_bufferDeallocate_OutputPorts());
156  port++
157  ) {
158  this->m_bufferDeallocate_OutputPort[port].init();
159 
160 #if FW_OBJECT_NAMES == 1
161  Fw::ObjectName portName;
162  portName.format(
163  "%s_bufferDeallocate_OutputPort[%" PRI_FwIndexType "]",
164  this->m_objName.toChar(),
165  port
166  );
167  this->m_bufferDeallocate_OutputPort[port].setObjName(portName.toChar());
168 #endif
169  }
170 
171  // Connect output port dataOut
172  for (
173  FwIndexType port = 0;
174  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
175  port++
176  ) {
177  this->m_dataOut_OutputPort[port].init();
178 
179 #if FW_OBJECT_NAMES == 1
180  Fw::ObjectName portName;
181  portName.format(
182  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
183  this->m_objName.toChar(),
184  port
185  );
186  this->m_dataOut_OutputPort[port].setObjName(portName.toChar());
187 #endif
188  }
189 
190  // Connect output port dataReturnOut
191  for (
192  FwIndexType port = 0;
193  port < static_cast<FwIndexType>(this->getNum_dataReturnOut_OutputPorts());
194  port++
195  ) {
196  this->m_dataReturnOut_OutputPort[port].init();
197 
198 #if FW_OBJECT_NAMES == 1
199  Fw::ObjectName portName;
200  portName.format(
201  "%s_dataReturnOut_OutputPort[%" PRI_FwIndexType "]",
202  this->m_objName.toChar(),
203  port
204  );
205  this->m_dataReturnOut_OutputPort[port].setObjName(portName.toChar());
206 #endif
207  }
208  }
209 
210  // ----------------------------------------------------------------------
211  // Getters for typed input ports
212  // ----------------------------------------------------------------------
213 
216  {
217  FW_ASSERT(
218  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
219  static_cast<FwAssertArgType>(portNum)
220  );
221 
222  return &this->m_dataIn_InputPort[portNum];
223  }
224 
227  {
228  FW_ASSERT(
229  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
230  static_cast<FwAssertArgType>(portNum)
231  );
232 
233  return &this->m_dataReturnIn_InputPort[portNum];
234  }
235 
236  // ----------------------------------------------------------------------
237  // Connect input ports to special output ports
238  // ----------------------------------------------------------------------
239 
242  FwIndexType portNum,
243  Fw::InputLogPort* port
244  )
245  {
246  FW_ASSERT(
247  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
248  static_cast<FwAssertArgType>(portNum)
249  );
250 
251  this->m_logOut_OutputPort[portNum].addCallPort(port);
252  }
253 
254 #if FW_ENABLE_TEXT_LOGGING == 1
255 
256  void FrameAccumulatorComponentBase ::
257  set_logTextOut_OutputPort(
258  FwIndexType portNum,
260  )
261  {
262  FW_ASSERT(
263  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
264  static_cast<FwAssertArgType>(portNum)
265  );
266 
267  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
268  }
269 
270 #endif
271 
274  FwIndexType portNum,
275  Fw::InputTimePort* port
276  )
277  {
278  FW_ASSERT(
279  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
280  static_cast<FwAssertArgType>(portNum)
281  );
282 
283  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
284  }
285 
286  // ----------------------------------------------------------------------
287  // Connect typed input ports to typed output ports
288  // ----------------------------------------------------------------------
289 
292  FwIndexType portNum,
294  )
295  {
296  FW_ASSERT(
297  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
298  static_cast<FwAssertArgType>(portNum)
299  );
300 
301  this->m_bufferAllocate_OutputPort[portNum].addCallPort(port);
302  }
303 
306  FwIndexType portNum,
308  )
309  {
310  FW_ASSERT(
311  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
312  static_cast<FwAssertArgType>(portNum)
313  );
314 
315  this->m_bufferDeallocate_OutputPort[portNum].addCallPort(port);
316  }
317 
320  FwIndexType portNum,
322  )
323  {
324  FW_ASSERT(
325  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
326  static_cast<FwAssertArgType>(portNum)
327  );
328 
329  this->m_dataOut_OutputPort[portNum].addCallPort(port);
330  }
331 
334  FwIndexType portNum,
336  )
337  {
338  FW_ASSERT(
339  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
340  static_cast<FwAssertArgType>(portNum)
341  );
342 
343  this->m_dataReturnOut_OutputPort[portNum].addCallPort(port);
344  }
345 
346 #if FW_PORT_SERIALIZATION
347 
348  // ----------------------------------------------------------------------
349  // Connect serial input ports to special output ports
350  // ----------------------------------------------------------------------
351 
354  FwIndexType portNum,
355  Fw::InputSerializePort* port
356  )
357  {
358  FW_ASSERT(
359  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
360  static_cast<FwAssertArgType>(portNum)
361  );
362 
363  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
364  }
365 
366 #if FW_ENABLE_TEXT_LOGGING == 1
367 
368  void FrameAccumulatorComponentBase ::
369  set_logTextOut_OutputPort(
370  FwIndexType portNum,
371  Fw::InputSerializePort* port
372  )
373  {
374  FW_ASSERT(
375  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
376  static_cast<FwAssertArgType>(portNum)
377  );
378 
379  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
380  }
381 
382 #endif
383 
386  FwIndexType portNum,
387  Fw::InputSerializePort* port
388  )
389  {
390  FW_ASSERT(
391  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
392  static_cast<FwAssertArgType>(portNum)
393  );
394 
395  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
396  }
397 
398 #endif
399 
400 #if FW_PORT_SERIALIZATION
401 
402  // ----------------------------------------------------------------------
403  // Connect serial input ports to typed output ports
404  // ----------------------------------------------------------------------
405 
408  FwIndexType portNum,
409  Fw::InputSerializePort* port
410  )
411  {
412  FW_ASSERT(
413  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
414  static_cast<FwAssertArgType>(portNum)
415  );
416 
417  this->m_bufferDeallocate_OutputPort[portNum].registerSerialPort(port);
418  }
419 
422  FwIndexType portNum,
423  Fw::InputSerializePort* port
424  )
425  {
426  FW_ASSERT(
427  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
428  static_cast<FwAssertArgType>(portNum)
429  );
430 
431  this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
432  }
433 
436  FwIndexType portNum,
437  Fw::InputSerializePort* port
438  )
439  {
440  FW_ASSERT(
441  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
442  static_cast<FwAssertArgType>(portNum)
443  );
444 
445  this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
446  }
447 
448 #endif
449 
450  // ----------------------------------------------------------------------
451  // Component construction and destruction
452  // ----------------------------------------------------------------------
453 
455  FrameAccumulatorComponentBase(const char* compName) :
456  Fw::PassiveComponentBase(compName)
457  {
458 
459  }
460 
463  {
464 
465  }
466 
467  // ----------------------------------------------------------------------
468  // Connection status queries for special output ports
469  // ----------------------------------------------------------------------
470 
473  {
474  FW_ASSERT(
475  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
476  static_cast<FwAssertArgType>(portNum)
477  );
478 
479  return this->m_logOut_OutputPort[portNum].isConnected();
480  }
481 
482 #if FW_ENABLE_TEXT_LOGGING == 1
483 
484  bool FrameAccumulatorComponentBase ::
485  isConnected_logTextOut_OutputPort(FwIndexType portNum)
486  {
487  FW_ASSERT(
488  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
489  static_cast<FwAssertArgType>(portNum)
490  );
491 
492  return this->m_logTextOut_OutputPort[portNum].isConnected();
493  }
494 
495 #endif
496 
499  {
500  FW_ASSERT(
501  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
502  static_cast<FwAssertArgType>(portNum)
503  );
504 
505  return this->m_timeCaller_OutputPort[portNum].isConnected();
506  }
507 
508  // ----------------------------------------------------------------------
509  // Connection status queries for typed output ports
510  // ----------------------------------------------------------------------
511 
514  {
515  FW_ASSERT(
516  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
517  static_cast<FwAssertArgType>(portNum)
518  );
519 
520  return this->m_bufferAllocate_OutputPort[portNum].isConnected();
521  }
522 
525  {
526  FW_ASSERT(
527  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
528  static_cast<FwAssertArgType>(portNum)
529  );
530 
531  return this->m_bufferDeallocate_OutputPort[portNum].isConnected();
532  }
533 
536  {
537  FW_ASSERT(
538  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
539  static_cast<FwAssertArgType>(portNum)
540  );
541 
542  return this->m_dataOut_OutputPort[portNum].isConnected();
543  }
544 
547  {
548  FW_ASSERT(
549  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
550  static_cast<FwAssertArgType>(portNum)
551  );
552 
553  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
554  }
555 
556  // ----------------------------------------------------------------------
557  // Port handler base-class functions for typed input ports
558  //
559  // Call these functions directly to bypass the corresponding ports
560  // ----------------------------------------------------------------------
561 
564  FwIndexType portNum,
565  Fw::Buffer& data,
566  const ComCfg::FrameContext& context
567  )
568  {
569  // Make sure port number is valid
570  FW_ASSERT(
571  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
572  static_cast<FwAssertArgType>(portNum)
573  );
574 
575  // Lock guard mutex before calling
576  this->lock();
577 
578  // Call handler function
579  this->dataIn_handler(
580  portNum,
581  data,
582  context
583  );
584 
585  // Unlock guard mutex
586  this->unLock();
587  }
588 
591  FwIndexType portNum,
592  Fw::Buffer& data,
593  const ComCfg::FrameContext& context
594  )
595  {
596  // Make sure port number is valid
597  FW_ASSERT(
598  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
599  static_cast<FwAssertArgType>(portNum)
600  );
601 
602  // Call handler function
603  this->dataReturnIn_handler(
604  portNum,
605  data,
606  context
607  );
608  }
609 
610  // ----------------------------------------------------------------------
611  // Invocation functions for typed output ports
612  // ----------------------------------------------------------------------
613 
616  FwIndexType portNum,
617  FwSizeType size
618  )
619  {
620  FW_ASSERT(
621  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
622  static_cast<FwAssertArgType>(portNum)
623  );
624 
625  FW_ASSERT(
626  this->m_bufferAllocate_OutputPort[portNum].isConnected(),
627  static_cast<FwAssertArgType>(portNum)
628  );
629  return this->m_bufferAllocate_OutputPort[portNum].invoke(
630  size
631  );
632  }
633 
636  FwIndexType portNum,
637  Fw::Buffer& fwBuffer
638  )
639  {
640  FW_ASSERT(
641  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
642  static_cast<FwAssertArgType>(portNum)
643  );
644 
645  FW_ASSERT(
646  this->m_bufferDeallocate_OutputPort[portNum].isConnected(),
647  static_cast<FwAssertArgType>(portNum)
648  );
649  this->m_bufferDeallocate_OutputPort[portNum].invoke(
650  fwBuffer
651  );
652  }
653 
656  FwIndexType portNum,
657  Fw::Buffer& data,
658  const ComCfg::FrameContext& context
659  )
660  {
661  FW_ASSERT(
662  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
663  static_cast<FwAssertArgType>(portNum)
664  );
665 
666  FW_ASSERT(
667  this->m_dataOut_OutputPort[portNum].isConnected(),
668  static_cast<FwAssertArgType>(portNum)
669  );
670  this->m_dataOut_OutputPort[portNum].invoke(
671  data,
672  context
673  );
674  }
675 
678  FwIndexType portNum,
679  Fw::Buffer& data,
680  const ComCfg::FrameContext& context
681  )
682  {
683  FW_ASSERT(
684  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
685  static_cast<FwAssertArgType>(portNum)
686  );
687 
688  FW_ASSERT(
689  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
690  static_cast<FwAssertArgType>(portNum)
691  );
692  this->m_dataReturnOut_OutputPort[portNum].invoke(
693  data,
694  context
695  );
696  }
697 
698  // ----------------------------------------------------------------------
699  // Event logging functions
700  // ----------------------------------------------------------------------
701 
704  {
705  // Get the time
706  Fw::Time _logTime;
707  if (this->m_timeCaller_OutputPort[0].isConnected()) {
708  this->m_timeCaller_OutputPort[0].invoke(_logTime);
709  }
710 
711  FwEventIdType _id = static_cast<FwEventIdType>(0);
712 
713  _id = this->getIdBase() + EVENTID_NOBUFFERAVAILABLE;
714 
715  // Emit the event on the log port
716  if (this->m_logOut_OutputPort[0].isConnected()) {
717  Fw::LogBuffer _logBuff;
718 
719 #if FW_AMPCS_COMPATIBLE
721  // Serialize the number of arguments
722  _status = _logBuff.serializeFrom(static_cast<U8>(0));
723  FW_ASSERT(
724  _status == Fw::FW_SERIALIZE_OK,
725  static_cast<FwAssertArgType>(_status)
726  );
727 #endif
728 
729  this->m_logOut_OutputPort[0].invoke(
730  _id,
731  _logTime,
733  _logBuff
734  );
735  }
736 
737  // Emit the event on the text log port
738 #if FW_ENABLE_TEXT_LOGGING
739  if (this->m_logTextOut_OutputPort[0].isConnected()) {
740 #if FW_OBJECT_NAMES == 1
741  const char* _formatString =
742  "(%s) %s: Could not allocate a valid buffer to fit the detected frame";
743 #else
744  const char* _formatString =
745  "%s: Could not allocate a valid buffer to fit the detected frame";
746 #endif
747 
748  Fw::TextLogString _logString;
749  _logString.format(
750  _formatString,
751 #if FW_OBJECT_NAMES == 1
752  this->m_objName.toChar(),
753 #endif
754  "NoBufferAvailable "
755  );
756 
757  this->m_logTextOut_OutputPort[0].invoke(
758  _id,
759  _logTime,
761  _logString
762  );
763  }
764 #endif
765  }
766 
769  {
770  // Get the time
771  Fw::Time _logTime;
772  if (this->m_timeCaller_OutputPort[0].isConnected()) {
773  this->m_timeCaller_OutputPort[0].invoke(_logTime);
774  }
775 
776  FwEventIdType _id = static_cast<FwEventIdType>(0);
777 
779 
780  // Emit the event on the log port
781  if (this->m_logOut_OutputPort[0].isConnected()) {
782  Fw::LogBuffer _logBuff;
784 
785 #if FW_AMPCS_COMPATIBLE
786  // Serialize the number of arguments
787  _status = _logBuff.serializeFrom(static_cast<U8>(1));
788  FW_ASSERT(
789  _status == Fw::FW_SERIALIZE_OK,
790  static_cast<FwAssertArgType>(_status)
791  );
792 #endif
793 
794 #if FW_AMPCS_COMPATIBLE
795  // Serialize the argument size
796  _status = _logBuff.serializeFrom(
797  static_cast<U8>(sizeof(FwSizeType))
798  );
799  FW_ASSERT(
800  _status == Fw::FW_SERIALIZE_OK,
801  static_cast<FwAssertArgType>(_status)
802  );
803 #endif
804  _status = _logBuff.serializeFrom(size_out);
805  FW_ASSERT(
806  _status == Fw::FW_SERIALIZE_OK,
807  static_cast<FwAssertArgType>(_status)
808  );
809 
810  this->m_logOut_OutputPort[0].invoke(
811  _id,
812  _logTime,
814  _logBuff
815  );
816  }
817 
818  // Emit the event on the text log port
819 #if FW_ENABLE_TEXT_LOGGING
820  if (this->m_logTextOut_OutputPort[0].isConnected()) {
821 #if FW_OBJECT_NAMES == 1
822  const char* _formatString =
823  "(%s) %s: Reported size_out=%" PRIu64 " exceeds accumulation buffer capacity";
824 #else
825  const char* _formatString =
826  "%s: Reported size_out=%" PRIu64 " exceeds accumulation buffer capacity";
827 #endif
828 
829  Fw::TextLogString _logString;
830  _logString.format(
831  _formatString,
832 #if FW_OBJECT_NAMES == 1
833  this->m_objName.toChar(),
834 #endif
835  "FrameDetectionSizeError ",
836  size_out
837  );
838 
839  this->m_logTextOut_OutputPort[0].invoke(
840  _id,
841  _logTime,
843  _logString
844  );
845  }
846 #endif
847  }
848 
849  // ----------------------------------------------------------------------
850  // Time
851  // ----------------------------------------------------------------------
852 
854  getTime() const
855  {
856  if (this->m_timeCaller_OutputPort[0].isConnected()) {
857  Fw::Time _time;
858  this->m_timeCaller_OutputPort[0].invoke(_time);
859  return _time;
860  }
861  else {
862  return Fw::Time(TimeBase::TB_NONE, 0, 0);
863  }
864  }
865 
866  // ----------------------------------------------------------------------
867  // Mutex operations for guarded ports
868  //
869  // You can override these operations to provide more sophisticated
870  // synchronization
871  // ----------------------------------------------------------------------
872 
875  {
876  this->m_guardedPortMutex.lock();
877  }
878 
881  {
882  this->m_guardedPortMutex.unLock();
883  }
884 
885  // ----------------------------------------------------------------------
886  // Calls for messages received on typed input ports
887  // ----------------------------------------------------------------------
888 
889  void FrameAccumulatorComponentBase ::
890  m_p_dataIn_in(
891  Fw::PassiveComponentBase* callComp,
892  FwIndexType portNum,
893  Fw::Buffer& data,
894  const ComCfg::FrameContext& context
895  )
896  {
897  FW_ASSERT(callComp);
898  FrameAccumulatorComponentBase* compPtr = static_cast<FrameAccumulatorComponentBase*>(callComp);
899  compPtr->dataIn_handlerBase(
900  portNum,
901  data,
902  context
903  );
904  }
905 
906  void FrameAccumulatorComponentBase ::
907  m_p_dataReturnIn_in(
908  Fw::PassiveComponentBase* callComp,
909  FwIndexType portNum,
910  Fw::Buffer& data,
911  const ComCfg::FrameContext& context
912  )
913  {
914  FW_ASSERT(callComp);
915  FrameAccumulatorComponentBase* compPtr = static_cast<FrameAccumulatorComponentBase*>(callComp);
916  compPtr->dataReturnIn_handlerBase(
917  portNum,
918  data,
919  context
920  );
921  }
922 
923 }
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:134
virtual void unLock()
Unlock the guarded mutex.
Fw::Buffer bufferAllocate_out(FwIndexType portNum, FwSizeType size)
Invoke output port bufferAllocate.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
bool isConnected_bufferAllocate_OutputPort(FwIndexType portNum)
PlatformSizeType FwSizeType
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
I32 FwEnumStoreType
bool isConnected_timeCaller_OutputPort(FwIndexType portNum)
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum)
void unLock()
unlock the mutex and assert success
Definition: Mutex.cpp:41
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
static constexpr FwIndexType getNum_dataIn_InputPorts()
No time base has been established (Required)
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataReturnOut.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
void init()
Object initializer.
Definition: ObjBase.cpp:24
static constexpr FwIndexType getNum_bufferDeallocate_OutputPorts()
SerializeStatus
forward declaration for string
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
FwIdType FwEventIdType
The type of an event identifier.
static constexpr FwIndexType getNum_bufferAllocate_OutputPorts()
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:26
void init()
Initialization function.
Definition: TimePortAc.cpp:128
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port interface.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Invoke output port dataOut.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void invoke(Fw::Time &time) const
Invoke a port interface.
Definition: TimePortAc.cpp:147
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port interface.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
static constexpr FwIndexType getNum_dataOut_OutputPorts()
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 bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer)
Invoke output port bufferDeallocate.
void init()
Initialization function.
bool isConnected() const
Definition: PortBase.cpp:38
#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
static constexpr FwIndexType getNum_logOut_OutputPorts()
void setPortNum(FwIndexType portNum)
virtual void lock()
Lock the guarded mutex.
Fw::Buffer invoke(FwSizeType size) const
Invoke a port interface.
void init()
Initialization function.
void init()
Initialization function.
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port interface.
Definition: LogPortAc.cpp:170
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void log_WARNING_HI_FrameDetectionSizeError(FwSizeType size_out) const
bool isConnected_logOut_OutputPort(FwIndexType portNum)
PlatformIndexType FwIndexType
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:157
Type used to pass context info between components during framing/deframing.
Auto-generated base for FrameAccumulator component.
void init()
Initialization function.
RateGroupDivider component implementation.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
FrameAccumulatorComponentBase(const char *compName="")
Construct FrameAccumulatorComponentBase object.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
bool isConnected_dataOut_OutputPort(FwIndexType portNum)
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
Implementation of malloc based allocator.
virtual ~FrameAccumulatorComponentBase()
Destroy FrameAccumulatorComponentBase object.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
void lock()
lock the mutex and assert success
Definition: Mutex.cpp:34
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum)