F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
BufferRepeaterComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title BufferRepeaterComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for BufferRepeater 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 portIn
28  for (
29  FwIndexType port = 0;
30  port < static_cast<FwIndexType>(this->getNum_portIn_InputPorts());
31  port++
32  ) {
33  this->m_portIn_InputPort[port].init();
34  this->m_portIn_InputPort[port].addCallComp(
35  this,
36  m_p_portIn_in
37  );
38  this->m_portIn_InputPort[port].setPortNum(port);
39 
40 #if FW_OBJECT_NAMES == 1
41  Fw::ObjectName portName;
42  portName.format(
43  "%s_portIn_InputPort[%" PRI_FwIndexType "]",
44  this->m_objName.toChar(),
45  port
46  );
47  this->m_portIn_InputPort[port].setObjName(portName.toChar());
48 #endif
49  }
50 #endif
51 
52 #if !FW_DIRECT_PORT_CALLS
53  // Connect output port Log
54  for (
55  FwIndexType port = 0;
56  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
57  port++
58  ) {
59  this->m_Log_OutputPort[port].init();
60 
61 #if FW_OBJECT_NAMES == 1
62  Fw::ObjectName portName;
63  portName.format(
64  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
65  this->m_objName.toChar(),
66  port
67  );
68  this->m_Log_OutputPort[port].setObjName(portName.toChar());
69 #endif
70  }
71 #endif
72 
73 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
74  // Connect output port LogText
75  for (
76  FwIndexType port = 0;
77  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
78  port++
79  ) {
80  this->m_LogText_OutputPort[port].init();
81 
82 #if FW_OBJECT_NAMES == 1
83  Fw::ObjectName portName;
84  portName.format(
85  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
86  this->m_objName.toChar(),
87  port
88  );
89  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
90 #endif
91  }
92 #endif
93 
94 #if !FW_DIRECT_PORT_CALLS
95  // Connect output port Time
96  for (
97  FwIndexType port = 0;
98  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
99  port++
100  ) {
101  this->m_Time_OutputPort[port].init();
102 
103 #if FW_OBJECT_NAMES == 1
104  Fw::ObjectName portName;
105  portName.format(
106  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
107  this->m_objName.toChar(),
108  port
109  );
110  this->m_Time_OutputPort[port].setObjName(portName.toChar());
111 #endif
112  }
113 #endif
114 
115 #if !FW_DIRECT_PORT_CALLS
116  // Connect output port allocate
117  for (
118  FwIndexType port = 0;
119  port < static_cast<FwIndexType>(this->getNum_allocate_OutputPorts());
120  port++
121  ) {
122  this->m_allocate_OutputPort[port].init();
123 
124 #if FW_OBJECT_NAMES == 1
125  Fw::ObjectName portName;
126  portName.format(
127  "%s_allocate_OutputPort[%" PRI_FwIndexType "]",
128  this->m_objName.toChar(),
129  port
130  );
131  this->m_allocate_OutputPort[port].setObjName(portName.toChar());
132 #endif
133  }
134 #endif
135 
136 #if !FW_DIRECT_PORT_CALLS
137  // Connect output port deallocate
138  for (
139  FwIndexType port = 0;
140  port < static_cast<FwIndexType>(this->getNum_deallocate_OutputPorts());
141  port++
142  ) {
143  this->m_deallocate_OutputPort[port].init();
144 
145 #if FW_OBJECT_NAMES == 1
146  Fw::ObjectName portName;
147  portName.format(
148  "%s_deallocate_OutputPort[%" PRI_FwIndexType "]",
149  this->m_objName.toChar(),
150  port
151  );
152  this->m_deallocate_OutputPort[port].setObjName(portName.toChar());
153 #endif
154  }
155 #endif
156 
157 #if !FW_DIRECT_PORT_CALLS
158  // Connect output port portOut
159  for (
160  FwIndexType port = 0;
161  port < static_cast<FwIndexType>(this->getNum_portOut_OutputPorts());
162  port++
163  ) {
164  this->m_portOut_OutputPort[port].init();
165 
166 #if FW_OBJECT_NAMES == 1
167  Fw::ObjectName portName;
168  portName.format(
169  "%s_portOut_OutputPort[%" PRI_FwIndexType "]",
170  this->m_objName.toChar(),
171  port
172  );
173  this->m_portOut_OutputPort[port].setObjName(portName.toChar());
174 #endif
175  }
176 #endif
177  }
178 
179 #if !FW_DIRECT_PORT_CALLS
180 
181  // ----------------------------------------------------------------------
182  // Getters for typed input ports
183  // ----------------------------------------------------------------------
184 
187  {
188  FW_ASSERT(
189  (0 <= portNum) && (portNum < this->getNum_portIn_InputPorts()),
190  static_cast<FwAssertArgType>(portNum)
191  );
192 
193  return &this->m_portIn_InputPort[portNum];
194  }
195 
196 #endif
197 
198 #if !FW_DIRECT_PORT_CALLS
199 
200  // ----------------------------------------------------------------------
201  // Connect input ports to special output ports
202  // ----------------------------------------------------------------------
203 
206  FwIndexType portNum,
207  Fw::InputLogPort* port
208  )
209  {
210  FW_ASSERT(
211  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
212  static_cast<FwAssertArgType>(portNum)
213  );
214 
215  this->m_Log_OutputPort[portNum].addCallPort(port);
216  }
217 
218 #if FW_ENABLE_TEXT_LOGGING == 1
219 
220  void BufferRepeaterComponentBase ::
221  set_LogText_OutputPort(
222  FwIndexType portNum,
224  )
225  {
226  FW_ASSERT(
227  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
228  static_cast<FwAssertArgType>(portNum)
229  );
230 
231  this->m_LogText_OutputPort[portNum].addCallPort(port);
232  }
233 
234 #endif
235 
238  FwIndexType portNum,
239  Fw::InputTimePort* port
240  )
241  {
242  FW_ASSERT(
243  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
244  static_cast<FwAssertArgType>(portNum)
245  );
246 
247  this->m_Time_OutputPort[portNum].addCallPort(port);
248  }
249 
250 #endif
251 
252 #if !FW_DIRECT_PORT_CALLS
253 
254  // ----------------------------------------------------------------------
255  // Connect typed input ports to typed output ports
256  // ----------------------------------------------------------------------
257 
260  FwIndexType portNum,
262  )
263  {
264  FW_ASSERT(
265  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
266  static_cast<FwAssertArgType>(portNum)
267  );
268 
269  this->m_allocate_OutputPort[portNum].addCallPort(port);
270  }
271 
274  FwIndexType portNum,
276  )
277  {
278  FW_ASSERT(
279  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
280  static_cast<FwAssertArgType>(portNum)
281  );
282 
283  this->m_deallocate_OutputPort[portNum].addCallPort(port);
284  }
285 
288  FwIndexType portNum,
290  )
291  {
292  FW_ASSERT(
293  (0 <= portNum) && (portNum < this->getNum_portOut_OutputPorts()),
294  static_cast<FwAssertArgType>(portNum)
295  );
296 
297  this->m_portOut_OutputPort[portNum].addCallPort(port);
298  }
299 
300 #endif
301 
302 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
303 
304  // ----------------------------------------------------------------------
305  // Connect serial input ports to special output ports
306  // ----------------------------------------------------------------------
307 
310  FwIndexType portNum,
311  Fw::InputSerializePort* port
312  )
313  {
314  FW_ASSERT(
315  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
316  static_cast<FwAssertArgType>(portNum)
317  );
318 
319  this->m_Log_OutputPort[portNum].registerSerialPort(port);
320  }
321 
322 #if FW_ENABLE_TEXT_LOGGING == 1
323 
324  void BufferRepeaterComponentBase ::
325  set_LogText_OutputPort(
326  FwIndexType portNum,
327  Fw::InputSerializePort* port
328  )
329  {
330  FW_ASSERT(
331  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
332  static_cast<FwAssertArgType>(portNum)
333  );
334 
335  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
336  }
337 
338 #endif
339 
342  FwIndexType portNum,
343  Fw::InputSerializePort* port
344  )
345  {
346  FW_ASSERT(
347  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
348  static_cast<FwAssertArgType>(portNum)
349  );
350 
351  this->m_Time_OutputPort[portNum].registerSerialPort(port);
352  }
353 
354 #endif
355 
356 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
357 
358  // ----------------------------------------------------------------------
359  // Connect serial input ports to typed output ports
360  // ----------------------------------------------------------------------
361 
364  FwIndexType portNum,
365  Fw::InputSerializePort* port
366  )
367  {
368  FW_ASSERT(
369  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
370  static_cast<FwAssertArgType>(portNum)
371  );
372 
373  this->m_deallocate_OutputPort[portNum].registerSerialPort(port);
374  }
375 
378  FwIndexType portNum,
379  Fw::InputSerializePort* port
380  )
381  {
382  FW_ASSERT(
383  (0 <= portNum) && (portNum < this->getNum_portOut_OutputPorts()),
384  static_cast<FwAssertArgType>(portNum)
385  );
386 
387  this->m_portOut_OutputPort[portNum].registerSerialPort(port);
388  }
389 
390 #endif
391 
392  // ----------------------------------------------------------------------
393  // Component construction and destruction
394  // ----------------------------------------------------------------------
395 
397  BufferRepeaterComponentBase(const char* compName) :
398  Fw::PassiveComponentBase(compName)
399  {
400 
401  }
402 
405  {
406 
407  }
408 
409 #if !FW_DIRECT_PORT_CALLS
410 
411  // ----------------------------------------------------------------------
412  // Connection status queries for special output ports
413  // ----------------------------------------------------------------------
414 
417  {
418  FW_ASSERT(
419  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
420  static_cast<FwAssertArgType>(portNum)
421  );
422 
423  return this->m_Log_OutputPort[portNum].isConnected();
424  }
425 
426 #if FW_ENABLE_TEXT_LOGGING == 1
427 
428  bool BufferRepeaterComponentBase ::
429  isConnected_LogText_OutputPort(FwIndexType portNum) const
430  {
431  FW_ASSERT(
432  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
433  static_cast<FwAssertArgType>(portNum)
434  );
435 
436  return this->m_LogText_OutputPort[portNum].isConnected();
437  }
438 
439 #endif
440 
443  {
444  FW_ASSERT(
445  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
446  static_cast<FwAssertArgType>(portNum)
447  );
448 
449  return this->m_Time_OutputPort[portNum].isConnected();
450  }
451 
452 #endif
453 
454 #if !FW_DIRECT_PORT_CALLS
455 
456  // ----------------------------------------------------------------------
457  // Connection status queries for typed output ports
458  // ----------------------------------------------------------------------
459 
462  {
463  FW_ASSERT(
464  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
465  static_cast<FwAssertArgType>(portNum)
466  );
467 
468  return this->m_allocate_OutputPort[portNum].isConnected();
469  }
470 
473  {
474  FW_ASSERT(
475  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
476  static_cast<FwAssertArgType>(portNum)
477  );
478 
479  return this->m_deallocate_OutputPort[portNum].isConnected();
480  }
481 
484  {
485  FW_ASSERT(
486  (0 <= portNum) && (portNum < this->getNum_portOut_OutputPorts()),
487  static_cast<FwAssertArgType>(portNum)
488  );
489 
490  return this->m_portOut_OutputPort[portNum].isConnected();
491  }
492 
493 #endif
494 
495  // ----------------------------------------------------------------------
496  // Port handler base-class functions for typed input ports
497  //
498  // Call these functions directly to bypass the corresponding ports
499  // ----------------------------------------------------------------------
500 
503  FwIndexType portNum,
504  Fw::Buffer& fwBuffer
505  )
506  {
507  // Make sure port number is valid
508  FW_ASSERT(
509  (0 <= portNum) && (portNum < this->getNum_portIn_InputPorts()),
510  static_cast<FwAssertArgType>(portNum)
511  );
512 
513  // Call handler function
514  this->portIn_handler(
515  portNum,
516  fwBuffer
517  );
518  }
519 
520 #if !FW_DIRECT_PORT_CALLS
521 
522  // ----------------------------------------------------------------------
523  // Invocation functions for typed output ports
524  // ----------------------------------------------------------------------
525 
528  FwIndexType portNum,
529  FwSizeType size
530  ) const
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_allocate_OutputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  FW_ASSERT(
538  this->m_allocate_OutputPort[portNum].isConnected(),
539  static_cast<FwAssertArgType>(portNum)
540  );
541  return this->m_allocate_OutputPort[portNum].invoke(
542  size
543  );
544  }
545 
548  FwIndexType portNum,
549  Fw::Buffer& fwBuffer
550  ) const
551  {
552  FW_ASSERT(
553  (0 <= portNum) && (portNum < this->getNum_deallocate_OutputPorts()),
554  static_cast<FwAssertArgType>(portNum)
555  );
556 
557  FW_ASSERT(
558  this->m_deallocate_OutputPort[portNum].isConnected(),
559  static_cast<FwAssertArgType>(portNum)
560  );
561  this->m_deallocate_OutputPort[portNum].invoke(
562  fwBuffer
563  );
564  }
565 
568  FwIndexType portNum,
569  Fw::Buffer& fwBuffer
570  ) const
571  {
572  FW_ASSERT(
573  (0 <= portNum) && (portNum < this->getNum_portOut_OutputPorts()),
574  static_cast<FwAssertArgType>(portNum)
575  );
576 
577  FW_ASSERT(
578  this->m_portOut_OutputPort[portNum].isConnected(),
579  static_cast<FwAssertArgType>(portNum)
580  );
581  this->m_portOut_OutputPort[portNum].invoke(
582  fwBuffer
583  );
584  }
585 
586 #endif
587 
588  // ----------------------------------------------------------------------
589  // Event logging functions
590  // ----------------------------------------------------------------------
591 
594  I32 port,
595  FwSizeType size
596  ) const
597  {
598  // Get the time
599  Fw::Time _logTime;
600  if (this->isConnected_Time_OutputPort(0)) {
601  this->Time_out(0, _logTime);
602  }
603 
605 
606  // Emit the event on the log port
607  if (this->isConnected_Log_OutputPort(0)) {
608  Fw::LogBuffer _logBuff;
610 
611 #if FW_AMPCS_COMPATIBLE
612  // Serialize the number of arguments
613  _status = _logBuff.serializeFrom(static_cast<U8>(2));
614  FW_ASSERT(
615  _status == Fw::FW_SERIALIZE_OK,
616  static_cast<FwAssertArgType>(_status)
617  );
618 #endif
619 
620 #if FW_AMPCS_COMPATIBLE
621  // Serialize the argument size
622  _status = _logBuff.serializeFrom(
623  static_cast<U8>(sizeof(I32))
624  );
625  FW_ASSERT(
626  _status == Fw::FW_SERIALIZE_OK,
627  static_cast<FwAssertArgType>(_status)
628  );
629 #endif
630  _status = _logBuff.serializeFrom(port);
631  FW_ASSERT(
632  _status == Fw::FW_SERIALIZE_OK,
633  static_cast<FwAssertArgType>(_status)
634  );
635 
636 #if FW_AMPCS_COMPATIBLE
637  // Serialize the argument size
638  _status = _logBuff.serializeFrom(
639  static_cast<U8>(sizeof(FwSizeType))
640  );
641  FW_ASSERT(
642  _status == Fw::FW_SERIALIZE_OK,
643  static_cast<FwAssertArgType>(_status)
644  );
645 #endif
646  _status = _logBuff.serializeFrom(size);
647  FW_ASSERT(
648  _status == Fw::FW_SERIALIZE_OK,
649  static_cast<FwAssertArgType>(_status)
650  );
651 
652  this->Log_out(
653  0,
654  _id,
655  _logTime,
657  _logBuff
658  );
659  }
660 
661  // Emit the event on the text log port
662 #if FW_ENABLE_TEXT_LOGGING
663  if (this->isConnected_LogText_OutputPort(0)) {
664 #if FW_OBJECT_NAMES == 1
665  const char* _formatString =
666  "(%s) %s: Failed to allocate %" PRIi32 " byte buffer for port %" PRIu64 "";
667 #else
668  const char* _formatString =
669  "%s: Failed to allocate %" PRIi32 " byte buffer for port %" PRIu64 "";
670 #endif
671 
672  Fw::TextLogString _logString;
673  _logString.format(
674  _formatString,
675 #if FW_OBJECT_NAMES == 1
676  this->m_objName.toChar(),
677 #endif
678  "AllocationSoftFailure ",
679  port,
680  size
681  );
682 
683  this->LogText_out(
684  0,
685  _id,
686  _logTime,
688  _logString
689  );
690  }
691 #endif
692  }
693 
696  I32 port,
697  FwSizeType size
698  ) const
699  {
700  // Get the time
701  Fw::Time _logTime;
702  if (this->isConnected_Time_OutputPort(0)) {
703  this->Time_out(0, _logTime);
704  }
705 
707 
708  // Emit the event on the log port
709  if (this->isConnected_Log_OutputPort(0)) {
710  Fw::LogBuffer _logBuff;
712 
713 #if FW_AMPCS_COMPATIBLE
714  // Serialize the number of arguments
715  _status = _logBuff.serializeFrom(static_cast<U8>(2 + 1));
716  FW_ASSERT(
717  _status == Fw::FW_SERIALIZE_OK,
718  static_cast<FwAssertArgType>(_status)
719  );
720 
721  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
722  _status = _logBuff.serializeFrom(static_cast<U8>(4));
723  FW_ASSERT(
724  _status == Fw::FW_SERIALIZE_OK,
725  static_cast<FwAssertArgType>(_status)
726  );
727 
728  _status = _logBuff.serializeFrom(static_cast<U32>(0));
729  FW_ASSERT(
730  _status == Fw::FW_SERIALIZE_OK,
731  static_cast<FwAssertArgType>(_status)
732  );
733 #endif
734 
735 #if FW_AMPCS_COMPATIBLE
736  // Serialize the argument size
737  _status = _logBuff.serializeFrom(
738  static_cast<U8>(sizeof(I32))
739  );
740  FW_ASSERT(
741  _status == Fw::FW_SERIALIZE_OK,
742  static_cast<FwAssertArgType>(_status)
743  );
744 #endif
745  _status = _logBuff.serializeFrom(port);
746  FW_ASSERT(
747  _status == Fw::FW_SERIALIZE_OK,
748  static_cast<FwAssertArgType>(_status)
749  );
750 
751 #if FW_AMPCS_COMPATIBLE
752  // Serialize the argument size
753  _status = _logBuff.serializeFrom(
754  static_cast<U8>(sizeof(FwSizeType))
755  );
756  FW_ASSERT(
757  _status == Fw::FW_SERIALIZE_OK,
758  static_cast<FwAssertArgType>(_status)
759  );
760 #endif
761  _status = _logBuff.serializeFrom(size);
762  FW_ASSERT(
763  _status == Fw::FW_SERIALIZE_OK,
764  static_cast<FwAssertArgType>(_status)
765  );
766 
767  this->Log_out(
768  0,
769  _id,
770  _logTime,
772  _logBuff
773  );
774  }
775 
776  // Emit the event on the text log port
777 #if FW_ENABLE_TEXT_LOGGING
778  if (this->isConnected_LogText_OutputPort(0)) {
779 #if FW_OBJECT_NAMES == 1
780  const char* _formatString =
781  "(%s) %s: Failed to allocate %" PRIi32 " byte buffer for port %" PRIu64 "";
782 #else
783  const char* _formatString =
784  "%s: Failed to allocate %" PRIi32 " byte buffer for port %" PRIu64 "";
785 #endif
786 
787  Fw::TextLogString _logString;
788  _logString.format(
789  _formatString,
790 #if FW_OBJECT_NAMES == 1
791  this->m_objName.toChar(),
792 #endif
793  "AllocationHardFailure ",
794  port,
795  size
796  );
797 
798  this->LogText_out(
799  0,
800  _id,
801  _logTime,
803  _logString
804  );
805  }
806 #endif
807  }
808 
809  // ----------------------------------------------------------------------
810  // Time
811  // ----------------------------------------------------------------------
812 
814  getTime() const
815  {
816  if (this->isConnected_Time_OutputPort(0)) {
817  Fw::Time _time;
818  this->Time_out(0, _time);
819  return _time;
820  }
821  else {
822  return Fw::Time(TimeBase::TB_NONE, 0, 0);
823  }
824  }
825 
826  // ----------------------------------------------------------------------
827  // Calls for messages received on typed input ports
828  // ----------------------------------------------------------------------
829 
830  void BufferRepeaterComponentBase ::
831  m_p_portIn_in(
832  Fw::PassiveComponentBase* callComp,
833  FwIndexType portNum,
834  Fw::Buffer& fwBuffer
835  )
836  {
837  FW_ASSERT(callComp);
838  BufferRepeaterComponentBase* compPtr = static_cast<BufferRepeaterComponentBase*>(callComp);
839  compPtr->portIn_handlerBase(
840  portNum,
841  fwBuffer
842  );
843  }
844 
845 #if !FW_DIRECT_PORT_CALLS
846 
847  // ----------------------------------------------------------------------
848  // Invocation functions for special output ports
849  // ----------------------------------------------------------------------
850 
851  void BufferRepeaterComponentBase ::
852  Log_out(
853  FwIndexType portNum,
854  FwEventIdType id,
855  Fw::Time& timeTag,
856  const Fw::LogSeverity& severity,
857  Fw::LogBuffer& args
858  ) const
859  {
860  FW_ASSERT(
861  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
862  static_cast<FwAssertArgType>(portNum)
863  );
864 
865  FW_ASSERT(
866  this->m_Log_OutputPort[portNum].isConnected(),
867  static_cast<FwAssertArgType>(portNum)
868  );
869  this->m_Log_OutputPort[portNum].invoke(
870  id,
871  timeTag,
872  severity,
873  args
874  );
875  }
876 
877 #if FW_ENABLE_TEXT_LOGGING
878 
879  void BufferRepeaterComponentBase ::
880  LogText_out(
881  FwIndexType portNum,
882  FwEventIdType id,
883  Fw::Time& timeTag,
884  const Fw::LogSeverity& severity,
885  Fw::TextLogString& text
886  ) const
887  {
888  FW_ASSERT(
889  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
890  static_cast<FwAssertArgType>(portNum)
891  );
892 
893  FW_ASSERT(
894  this->m_LogText_OutputPort[portNum].isConnected(),
895  static_cast<FwAssertArgType>(portNum)
896  );
897  this->m_LogText_OutputPort[portNum].invoke(
898  id,
899  timeTag,
900  severity,
901  text
902  );
903  }
904 
905 #endif
906 
907  void BufferRepeaterComponentBase ::
908  Time_out(
909  FwIndexType portNum,
910  Fw::Time& time
911  ) const
912  {
913  FW_ASSERT(
914  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
915  static_cast<FwAssertArgType>(portNum)
916  );
917 
918  FW_ASSERT(
919  this->m_Time_OutputPort[portNum].isConnected(),
920  static_cast<FwAssertArgType>(portNum)
921  );
922  this->m_Time_OutputPort[portNum].invoke(
923  time
924  );
925  }
926 
927 #endif
928 
929 }
Serialization/Deserialization operation was successful.
bool isConnected_portOut_OutputPort(FwIndexType portNum) const
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
static constexpr FwIndexType getNum_portIn_InputPorts()
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
PlatformSizeType FwSizeType
I32 FwEnumStoreType
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
bool isConnected_Time_OutputPort(FwIndexType portNum) const
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void log_WARNING_HI_AllocationSoftFailure(I32 port, FwSizeType size) const
No time base has been established (Required)
static constexpr FwIndexType getNum_portOut_OutputPorts()
void init()
Object initializer.
Definition: ObjBase.cpp:24
void portOut_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port portOut.
SerializeStatus
forward declaration for string
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
static constexpr FwIndexType getNum_allocate_OutputPorts()
FwIdType FwEventIdType
The type of an event identifier.
BufferRepeaterComponentBase(const char *compName="")
Construct BufferRepeaterComponentBase object.
virtual void portIn_handler(FwIndexType portNum, Fw::Buffer &fwBuffer)=0
Handler for input port portIn.
#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
bool isConnected_Log_OutputPort(FwIndexType portNum) const
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port connection.
void init()
Initialization function.
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
void set_portOut_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to portOut[portNum].
static constexpr FwIndexType getNum_Time_OutputPorts()
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
const char * toChar() const
Convert to a C-style char*.
Definition: ObjectName.hpp:50
static constexpr FwIndexType getNum_deallocate_OutputPorts()
A serious but recoverable event.
bool isConnected() const
Definition: PortBase.cpp:38
Fw::InputBufferSendPort * get_portIn_InputPort(FwIndexType portNum)
Enum representing event severity.
virtual ~BufferRepeaterComponentBase()
Destroy BufferRepeaterComponentBase object.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:39
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void setPortNum(FwIndexType portNum)
void portIn_handlerBase(FwIndexType portNum, Fw::Buffer &fwBuffer)
Handler base-class function for input port portIn.
Fw::Buffer invoke(FwSizeType size) const
void init()
Initialization function.
void set_deallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to deallocate[portNum].
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
Fw::Buffer allocate_out(FwIndexType portNum, FwSizeType size) const
Invoke output port allocate.
void log_FATAL_AllocationHardFailure(I32 port, FwSizeType size) const
PlatformIndexType FwIndexType
A fatal non-recoverable event.
static constexpr FwIndexType getNum_Log_OutputPorts()
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
bool isConnected_deallocate_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
RateGroupDivider component implementation.
void deallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port deallocate.
Auto-generated base for BufferRepeater component.
bool isConnected_allocate_OutputPort(FwIndexType portNum) const
Implementation of malloc based allocator.
void set_allocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to allocate[portNum].
#define FW_ASSERT(...)
Definition: Assert.hpp:14