00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __EXCEPTION_H__
00021 #define __EXCEPTION_H__
00022
00023 #include <exception>
00024 #include <string>
00025 #include <sstream>
00026 #include "types.h"
00027
00028 using std::endl;
00029
00030
00031
00032 class CException : public std::exception
00033 {
00034 protected :
00035 std::string m_Message;
00036
00037 public :
00038 CException( const std::string & Message = "" );
00039 virtual ~CException() throw();
00040 virtual const char * what() const throw();
00041 };
00042
00043
00044
00045 struct CAssertException : public CException
00046 {
00047 CAssertException( const std::string & File, uint Line, const std::string & Message );
00048 };
00049
00050 #define Assert(condition) if (!(condition)) throw CAssertException(__FILE__, __LINE__, "Condition non satisfaite\n\n" #condition)
00051
00052
00053
00054 struct COutOfMemory : public CException
00055 {
00056 COutOfMemory( const std::string & Message );
00057 };
00058
00059 #endif //__EXCEPTION_H__