Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cExceptionSystem.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cExceptionSystem_H
7 #define _INC_cExceptionSystem_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "cException.h"
13 #include "cUnitTestDecl.h"
14 
15 #if defined(_CPPUNWIND)
16 
17 namespace Gray
18 {
20 
21  class GRAYCORE_LINK cExceptionSystem : public cException
22  {
30 
31  public:
32 #ifdef _WIN32
33  typedef unsigned int SYSCODE_t;
34 #else
35  typedef int SYSCODE_t;
36 #endif
37 
38  protected:
39  SYSCODE_t m_nSystemErrorCode;
40  void* m_pAddress;
41 
42  public:
43 #ifdef _WIN32
44  cExceptionSystem(SYSCODE_t uNTStatus, struct _EXCEPTION_POINTERS* pData = nullptr);
45 #else
46  cExceptionSystem(SYSCODE_t iSignal);
47 #endif
48  virtual ~cExceptionSystem() THROW_DEF;
49 
50  virtual BOOL GetErrorMessage(GChar_t* lpszError, UINT nMaxError, UINT* pnHelpContext) override;
51 
52  static void GRAYCALL InitForCurrentThread();
53 #ifdef _WIN32
54  static CATTR_NORETURN void _cdecl CatchException(SYSCODE_t uNTStatus, struct _EXCEPTION_POINTERS* pData); // throw (cExceptionSystem);
55  static CATTR_NORETURN void _cdecl CatchTerminate(void);
56  static int _cdecl FilterException(SYSCODE_t uNTStatus, struct _EXCEPTION_POINTERS* pData); // throw (cExceptionSystem);
57 #else
58  static void __cdecl SignalHandler(SYSCODE_t iSignal);
59 #endif
61  };
62 }
63 #endif
64 #endif
#define CATTR_NORETURN
Definition: GrayCore.h:93
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define THROW_DEF
Definition: HResult.h:25
#define UNITTEST2_PREDEF(x)
Definition: cUnitTestDecl.h:19
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
class __DECL_IMPORT cException
Definition: cExceptionBase.h:47
char GChar_t
My version of TCHAR, _TCHAR.
Definition: StrConst.h:26