Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

hyp.ker.assert.h

00001 /*
00002 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00003  Hyperion Pattern.
00004  Hyperion Pattern is a part of the Hyperion Project.
00005 ----------------------------------------------------------
00006  Copyright (c) 2001 Pierre Rebours.
00007 
00008  This library is free software; you can redistribute it and/or
00009  modify it under the terms of the GNU Lesser General Public
00010  License as published by the Free Software Foundation; either
00011  version 2.1 of the License, or (at your option) any later version.
00012 
00013  This library is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  
00017  See hyp.license.txt file for more information about the license.
00018  
00019  Web: http://lagrandeporte.multimania.com/hyperion
00020  Email: amtycho@yahoo.fr
00021 ----------------------------------------------------------
00022  CVS
00023  $Log$
00024 
00025  Acknowledgements stx
00026  Creation 19/03/01 PR
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

Top of Page
written by Pierre Rebours © 2000-2001. Terms of Use.