00001
00004
00005
00006
00007
00008 #ifndef _cel_exception_h_
00009 #define _cel_exception_h_
00010
00011 #include <stdexcept>
00012 #include "cel_error.h"
00013
00014 namespace Celartem
00015 {
00016 class String;
00017
00075 class Exception : public std::exception
00076 {
00077 public:
00096 Exception(
00097 GeneralErrorDefinition inError,
00098 const char *inErrorDesc,
00099 const char *inFileName,
00100 int inLine,
00101 const char *inFuncName = "");
00102
00121 Exception(
00122 GeneralErrorDefinition inError,
00123 const String& inErrorDesc,
00124 const char *inFileName,
00125 int inLine,
00126 const char *inFuncName = "");
00127
00133 Exception(const Exception& inException);
00134
00140 Exception& operator=(const Exception& inException);
00141
00150 GeneralErrorDefinition getError() const;
00151
00152 virtual ~Exception() throw();
00153
00160 String getMessage() const;
00161
00167 virtual const char *what() const throw();
00168
00169 private:
00170 GeneralErrorDefinition m_error;
00171 String* m_message;
00172 };
00173
00174 }
00175
00182 #define celThrow(err) \
00183 throw ::Celartem::Exception((::Celartem::GeneralErrorDefinition)err, #err, __FILE__, __LINE__, __FUNCTION__)
00184
00195 #define celThrow2(err,str) \
00196 throw ::Celartem::Exception((::Celartem::GeneralErrorDefinition)err, str, __FILE__, __LINE__, __FUNCTION__)
00197
00198 #endif // _cel_exception_h_