VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlAssert.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *******************************************************************************/
6 #pragma once
7 
8 #include "vlExceptions.h"
9 #include "vlPrint.h"
10 
11 
12 #ifdef DtUSE_UTILITIES_NAMESPACE
13 namespace DtUSE_UTILITIES_NAMESPACE
14 {
15 #endif
16 
19 
20 
29 {
30 public:
31 
32  typedef void (*DtAssertFunc)
33  (const char* fName, const char *func, int fLine, const char*operation);
34 
39  static DtAssertFunc theAssertFunction;
40 
43 
46  static const DtAssertFunc theNoAssertFunction;
47 
48  static DtAssertFunc getAssertFunction();
49  static void setAssertFunction(DtAssertFunc func);
50 
52  static void warn();
53 
56  static void fatal();
57 
59  static void ignore();
60 
61 
62 protected:
63 
64  static void defaultFatal(const char* file, const char *func, int line, const char *operation);
65  static void defaultNonFatal(const char* file, const char *func, int line, const char *operation);
66 
67 private:
68 
70  DtAssert();
71 
73  DtAssert(const DtAssert&other);
74 
76  DtAssert &operator=(const DtAssert&);
77 
78 };
79 
81 #if defined(__GNUC__)
82 #define __DTFUNC__ __PRETTY_FUNCTION__
83 #elif defined(_WIN32) && (_MSC_VER != 1200)
84 #define __DTFUNC__ __FUNCTION__
85 #else
86 #define __DTFUNC__ "-Unknown Function-"
87 #endif
88 
100 #define DtAssert(a) \
101 ((DtAssert::theAssertFunction != DtAssert::theNoAssertFunction && !(a)) ? \
102  DtAssert::theAssertFunction(__FILE__,__DTFUNC__, __LINE__, #a) : ((void)0 ) )
103 
104 
105 #ifdef DtUSE_UTILITIES_NAMESPACE
106 }
107 #endif
108 

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)