F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
AssertFatalAdapterComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title AssertFatalAdapterComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for AssertFatalAdapter 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 output port Log
28  for (
29  FwIndexType port = 0;
30  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
31  port++
32  ) {
33  this->m_Log_OutputPort[port].init();
34 
35 #if FW_OBJECT_NAMES == 1
36  Fw::ObjectName portName;
37  portName.format(
38  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
39  this->m_objName.toChar(),
40  port
41  );
42  this->m_Log_OutputPort[port].setObjName(portName.toChar());
43 #endif
44  }
45 #endif
46 
47 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
48  // Connect output port LogText
49  for (
50  FwIndexType port = 0;
51  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
52  port++
53  ) {
54  this->m_LogText_OutputPort[port].init();
55 
56 #if FW_OBJECT_NAMES == 1
57  Fw::ObjectName portName;
58  portName.format(
59  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
60  this->m_objName.toChar(),
61  port
62  );
63  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
64 #endif
65  }
66 #endif
67 
68 #if !FW_DIRECT_PORT_CALLS
69  // Connect output port Time
70  for (
71  FwIndexType port = 0;
72  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
73  port++
74  ) {
75  this->m_Time_OutputPort[port].init();
76 
77 #if FW_OBJECT_NAMES == 1
78  Fw::ObjectName portName;
79  portName.format(
80  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
81  this->m_objName.toChar(),
82  port
83  );
84  this->m_Time_OutputPort[port].setObjName(portName.toChar());
85 #endif
86  }
87 #endif
88  }
89 
90 #if !FW_DIRECT_PORT_CALLS
91 
92  // ----------------------------------------------------------------------
93  // Connect input ports to special output ports
94  // ----------------------------------------------------------------------
95 
98  FwIndexType portNum,
99  Fw::InputLogPort* port
100  )
101  {
102  FW_ASSERT(
103  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
104  static_cast<FwAssertArgType>(portNum)
105  );
106 
107  this->m_Log_OutputPort[portNum].addCallPort(port);
108  }
109 
110 #if FW_ENABLE_TEXT_LOGGING == 1
111 
112  void AssertFatalAdapterComponentBase ::
113  set_LogText_OutputPort(
114  FwIndexType portNum,
116  )
117  {
118  FW_ASSERT(
119  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
120  static_cast<FwAssertArgType>(portNum)
121  );
122 
123  this->m_LogText_OutputPort[portNum].addCallPort(port);
124  }
125 
126 #endif
127 
130  FwIndexType portNum,
131  Fw::InputTimePort* port
132  )
133  {
134  FW_ASSERT(
135  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
136  static_cast<FwAssertArgType>(portNum)
137  );
138 
139  this->m_Time_OutputPort[portNum].addCallPort(port);
140  }
141 
142 #endif
143 
144 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
145 
146  // ----------------------------------------------------------------------
147  // Connect serial input ports to special output ports
148  // ----------------------------------------------------------------------
149 
152  FwIndexType portNum,
153  Fw::InputSerializePort* port
154  )
155  {
156  FW_ASSERT(
157  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
158  static_cast<FwAssertArgType>(portNum)
159  );
160 
161  this->m_Log_OutputPort[portNum].registerSerialPort(port);
162  }
163 
164 #if FW_ENABLE_TEXT_LOGGING == 1
165 
166  void AssertFatalAdapterComponentBase ::
167  set_LogText_OutputPort(
168  FwIndexType portNum,
169  Fw::InputSerializePort* port
170  )
171  {
172  FW_ASSERT(
173  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
174  static_cast<FwAssertArgType>(portNum)
175  );
176 
177  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
178  }
179 
180 #endif
181 
184  FwIndexType portNum,
185  Fw::InputSerializePort* port
186  )
187  {
188  FW_ASSERT(
189  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
190  static_cast<FwAssertArgType>(portNum)
191  );
192 
193  this->m_Time_OutputPort[portNum].registerSerialPort(port);
194  }
195 
196 #endif
197 
198  // ----------------------------------------------------------------------
199  // Component construction and destruction
200  // ----------------------------------------------------------------------
201 
203  AssertFatalAdapterComponentBase(const char* compName) :
204  Fw::PassiveComponentBase(compName)
205  {
206 
207  }
208 
211  {
212 
213  }
214 
215 #if !FW_DIRECT_PORT_CALLS
216 
217  // ----------------------------------------------------------------------
218  // Connection status queries for special output ports
219  // ----------------------------------------------------------------------
220 
223  {
224  FW_ASSERT(
225  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
226  static_cast<FwAssertArgType>(portNum)
227  );
228 
229  return this->m_Log_OutputPort[portNum].isConnected();
230  }
231 
232 #if FW_ENABLE_TEXT_LOGGING == 1
233 
234  bool AssertFatalAdapterComponentBase ::
235  isConnected_LogText_OutputPort(FwIndexType portNum) const
236  {
237  FW_ASSERT(
238  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
239  static_cast<FwAssertArgType>(portNum)
240  );
241 
242  return this->m_LogText_OutputPort[portNum].isConnected();
243  }
244 
245 #endif
246 
249  {
250  FW_ASSERT(
251  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
252  static_cast<FwAssertArgType>(portNum)
253  );
254 
255  return this->m_Time_OutputPort[portNum].isConnected();
256  }
257 
258 #endif
259 
260  // ----------------------------------------------------------------------
261  // Event logging functions
262  // ----------------------------------------------------------------------
263 
266  const Fw::StringBase& file,
267  U32 line
268  ) const
269  {
270  // Get the time
271  Fw::Time _logTime;
272  if (this->isConnected_Time_OutputPort(0)) {
273  this->Time_out(0, _logTime);
274  }
275 
276  const FwEventIdType _id = this->getIdBase() + EVENTID_AF_ASSERT_0;
277 
278  // Emit the event on the log port
279  if (this->isConnected_Log_OutputPort(0)) {
280  Fw::LogBuffer _logBuff;
282 
283 #if FW_AMPCS_COMPATIBLE
284  // Serialize the number of arguments
285  _status = _logBuff.serializeFrom(static_cast<U8>(2 + 1));
286  FW_ASSERT(
287  _status == Fw::FW_SERIALIZE_OK,
288  static_cast<FwAssertArgType>(_status)
289  );
290 
291  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
292  _status = _logBuff.serializeFrom(static_cast<U8>(4));
293  FW_ASSERT(
294  _status == Fw::FW_SERIALIZE_OK,
295  static_cast<FwAssertArgType>(_status)
296  );
297 
298  _status = _logBuff.serializeFrom(static_cast<U32>(0));
299  FW_ASSERT(
300  _status == Fw::FW_SERIALIZE_OK,
301  static_cast<FwAssertArgType>(_status)
302  );
303 #endif
304 
305  _status = file.serializeTo(
306  _logBuff,
307  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
308  );
309  FW_ASSERT(
310  _status == Fw::FW_SERIALIZE_OK,
311  static_cast<FwAssertArgType>(_status)
312  );
313 
314 #if FW_AMPCS_COMPATIBLE
315  // Serialize the argument size
316  _status = _logBuff.serializeFrom(
317  static_cast<U8>(sizeof(U32))
318  );
319  FW_ASSERT(
320  _status == Fw::FW_SERIALIZE_OK,
321  static_cast<FwAssertArgType>(_status)
322  );
323 #endif
324  _status = _logBuff.serializeFrom(line);
325  FW_ASSERT(
326  _status == Fw::FW_SERIALIZE_OK,
327  static_cast<FwAssertArgType>(_status)
328  );
329 
330  this->Log_out(
331  0,
332  _id,
333  _logTime,
335  _logBuff
336  );
337  }
338 
339  // Emit the event on the text log port
340 #if FW_ENABLE_TEXT_LOGGING
341  if (this->isConnected_LogText_OutputPort(0)) {
342 #if FW_OBJECT_NAMES == 1
343  const char* _formatString =
344  "(%s) %s: Assert in file %s, line %" PRIu32 "";
345 #else
346  const char* _formatString =
347  "%s: Assert in file %s, line %" PRIu32 "";
348 #endif
349 
350  Fw::TextLogString _logString;
351  _logString.format(
352  _formatString,
353 #if FW_OBJECT_NAMES == 1
354  this->m_objName.toChar(),
355 #endif
356  "AF_ASSERT_0 ",
357  file.toChar(),
358  line
359  );
360 
361  this->LogText_out(
362  0,
363  _id,
364  _logTime,
366  _logString
367  );
368  }
369 #endif
370  }
371 
374  const Fw::StringBase& file,
375  U32 line,
376  U32 arg1
377  ) const
378  {
379  // Get the time
380  Fw::Time _logTime;
381  if (this->isConnected_Time_OutputPort(0)) {
382  this->Time_out(0, _logTime);
383  }
384 
385  const FwEventIdType _id = this->getIdBase() + EVENTID_AF_ASSERT_1;
386 
387  // Emit the event on the log port
388  if (this->isConnected_Log_OutputPort(0)) {
389  Fw::LogBuffer _logBuff;
391 
392 #if FW_AMPCS_COMPATIBLE
393  // Serialize the number of arguments
394  _status = _logBuff.serializeFrom(static_cast<U8>(3 + 1));
395  FW_ASSERT(
396  _status == Fw::FW_SERIALIZE_OK,
397  static_cast<FwAssertArgType>(_status)
398  );
399 
400  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
401  _status = _logBuff.serializeFrom(static_cast<U8>(4));
402  FW_ASSERT(
403  _status == Fw::FW_SERIALIZE_OK,
404  static_cast<FwAssertArgType>(_status)
405  );
406 
407  _status = _logBuff.serializeFrom(static_cast<U32>(0));
408  FW_ASSERT(
409  _status == Fw::FW_SERIALIZE_OK,
410  static_cast<FwAssertArgType>(_status)
411  );
412 #endif
413 
414  _status = file.serializeTo(
415  _logBuff,
416  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
417  );
418  FW_ASSERT(
419  _status == Fw::FW_SERIALIZE_OK,
420  static_cast<FwAssertArgType>(_status)
421  );
422 
423 #if FW_AMPCS_COMPATIBLE
424  // Serialize the argument size
425  _status = _logBuff.serializeFrom(
426  static_cast<U8>(sizeof(U32))
427  );
428  FW_ASSERT(
429  _status == Fw::FW_SERIALIZE_OK,
430  static_cast<FwAssertArgType>(_status)
431  );
432 #endif
433  _status = _logBuff.serializeFrom(line);
434  FW_ASSERT(
435  _status == Fw::FW_SERIALIZE_OK,
436  static_cast<FwAssertArgType>(_status)
437  );
438 
439 #if FW_AMPCS_COMPATIBLE
440  // Serialize the argument size
441  _status = _logBuff.serializeFrom(
442  static_cast<U8>(sizeof(U32))
443  );
444  FW_ASSERT(
445  _status == Fw::FW_SERIALIZE_OK,
446  static_cast<FwAssertArgType>(_status)
447  );
448 #endif
449  _status = _logBuff.serializeFrom(arg1);
450  FW_ASSERT(
451  _status == Fw::FW_SERIALIZE_OK,
452  static_cast<FwAssertArgType>(_status)
453  );
454 
455  this->Log_out(
456  0,
457  _id,
458  _logTime,
460  _logBuff
461  );
462  }
463 
464  // Emit the event on the text log port
465 #if FW_ENABLE_TEXT_LOGGING
466  if (this->isConnected_LogText_OutputPort(0)) {
467 #if FW_OBJECT_NAMES == 1
468  const char* _formatString =
469  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 "";
470 #else
471  const char* _formatString =
472  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 "";
473 #endif
474 
475  Fw::TextLogString _logString;
476  _logString.format(
477  _formatString,
478 #if FW_OBJECT_NAMES == 1
479  this->m_objName.toChar(),
480 #endif
481  "AF_ASSERT_1 ",
482  file.toChar(),
483  line,
484  arg1
485  );
486 
487  this->LogText_out(
488  0,
489  _id,
490  _logTime,
492  _logString
493  );
494  }
495 #endif
496  }
497 
500  const Fw::StringBase& file,
501  U32 line,
502  U32 arg1,
503  U32 arg2
504  ) const
505  {
506  // Get the time
507  Fw::Time _logTime;
508  if (this->isConnected_Time_OutputPort(0)) {
509  this->Time_out(0, _logTime);
510  }
511 
512  const FwEventIdType _id = this->getIdBase() + EVENTID_AF_ASSERT_2;
513 
514  // Emit the event on the log port
515  if (this->isConnected_Log_OutputPort(0)) {
516  Fw::LogBuffer _logBuff;
518 
519 #if FW_AMPCS_COMPATIBLE
520  // Serialize the number of arguments
521  _status = _logBuff.serializeFrom(static_cast<U8>(4 + 1));
522  FW_ASSERT(
523  _status == Fw::FW_SERIALIZE_OK,
524  static_cast<FwAssertArgType>(_status)
525  );
526 
527  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
528  _status = _logBuff.serializeFrom(static_cast<U8>(4));
529  FW_ASSERT(
530  _status == Fw::FW_SERIALIZE_OK,
531  static_cast<FwAssertArgType>(_status)
532  );
533 
534  _status = _logBuff.serializeFrom(static_cast<U32>(0));
535  FW_ASSERT(
536  _status == Fw::FW_SERIALIZE_OK,
537  static_cast<FwAssertArgType>(_status)
538  );
539 #endif
540 
541  _status = file.serializeTo(
542  _logBuff,
543  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
544  );
545  FW_ASSERT(
546  _status == Fw::FW_SERIALIZE_OK,
547  static_cast<FwAssertArgType>(_status)
548  );
549 
550 #if FW_AMPCS_COMPATIBLE
551  // Serialize the argument size
552  _status = _logBuff.serializeFrom(
553  static_cast<U8>(sizeof(U32))
554  );
555  FW_ASSERT(
556  _status == Fw::FW_SERIALIZE_OK,
557  static_cast<FwAssertArgType>(_status)
558  );
559 #endif
560  _status = _logBuff.serializeFrom(line);
561  FW_ASSERT(
562  _status == Fw::FW_SERIALIZE_OK,
563  static_cast<FwAssertArgType>(_status)
564  );
565 
566 #if FW_AMPCS_COMPATIBLE
567  // Serialize the argument size
568  _status = _logBuff.serializeFrom(
569  static_cast<U8>(sizeof(U32))
570  );
571  FW_ASSERT(
572  _status == Fw::FW_SERIALIZE_OK,
573  static_cast<FwAssertArgType>(_status)
574  );
575 #endif
576  _status = _logBuff.serializeFrom(arg1);
577  FW_ASSERT(
578  _status == Fw::FW_SERIALIZE_OK,
579  static_cast<FwAssertArgType>(_status)
580  );
581 
582 #if FW_AMPCS_COMPATIBLE
583  // Serialize the argument size
584  _status = _logBuff.serializeFrom(
585  static_cast<U8>(sizeof(U32))
586  );
587  FW_ASSERT(
588  _status == Fw::FW_SERIALIZE_OK,
589  static_cast<FwAssertArgType>(_status)
590  );
591 #endif
592  _status = _logBuff.serializeFrom(arg2);
593  FW_ASSERT(
594  _status == Fw::FW_SERIALIZE_OK,
595  static_cast<FwAssertArgType>(_status)
596  );
597 
598  this->Log_out(
599  0,
600  _id,
601  _logTime,
603  _logBuff
604  );
605  }
606 
607  // Emit the event on the text log port
608 #if FW_ENABLE_TEXT_LOGGING
609  if (this->isConnected_LogText_OutputPort(0)) {
610 #if FW_OBJECT_NAMES == 1
611  const char* _formatString =
612  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 "";
613 #else
614  const char* _formatString =
615  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 "";
616 #endif
617 
618  Fw::TextLogString _logString;
619  _logString.format(
620  _formatString,
621 #if FW_OBJECT_NAMES == 1
622  this->m_objName.toChar(),
623 #endif
624  "AF_ASSERT_2 ",
625  file.toChar(),
626  line,
627  arg1,
628  arg2
629  );
630 
631  this->LogText_out(
632  0,
633  _id,
634  _logTime,
636  _logString
637  );
638  }
639 #endif
640  }
641 
644  const Fw::StringBase& file,
645  U32 line,
646  U32 arg1,
647  U32 arg2,
648  U32 arg3
649  ) const
650  {
651  // Get the time
652  Fw::Time _logTime;
653  if (this->isConnected_Time_OutputPort(0)) {
654  this->Time_out(0, _logTime);
655  }
656 
657  const FwEventIdType _id = this->getIdBase() + EVENTID_AF_ASSERT_3;
658 
659  // Emit the event on the log port
660  if (this->isConnected_Log_OutputPort(0)) {
661  Fw::LogBuffer _logBuff;
663 
664 #if FW_AMPCS_COMPATIBLE
665  // Serialize the number of arguments
666  _status = _logBuff.serializeFrom(static_cast<U8>(5 + 1));
667  FW_ASSERT(
668  _status == Fw::FW_SERIALIZE_OK,
669  static_cast<FwAssertArgType>(_status)
670  );
671 
672  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
673  _status = _logBuff.serializeFrom(static_cast<U8>(4));
674  FW_ASSERT(
675  _status == Fw::FW_SERIALIZE_OK,
676  static_cast<FwAssertArgType>(_status)
677  );
678 
679  _status = _logBuff.serializeFrom(static_cast<U32>(0));
680  FW_ASSERT(
681  _status == Fw::FW_SERIALIZE_OK,
682  static_cast<FwAssertArgType>(_status)
683  );
684 #endif
685 
686  _status = file.serializeTo(
687  _logBuff,
688  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
689  );
690  FW_ASSERT(
691  _status == Fw::FW_SERIALIZE_OK,
692  static_cast<FwAssertArgType>(_status)
693  );
694 
695 #if FW_AMPCS_COMPATIBLE
696  // Serialize the argument size
697  _status = _logBuff.serializeFrom(
698  static_cast<U8>(sizeof(U32))
699  );
700  FW_ASSERT(
701  _status == Fw::FW_SERIALIZE_OK,
702  static_cast<FwAssertArgType>(_status)
703  );
704 #endif
705  _status = _logBuff.serializeFrom(line);
706  FW_ASSERT(
707  _status == Fw::FW_SERIALIZE_OK,
708  static_cast<FwAssertArgType>(_status)
709  );
710 
711 #if FW_AMPCS_COMPATIBLE
712  // Serialize the argument size
713  _status = _logBuff.serializeFrom(
714  static_cast<U8>(sizeof(U32))
715  );
716  FW_ASSERT(
717  _status == Fw::FW_SERIALIZE_OK,
718  static_cast<FwAssertArgType>(_status)
719  );
720 #endif
721  _status = _logBuff.serializeFrom(arg1);
722  FW_ASSERT(
723  _status == Fw::FW_SERIALIZE_OK,
724  static_cast<FwAssertArgType>(_status)
725  );
726 
727 #if FW_AMPCS_COMPATIBLE
728  // Serialize the argument size
729  _status = _logBuff.serializeFrom(
730  static_cast<U8>(sizeof(U32))
731  );
732  FW_ASSERT(
733  _status == Fw::FW_SERIALIZE_OK,
734  static_cast<FwAssertArgType>(_status)
735  );
736 #endif
737  _status = _logBuff.serializeFrom(arg2);
738  FW_ASSERT(
739  _status == Fw::FW_SERIALIZE_OK,
740  static_cast<FwAssertArgType>(_status)
741  );
742 
743 #if FW_AMPCS_COMPATIBLE
744  // Serialize the argument size
745  _status = _logBuff.serializeFrom(
746  static_cast<U8>(sizeof(U32))
747  );
748  FW_ASSERT(
749  _status == Fw::FW_SERIALIZE_OK,
750  static_cast<FwAssertArgType>(_status)
751  );
752 #endif
753  _status = _logBuff.serializeFrom(arg3);
754  FW_ASSERT(
755  _status == Fw::FW_SERIALIZE_OK,
756  static_cast<FwAssertArgType>(_status)
757  );
758 
759  this->Log_out(
760  0,
761  _id,
762  _logTime,
764  _logBuff
765  );
766  }
767 
768  // Emit the event on the text log port
769 #if FW_ENABLE_TEXT_LOGGING
770  if (this->isConnected_LogText_OutputPort(0)) {
771 #if FW_OBJECT_NAMES == 1
772  const char* _formatString =
773  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 "";
774 #else
775  const char* _formatString =
776  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 "";
777 #endif
778 
779  Fw::TextLogString _logString;
780  _logString.format(
781  _formatString,
782 #if FW_OBJECT_NAMES == 1
783  this->m_objName.toChar(),
784 #endif
785  "AF_ASSERT_3 ",
786  file.toChar(),
787  line,
788  arg1,
789  arg2,
790  arg3
791  );
792 
793  this->LogText_out(
794  0,
795  _id,
796  _logTime,
798  _logString
799  );
800  }
801 #endif
802  }
803 
806  const Fw::StringBase& file,
807  U32 line,
808  U32 arg1,
809  U32 arg2,
810  U32 arg3,
811  U32 arg4
812  ) const
813  {
814  // Get the time
815  Fw::Time _logTime;
816  if (this->isConnected_Time_OutputPort(0)) {
817  this->Time_out(0, _logTime);
818  }
819 
820  const FwEventIdType _id = this->getIdBase() + EVENTID_AF_ASSERT_4;
821 
822  // Emit the event on the log port
823  if (this->isConnected_Log_OutputPort(0)) {
824  Fw::LogBuffer _logBuff;
826 
827 #if FW_AMPCS_COMPATIBLE
828  // Serialize the number of arguments
829  _status = _logBuff.serializeFrom(static_cast<U8>(6 + 1));
830  FW_ASSERT(
831  _status == Fw::FW_SERIALIZE_OK,
832  static_cast<FwAssertArgType>(_status)
833  );
834 
835  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
836  _status = _logBuff.serializeFrom(static_cast<U8>(4));
837  FW_ASSERT(
838  _status == Fw::FW_SERIALIZE_OK,
839  static_cast<FwAssertArgType>(_status)
840  );
841 
842  _status = _logBuff.serializeFrom(static_cast<U32>(0));
843  FW_ASSERT(
844  _status == Fw::FW_SERIALIZE_OK,
845  static_cast<FwAssertArgType>(_status)
846  );
847 #endif
848 
849  _status = file.serializeTo(
850  _logBuff,
851  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
852  );
853  FW_ASSERT(
854  _status == Fw::FW_SERIALIZE_OK,
855  static_cast<FwAssertArgType>(_status)
856  );
857 
858 #if FW_AMPCS_COMPATIBLE
859  // Serialize the argument size
860  _status = _logBuff.serializeFrom(
861  static_cast<U8>(sizeof(U32))
862  );
863  FW_ASSERT(
864  _status == Fw::FW_SERIALIZE_OK,
865  static_cast<FwAssertArgType>(_status)
866  );
867 #endif
868  _status = _logBuff.serializeFrom(line);
869  FW_ASSERT(
870  _status == Fw::FW_SERIALIZE_OK,
871  static_cast<FwAssertArgType>(_status)
872  );
873 
874 #if FW_AMPCS_COMPATIBLE
875  // Serialize the argument size
876  _status = _logBuff.serializeFrom(
877  static_cast<U8>(sizeof(U32))
878  );
879  FW_ASSERT(
880  _status == Fw::FW_SERIALIZE_OK,
881  static_cast<FwAssertArgType>(_status)
882  );
883 #endif
884  _status = _logBuff.serializeFrom(arg1);
885  FW_ASSERT(
886  _status == Fw::FW_SERIALIZE_OK,
887  static_cast<FwAssertArgType>(_status)
888  );
889 
890 #if FW_AMPCS_COMPATIBLE
891  // Serialize the argument size
892  _status = _logBuff.serializeFrom(
893  static_cast<U8>(sizeof(U32))
894  );
895  FW_ASSERT(
896  _status == Fw::FW_SERIALIZE_OK,
897  static_cast<FwAssertArgType>(_status)
898  );
899 #endif
900  _status = _logBuff.serializeFrom(arg2);
901  FW_ASSERT(
902  _status == Fw::FW_SERIALIZE_OK,
903  static_cast<FwAssertArgType>(_status)
904  );
905 
906 #if FW_AMPCS_COMPATIBLE
907  // Serialize the argument size
908  _status = _logBuff.serializeFrom(
909  static_cast<U8>(sizeof(U32))
910  );
911  FW_ASSERT(
912  _status == Fw::FW_SERIALIZE_OK,
913  static_cast<FwAssertArgType>(_status)
914  );
915 #endif
916  _status = _logBuff.serializeFrom(arg3);
917  FW_ASSERT(
918  _status == Fw::FW_SERIALIZE_OK,
919  static_cast<FwAssertArgType>(_status)
920  );
921 
922 #if FW_AMPCS_COMPATIBLE
923  // Serialize the argument size
924  _status = _logBuff.serializeFrom(
925  static_cast<U8>(sizeof(U32))
926  );
927  FW_ASSERT(
928  _status == Fw::FW_SERIALIZE_OK,
929  static_cast<FwAssertArgType>(_status)
930  );
931 #endif
932  _status = _logBuff.serializeFrom(arg4);
933  FW_ASSERT(
934  _status == Fw::FW_SERIALIZE_OK,
935  static_cast<FwAssertArgType>(_status)
936  );
937 
938  this->Log_out(
939  0,
940  _id,
941  _logTime,
943  _logBuff
944  );
945  }
946 
947  // Emit the event on the text log port
948 #if FW_ENABLE_TEXT_LOGGING
949  if (this->isConnected_LogText_OutputPort(0)) {
950 #if FW_OBJECT_NAMES == 1
951  const char* _formatString =
952  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
953 #else
954  const char* _formatString =
955  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
956 #endif
957 
958  Fw::TextLogString _logString;
959  _logString.format(
960  _formatString,
961 #if FW_OBJECT_NAMES == 1
962  this->m_objName.toChar(),
963 #endif
964  "AF_ASSERT_4 ",
965  file.toChar(),
966  line,
967  arg1,
968  arg2,
969  arg3,
970  arg4
971  );
972 
973  this->LogText_out(
974  0,
975  _id,
976  _logTime,
978  _logString
979  );
980  }
981 #endif
982  }
983 
986  const Fw::StringBase& file,
987  U32 line,
988  U32 arg1,
989  U32 arg2,
990  U32 arg3,
991  U32 arg4,
992  U32 arg5
993  ) const
994  {
995  // Get the time
996  Fw::Time _logTime;
997  if (this->isConnected_Time_OutputPort(0)) {
998  this->Time_out(0, _logTime);
999  }
1000 
1001  const FwEventIdType _id = this->getIdBase() + EVENTID_AF_ASSERT_5;
1002 
1003  // Emit the event on the log port
1004  if (this->isConnected_Log_OutputPort(0)) {
1005  Fw::LogBuffer _logBuff;
1007 
1008 #if FW_AMPCS_COMPATIBLE
1009  // Serialize the number of arguments
1010  _status = _logBuff.serializeFrom(static_cast<U8>(7 + 1));
1011  FW_ASSERT(
1012  _status == Fw::FW_SERIALIZE_OK,
1013  static_cast<FwAssertArgType>(_status)
1014  );
1015 
1016  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1017  _status = _logBuff.serializeFrom(static_cast<U8>(4));
1018  FW_ASSERT(
1019  _status == Fw::FW_SERIALIZE_OK,
1020  static_cast<FwAssertArgType>(_status)
1021  );
1022 
1023  _status = _logBuff.serializeFrom(static_cast<U32>(0));
1024  FW_ASSERT(
1025  _status == Fw::FW_SERIALIZE_OK,
1026  static_cast<FwAssertArgType>(_status)
1027  );
1028 #endif
1029 
1030  _status = file.serializeTo(
1031  _logBuff,
1032  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
1033  );
1034  FW_ASSERT(
1035  _status == Fw::FW_SERIALIZE_OK,
1036  static_cast<FwAssertArgType>(_status)
1037  );
1038 
1039 #if FW_AMPCS_COMPATIBLE
1040  // Serialize the argument size
1041  _status = _logBuff.serializeFrom(
1042  static_cast<U8>(sizeof(U32))
1043  );
1044  FW_ASSERT(
1045  _status == Fw::FW_SERIALIZE_OK,
1046  static_cast<FwAssertArgType>(_status)
1047  );
1048 #endif
1049  _status = _logBuff.serializeFrom(line);
1050  FW_ASSERT(
1051  _status == Fw::FW_SERIALIZE_OK,
1052  static_cast<FwAssertArgType>(_status)
1053  );
1054 
1055 #if FW_AMPCS_COMPATIBLE
1056  // Serialize the argument size
1057  _status = _logBuff.serializeFrom(
1058  static_cast<U8>(sizeof(U32))
1059  );
1060  FW_ASSERT(
1061  _status == Fw::FW_SERIALIZE_OK,
1062  static_cast<FwAssertArgType>(_status)
1063  );
1064 #endif
1065  _status = _logBuff.serializeFrom(arg1);
1066  FW_ASSERT(
1067  _status == Fw::FW_SERIALIZE_OK,
1068  static_cast<FwAssertArgType>(_status)
1069  );
1070 
1071 #if FW_AMPCS_COMPATIBLE
1072  // Serialize the argument size
1073  _status = _logBuff.serializeFrom(
1074  static_cast<U8>(sizeof(U32))
1075  );
1076  FW_ASSERT(
1077  _status == Fw::FW_SERIALIZE_OK,
1078  static_cast<FwAssertArgType>(_status)
1079  );
1080 #endif
1081  _status = _logBuff.serializeFrom(arg2);
1082  FW_ASSERT(
1083  _status == Fw::FW_SERIALIZE_OK,
1084  static_cast<FwAssertArgType>(_status)
1085  );
1086 
1087 #if FW_AMPCS_COMPATIBLE
1088  // Serialize the argument size
1089  _status = _logBuff.serializeFrom(
1090  static_cast<U8>(sizeof(U32))
1091  );
1092  FW_ASSERT(
1093  _status == Fw::FW_SERIALIZE_OK,
1094  static_cast<FwAssertArgType>(_status)
1095  );
1096 #endif
1097  _status = _logBuff.serializeFrom(arg3);
1098  FW_ASSERT(
1099  _status == Fw::FW_SERIALIZE_OK,
1100  static_cast<FwAssertArgType>(_status)
1101  );
1102 
1103 #if FW_AMPCS_COMPATIBLE
1104  // Serialize the argument size
1105  _status = _logBuff.serializeFrom(
1106  static_cast<U8>(sizeof(U32))
1107  );
1108  FW_ASSERT(
1109  _status == Fw::FW_SERIALIZE_OK,
1110  static_cast<FwAssertArgType>(_status)
1111  );
1112 #endif
1113  _status = _logBuff.serializeFrom(arg4);
1114  FW_ASSERT(
1115  _status == Fw::FW_SERIALIZE_OK,
1116  static_cast<FwAssertArgType>(_status)
1117  );
1118 
1119 #if FW_AMPCS_COMPATIBLE
1120  // Serialize the argument size
1121  _status = _logBuff.serializeFrom(
1122  static_cast<U8>(sizeof(U32))
1123  );
1124  FW_ASSERT(
1125  _status == Fw::FW_SERIALIZE_OK,
1126  static_cast<FwAssertArgType>(_status)
1127  );
1128 #endif
1129  _status = _logBuff.serializeFrom(arg5);
1130  FW_ASSERT(
1131  _status == Fw::FW_SERIALIZE_OK,
1132  static_cast<FwAssertArgType>(_status)
1133  );
1134 
1135  this->Log_out(
1136  0,
1137  _id,
1138  _logTime,
1140  _logBuff
1141  );
1142  }
1143 
1144  // Emit the event on the text log port
1145 #if FW_ENABLE_TEXT_LOGGING
1146  if (this->isConnected_LogText_OutputPort(0)) {
1147 #if FW_OBJECT_NAMES == 1
1148  const char* _formatString =
1149  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1150 #else
1151  const char* _formatString =
1152  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1153 #endif
1154 
1155  Fw::TextLogString _logString;
1156  _logString.format(
1157  _formatString,
1158 #if FW_OBJECT_NAMES == 1
1159  this->m_objName.toChar(),
1160 #endif
1161  "AF_ASSERT_5 ",
1162  file.toChar(),
1163  line,
1164  arg1,
1165  arg2,
1166  arg3,
1167  arg4,
1168  arg5
1169  );
1170 
1171  this->LogText_out(
1172  0,
1173  _id,
1174  _logTime,
1176  _logString
1177  );
1178  }
1179 #endif
1180  }
1181 
1184  const Fw::StringBase& file,
1185  U32 line,
1186  U32 arg1,
1187  U32 arg2,
1188  U32 arg3,
1189  U32 arg4,
1190  U32 arg5,
1191  U32 arg6
1192  ) const
1193  {
1194  // Get the time
1195  Fw::Time _logTime;
1196  if (this->isConnected_Time_OutputPort(0)) {
1197  this->Time_out(0, _logTime);
1198  }
1199 
1200  const FwEventIdType _id = this->getIdBase() + EVENTID_AF_ASSERT_6;
1201 
1202  // Emit the event on the log port
1203  if (this->isConnected_Log_OutputPort(0)) {
1204  Fw::LogBuffer _logBuff;
1206 
1207 #if FW_AMPCS_COMPATIBLE
1208  // Serialize the number of arguments
1209  _status = _logBuff.serializeFrom(static_cast<U8>(8 + 1));
1210  FW_ASSERT(
1211  _status == Fw::FW_SERIALIZE_OK,
1212  static_cast<FwAssertArgType>(_status)
1213  );
1214 
1215  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1216  _status = _logBuff.serializeFrom(static_cast<U8>(4));
1217  FW_ASSERT(
1218  _status == Fw::FW_SERIALIZE_OK,
1219  static_cast<FwAssertArgType>(_status)
1220  );
1221 
1222  _status = _logBuff.serializeFrom(static_cast<U32>(0));
1223  FW_ASSERT(
1224  _status == Fw::FW_SERIALIZE_OK,
1225  static_cast<FwAssertArgType>(_status)
1226  );
1227 #endif
1228 
1229  _status = file.serializeTo(
1230  _logBuff,
1231  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
1232  );
1233  FW_ASSERT(
1234  _status == Fw::FW_SERIALIZE_OK,
1235  static_cast<FwAssertArgType>(_status)
1236  );
1237 
1238 #if FW_AMPCS_COMPATIBLE
1239  // Serialize the argument size
1240  _status = _logBuff.serializeFrom(
1241  static_cast<U8>(sizeof(U32))
1242  );
1243  FW_ASSERT(
1244  _status == Fw::FW_SERIALIZE_OK,
1245  static_cast<FwAssertArgType>(_status)
1246  );
1247 #endif
1248  _status = _logBuff.serializeFrom(line);
1249  FW_ASSERT(
1250  _status == Fw::FW_SERIALIZE_OK,
1251  static_cast<FwAssertArgType>(_status)
1252  );
1253 
1254 #if FW_AMPCS_COMPATIBLE
1255  // Serialize the argument size
1256  _status = _logBuff.serializeFrom(
1257  static_cast<U8>(sizeof(U32))
1258  );
1259  FW_ASSERT(
1260  _status == Fw::FW_SERIALIZE_OK,
1261  static_cast<FwAssertArgType>(_status)
1262  );
1263 #endif
1264  _status = _logBuff.serializeFrom(arg1);
1265  FW_ASSERT(
1266  _status == Fw::FW_SERIALIZE_OK,
1267  static_cast<FwAssertArgType>(_status)
1268  );
1269 
1270 #if FW_AMPCS_COMPATIBLE
1271  // Serialize the argument size
1272  _status = _logBuff.serializeFrom(
1273  static_cast<U8>(sizeof(U32))
1274  );
1275  FW_ASSERT(
1276  _status == Fw::FW_SERIALIZE_OK,
1277  static_cast<FwAssertArgType>(_status)
1278  );
1279 #endif
1280  _status = _logBuff.serializeFrom(arg2);
1281  FW_ASSERT(
1282  _status == Fw::FW_SERIALIZE_OK,
1283  static_cast<FwAssertArgType>(_status)
1284  );
1285 
1286 #if FW_AMPCS_COMPATIBLE
1287  // Serialize the argument size
1288  _status = _logBuff.serializeFrom(
1289  static_cast<U8>(sizeof(U32))
1290  );
1291  FW_ASSERT(
1292  _status == Fw::FW_SERIALIZE_OK,
1293  static_cast<FwAssertArgType>(_status)
1294  );
1295 #endif
1296  _status = _logBuff.serializeFrom(arg3);
1297  FW_ASSERT(
1298  _status == Fw::FW_SERIALIZE_OK,
1299  static_cast<FwAssertArgType>(_status)
1300  );
1301 
1302 #if FW_AMPCS_COMPATIBLE
1303  // Serialize the argument size
1304  _status = _logBuff.serializeFrom(
1305  static_cast<U8>(sizeof(U32))
1306  );
1307  FW_ASSERT(
1308  _status == Fw::FW_SERIALIZE_OK,
1309  static_cast<FwAssertArgType>(_status)
1310  );
1311 #endif
1312  _status = _logBuff.serializeFrom(arg4);
1313  FW_ASSERT(
1314  _status == Fw::FW_SERIALIZE_OK,
1315  static_cast<FwAssertArgType>(_status)
1316  );
1317 
1318 #if FW_AMPCS_COMPATIBLE
1319  // Serialize the argument size
1320  _status = _logBuff.serializeFrom(
1321  static_cast<U8>(sizeof(U32))
1322  );
1323  FW_ASSERT(
1324  _status == Fw::FW_SERIALIZE_OK,
1325  static_cast<FwAssertArgType>(_status)
1326  );
1327 #endif
1328  _status = _logBuff.serializeFrom(arg5);
1329  FW_ASSERT(
1330  _status == Fw::FW_SERIALIZE_OK,
1331  static_cast<FwAssertArgType>(_status)
1332  );
1333 
1334 #if FW_AMPCS_COMPATIBLE
1335  // Serialize the argument size
1336  _status = _logBuff.serializeFrom(
1337  static_cast<U8>(sizeof(U32))
1338  );
1339  FW_ASSERT(
1340  _status == Fw::FW_SERIALIZE_OK,
1341  static_cast<FwAssertArgType>(_status)
1342  );
1343 #endif
1344  _status = _logBuff.serializeFrom(arg6);
1345  FW_ASSERT(
1346  _status == Fw::FW_SERIALIZE_OK,
1347  static_cast<FwAssertArgType>(_status)
1348  );
1349 
1350  this->Log_out(
1351  0,
1352  _id,
1353  _logTime,
1355  _logBuff
1356  );
1357  }
1358 
1359  // Emit the event on the text log port
1360 #if FW_ENABLE_TEXT_LOGGING
1361  if (this->isConnected_LogText_OutputPort(0)) {
1362 #if FW_OBJECT_NAMES == 1
1363  const char* _formatString =
1364  "(%s) %s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1365 #else
1366  const char* _formatString =
1367  "%s: Assert in file %s, line %" PRIu32 ": %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 " %" PRIu32 "";
1368 #endif
1369 
1370  Fw::TextLogString _logString;
1371  _logString.format(
1372  _formatString,
1373 #if FW_OBJECT_NAMES == 1
1374  this->m_objName.toChar(),
1375 #endif
1376  "AF_ASSERT_6 ",
1377  file.toChar(),
1378  line,
1379  arg1,
1380  arg2,
1381  arg3,
1382  arg4,
1383  arg5,
1384  arg6
1385  );
1386 
1387  this->LogText_out(
1388  0,
1389  _id,
1390  _logTime,
1392  _logString
1393  );
1394  }
1395 #endif
1396  }
1397 
1400  const Fw::StringBase& file,
1401  U32 line,
1402  U32 numArgs
1403  ) const
1404  {
1405  // Get the time
1406  Fw::Time _logTime;
1407  if (this->isConnected_Time_OutputPort(0)) {
1408  this->Time_out(0, _logTime);
1409  }
1410 
1412 
1413  // Emit the event on the log port
1414  if (this->isConnected_Log_OutputPort(0)) {
1415  Fw::LogBuffer _logBuff;
1417 
1418 #if FW_AMPCS_COMPATIBLE
1419  // Serialize the number of arguments
1420  _status = _logBuff.serializeFrom(static_cast<U8>(3 + 1));
1421  FW_ASSERT(
1422  _status == Fw::FW_SERIALIZE_OK,
1423  static_cast<FwAssertArgType>(_status)
1424  );
1425 
1426  // For FATAL, add stack size of 4 and a dummy entry. No support for stacks yet.
1427  _status = _logBuff.serializeFrom(static_cast<U8>(4));
1428  FW_ASSERT(
1429  _status == Fw::FW_SERIALIZE_OK,
1430  static_cast<FwAssertArgType>(_status)
1431  );
1432 
1433  _status = _logBuff.serializeFrom(static_cast<U32>(0));
1434  FW_ASSERT(
1435  _status == Fw::FW_SERIALIZE_OK,
1436  static_cast<FwAssertArgType>(_status)
1437  );
1438 #endif
1439 
1440  _status = file.serializeTo(
1441  _logBuff,
1442  FW_MIN(static_cast<FwSizeType>(FW_LOG_STRING_MAX_SIZE), 240)
1443  );
1444  FW_ASSERT(
1445  _status == Fw::FW_SERIALIZE_OK,
1446  static_cast<FwAssertArgType>(_status)
1447  );
1448 
1449 #if FW_AMPCS_COMPATIBLE
1450  // Serialize the argument size
1451  _status = _logBuff.serializeFrom(
1452  static_cast<U8>(sizeof(U32))
1453  );
1454  FW_ASSERT(
1455  _status == Fw::FW_SERIALIZE_OK,
1456  static_cast<FwAssertArgType>(_status)
1457  );
1458 #endif
1459  _status = _logBuff.serializeFrom(line);
1460  FW_ASSERT(
1461  _status == Fw::FW_SERIALIZE_OK,
1462  static_cast<FwAssertArgType>(_status)
1463  );
1464 
1465 #if FW_AMPCS_COMPATIBLE
1466  // Serialize the argument size
1467  _status = _logBuff.serializeFrom(
1468  static_cast<U8>(sizeof(U32))
1469  );
1470  FW_ASSERT(
1471  _status == Fw::FW_SERIALIZE_OK,
1472  static_cast<FwAssertArgType>(_status)
1473  );
1474 #endif
1475  _status = _logBuff.serializeFrom(numArgs);
1476  FW_ASSERT(
1477  _status == Fw::FW_SERIALIZE_OK,
1478  static_cast<FwAssertArgType>(_status)
1479  );
1480 
1481  this->Log_out(
1482  0,
1483  _id,
1484  _logTime,
1486  _logBuff
1487  );
1488  }
1489 
1490  // Emit the event on the text log port
1491 #if FW_ENABLE_TEXT_LOGGING
1492  if (this->isConnected_LogText_OutputPort(0)) {
1493 #if FW_OBJECT_NAMES == 1
1494  const char* _formatString =
1495  "(%s) %s: Unexpected assert in file %s, line %" PRIu32 ", args %" PRIu32 "";
1496 #else
1497  const char* _formatString =
1498  "%s: Unexpected assert in file %s, line %" PRIu32 ", args %" PRIu32 "";
1499 #endif
1500 
1501  Fw::TextLogString _logString;
1502  _logString.format(
1503  _formatString,
1504 #if FW_OBJECT_NAMES == 1
1505  this->m_objName.toChar(),
1506 #endif
1507  "AF_UNEXPECTED_ASSERT ",
1508  file.toChar(),
1509  line,
1510  numArgs
1511  );
1512 
1513  this->LogText_out(
1514  0,
1515  _id,
1516  _logTime,
1518  _logString
1519  );
1520  }
1521 #endif
1522  }
1523 
1524  // ----------------------------------------------------------------------
1525  // Time
1526  // ----------------------------------------------------------------------
1527 
1529  getTime() const
1530  {
1531  if (this->isConnected_Time_OutputPort(0)) {
1532  Fw::Time _time;
1533  this->Time_out(0, _time);
1534  return _time;
1535  }
1536  else {
1537  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1538  }
1539  }
1540 
1541 #if !FW_DIRECT_PORT_CALLS
1542 
1543  // ----------------------------------------------------------------------
1544  // Invocation functions for special output ports
1545  // ----------------------------------------------------------------------
1546 
1547  void AssertFatalAdapterComponentBase ::
1548  Log_out(
1549  FwIndexType portNum,
1550  FwEventIdType id,
1551  Fw::Time& timeTag,
1552  const Fw::LogSeverity& severity,
1553  Fw::LogBuffer& args
1554  ) const
1555  {
1556  FW_ASSERT(
1557  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
1558  static_cast<FwAssertArgType>(portNum)
1559  );
1560 
1561  FW_ASSERT(
1562  this->m_Log_OutputPort[portNum].isConnected(),
1563  static_cast<FwAssertArgType>(portNum)
1564  );
1565  this->m_Log_OutputPort[portNum].invoke(
1566  id,
1567  timeTag,
1568  severity,
1569  args
1570  );
1571  }
1572 
1573 #if FW_ENABLE_TEXT_LOGGING
1574 
1575  void AssertFatalAdapterComponentBase ::
1576  LogText_out(
1577  FwIndexType portNum,
1578  FwEventIdType id,
1579  Fw::Time& timeTag,
1580  const Fw::LogSeverity& severity,
1581  Fw::TextLogString& text
1582  ) const
1583  {
1584  FW_ASSERT(
1585  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
1586  static_cast<FwAssertArgType>(portNum)
1587  );
1588 
1589  FW_ASSERT(
1590  this->m_LogText_OutputPort[portNum].isConnected(),
1591  static_cast<FwAssertArgType>(portNum)
1592  );
1593  this->m_LogText_OutputPort[portNum].invoke(
1594  id,
1595  timeTag,
1596  severity,
1597  text
1598  );
1599  }
1600 
1601 #endif
1602 
1603  void AssertFatalAdapterComponentBase ::
1604  Time_out(
1605  FwIndexType portNum,
1606  Fw::Time& time
1607  ) const
1608  {
1609  FW_ASSERT(
1610  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
1611  static_cast<FwAssertArgType>(portNum)
1612  );
1613 
1614  FW_ASSERT(
1615  this->m_Time_OutputPort[portNum].isConnected(),
1616  static_cast<FwAssertArgType>(portNum)
1617  );
1618  this->m_Time_OutputPort[portNum].invoke(
1619  time
1620  );
1621  }
1622 
1623 #endif
1624 
1625 }
void log_FATAL_AF_UNEXPECTED_ASSERT(const Fw::StringBase &file, U32 line, U32 numArgs) const
Serialization/Deserialization operation was successful.
void log_FATAL_AF_ASSERT_1(const Fw::StringBase &file, U32 line, U32 arg1) const
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void log_FATAL_AF_ASSERT_3(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2, U32 arg3) const
I32 FwEnumStoreType
bool isConnected_Time_OutputPort(FwIndexType portNum) const
virtual const CHAR * toChar() const =0
Convert to a C-style char*.
AssertFatalAdapterComponentBase(const char *compName="")
Construct AssertFatalAdapterComponentBase object.
No time base has been established (Required)
void log_FATAL_AF_ASSERT_2(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2) const
void init()
Object initializer.
Definition: ObjBase.cpp:24
SerializeStatus
forward declaration for string
FwIdType FwEventIdType
The type of an event identifier.
void log_FATAL_AF_ASSERT_5(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4, U32 arg5) const
#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
#define FW_MIN(a, b)
MIN macro (deprecated in C++, use std::min)
Definition: BasicTypes.h:94
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
void log_FATAL_AF_ASSERT_4(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4) const
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
bool isConnected_Log_OutputPort(FwIndexType portNum) const
void log_FATAL_AF_ASSERT_0(const Fw::StringBase &file, U32 line) const
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
#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 invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
virtual ~AssertFatalAdapterComponentBase()
Destroy AssertFatalAdapterComponentBase object.
PlatformIndexType FwIndexType
A fatal non-recoverable event.
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
RateGroupDivider component implementation.
static constexpr FwIndexType getNum_Time_OutputPorts()
Implementation of malloc based allocator.
static constexpr FwIndexType getNum_Log_OutputPorts()
#define FW_ASSERT(...)
Definition: Assert.hpp:14
void log_FATAL_AF_ASSERT_6(const Fw::StringBase &file, U32 line, U32 arg1, U32 arg2, U32 arg3, U32 arg4, U32 arg5, U32 arg6) const
SerializeStatus serializeTo(SerialBufferBase &buffer, Endianness mode=Endianness::BIG) const override
Serialize the contents of this object to a buffer.