proj home

Files   Classes   Functions   Hierarchy  

typedefs.h

Go to the documentation of this file.
00001 #ifndef TYPEDEFS_H
00002 #define TYPEDEFS_H
00003 
00004 #include <cassert>
00005 #include <string>  
00006 using namespace std;
00007 
00008 typedef bool const boolc;
00009 typedef char const charc;
00010 typedef double const doublec;
00011 typedef float const floatc;
00012 typedef int const intc;
00013 typedef string const stringc;
00014 typedef unsigned char uchar;
00015 typedef unsigned char const ucharc;
00016 typedef unsigned int uint;
00017 typedef unsigned int const uintc;
00018 typedef unsigned long int ulongint;
00019 typedef unsigned long int const ulongintc;
00020 typedef unsigned short int ushortint;
00021 typedef unsigned short int const ushortintc;
00022 
00024 #define SHOW(x) #x << '=' << (x)
00025 #define SHOW2(x) ((x), #x )
00026 
00027 #define SHOW3(x) #x << "=*" << (x) << "*"
00028 
00030 #define endln "\n"
00031 
00032 
00034 #ifndef NDEBUG
00035 #define asserteval(xarg) xarg;
00036 #else
00037 #define asserteval(xarg) assert(xarg);
00038 #endif
00039 
00040 //  Assert Interface - debug then assert, other behaviour in release code. 
00041 //      assertreturnOS  assert or return 1(failure).
00042 //      assertreturnfalse  release: return false (fail)
00043 //      assertreturnfalseN negate the argument 
00044 //      assertreturn    assert or exit function
00045 //      assertreturnT (xarg,retobj) user return type
00046 
00048 #ifndef NDEBUG
00049 #define assertreturnOS(xarg) \
00050   assert(xarg); 
00051 #else
00052 #define assertreturnOS(xarg) \
00053 { \
00054   bool res = xarg;\
00055   if (res==false) \
00056     return 1; \
00057 } 
00058 #endif
00059 
00061 #ifndef NDEBUG 
00062 #define assertreturnfalse(xarg) \
00063 assert(xarg);
00064 #else
00065 #define assertreturnfalse(xarg) \
00066 {\
00067   bool res=(xarg);\
00068   if (!res) return false;\
00069 }
00070 #endif
00071 
00073 #define assertreturnfalseN(xarg) assertreturnfalse( ! (xarg) )
00074 
00076 #ifndef NDEBUG 
00077 #define assertreturn(xarg) \
00078 assert(xarg);
00079 #else
00080 #define assertreturn(xarg) \
00081 {\
00082   bool res=(xarg);\
00083   if (!res) return;\
00084 }
00085 #endif
00086 
00088 #ifndef NDEBUG 
00089 #define assertreturnT(xarg,failedreturnobj) \
00090 assert(xarg);
00091 #else
00092 #define assertreturnT(xarg,failedreturnobj) \
00093 {\
00094   bool res=(xarg);\
00095   if (!res) return failedreturnobj;\
00096 }
00097 #endif
00098 
00099 
00100 #endif
00101 

Generated on Fri Mar 4 00:49:29 2011 for Chelton Evans Source by  doxygen 1.5.8