00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _hyp_ker_assert_h_
00032 #define _hyp_ker_assert_h_
00033
00034 #ifndef hyp_KERNEL_CORE_INSIDE
00035 #error Inclusion not allowed (include hyp.kernel.core.h instead)
00036 #endif
00037
00041 enum EMessageType {
00042 notify,
00043 fatal,
00044 assertion
00045 };
00046
00047 hyp_ker_DLL void Message(const std::string&,EMessageType);
00048
00049 #ifdef hyp_DEBUG
00050
00054 #define hyp_ASSERT( Condition ) \
00055 { \
00056 if ( !( Condition ) ) { \
00057 std::string formated_msg; \
00058 hyp_STRING_TRACE( formated_msg , ("%s",#Condition) ); \
00059 hyp::ker::Message( formated_msg , hyp::ker::assertion); \
00060 } \
00061 }
00062
00063 #else
00064 #define hyp_ASSERT( Condition )
00065 #endif
00066
00072 #define hyp_FATAL( Msg ) \
00073 { \
00074 std::string formated_msg; \
00075 hyp_STRING_TRACE( formated_msg , Msg ); \
00076 hyp::ker::Message( formated_msg, hyp::ker::fatal); \
00077 }
00078
00083 #define hyp_NOTIFY( Msg ) \
00084 { \
00085 std::string formated_msg; \
00086 hyp_STRING_TRACE( formated_msg , Msg ); \
00087 hyp::ker::Message( formated_msg, hyp::ker::notify ); \
00088 }
00089
00090
00091 #endif