cel_exception.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00004 //
00005 // (C) 2003-2006 Celartem Technology Inc. All rights reserved.
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 } // namespace Celartem
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_

This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:21:54 2008.