00001 #ifndef OBT_ASSERT_H 00002 #define OBT_ASSERT_H 00003 00004 #include "OBT_Exception.h" 00005 #include "OBTTrace.h" 00006 00015 #define OBT_ASSERT( assertion ) \ 00016 if ( !( assertion ) ) \ 00017 { \ 00018 std::string assertionMessage( "OBT Assertion Failed : " ) ; \ 00019 assertionMessage += #assertion ; \ 00020 TRACE_CRITICAL( assertionMessage.c_str() ) ; \ 00021 throw OBT::OBT_Exception( assertionMessage.c_str() ) ; \ 00022 } 00023 00024 #ifndef NDEBUG 00025 00033 #define OBT_DBG_ASSERT( assertion ) OBT_ASSERT( assertion ) 00034 00035 #else 00036 #define OBT_DBG_ASSERT( assertion ) 00037 #endif 00038 00039 #define STATIC_CHECK(expr, msg) \ 00040 typedef char ERROR_##msg[1][( expr )] 00041 00042 #endif //OBT_ASSERT_H 00043