F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
AssertFatalAdapterComponentImpl.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title AssertFatalAdapterImpl.hpp
3 // \author tcanham
4 // \brief hpp file for AssertFatalAdapter component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef AssertFatalAdapter_HPP
14 #define AssertFatalAdapter_HPP
15 
17 
18 namespace Svc {
19 
22  {
23 
24  public:
25 
26  // ----------------------------------------------------------------------
27  // Construction, initialization, and destruction
28  // ----------------------------------------------------------------------
29 
33  const char *const compName
34  );
35 
38  void init(
39  const NATIVE_INT_TYPE instance = 0
40  );
41 
45 
47  void reportAssert(
48  FILE_NAME_ARG file,
49  NATIVE_UINT_TYPE lineNo,
50  NATIVE_UINT_TYPE numArgs,
51  FwAssertArgType arg1,
52  FwAssertArgType arg2,
53  FwAssertArgType arg3,
54  FwAssertArgType arg4,
55  FwAssertArgType arg5,
56  FwAssertArgType arg6
57  );
58 
59  private:
60 
61  class AssertFatalAdapter : public Fw::AssertHook {
62  public:
65  void regAssertReporter(AssertFatalAdapterComponentImpl* compPtr);
66  private:
67  void reportAssert(
68  FILE_NAME_ARG file,
69  NATIVE_UINT_TYPE lineNo,
70  NATIVE_UINT_TYPE numArgs,
71  FwAssertArgType arg1,
72  FwAssertArgType arg2,
73  FwAssertArgType arg3,
74  FwAssertArgType arg4,
75  FwAssertArgType arg5,
76  FwAssertArgType arg6
77  );
78 
79  // Prevent actual assert since FATAL handler will deal with it
80  void doAssert();
81 
83  };
84 
85  AssertFatalAdapter m_adapter;
86 
87  };
88 
89 } // end namespace Svc
90 
91 #endif
#define FILE_NAME_ARG
Definition: Assert.hpp:16
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition: BasicTypes.h:52
PlatformAssertArgType FwAssertArgType
Definition: FpConfig.h:34
void init()
Object initializer.
Definition: ObjBase.cpp:27
Auto-generated base for AssertFatalAdapter component.
void reportAssert(FILE_NAME_ARG file, NATIVE_UINT_TYPE lineNo, NATIVE_UINT_TYPE numArgs, FwAssertArgType arg1, FwAssertArgType arg2, FwAssertArgType arg3, FwAssertArgType arg4, FwAssertArgType arg5, FwAssertArgType arg6)
Report the assert as a FATAL.
AssertFatalAdapterComponentImpl AssertFatalAdapter