39 #ifndef _uhal_log_exception_hpp_ 40 #define _uhal_log_exception_hpp_ 47 #include "boost/thread.hpp" 54 #define UHAL_DEFINE_DERIVED_EXCEPTION_CLASS( ClassName , BaseClassName, ClassDescription )\ 55 class ClassName : public BaseClassName {\ 57 ClassName() : BaseClassName() {}\ 58 void ThrowAsDerivedType_(){ throw ClassName(*this); } \ 59 exception* clone(){ return new ClassName(*this); } \ 61 std::string description() const throw() { return std::string( ClassDescription ); } \ 64 #define UHAL_DEFINE_EXCEPTION_CLASS( ClassName , ClassDescription ) UHAL_DEFINE_DERIVED_EXCEPTION_CLASS(ClassName, uhal::exception::exception, ClassDescription) 66 #define ExceptionClass UHAL_DEFINE_EXCEPTION_CLASS 74 #define ThrowAsDerivedType() ThrowAsDerivedType_(); throw 0; 78 #define MaxExceptionHistoryLength 100 120 virtual const
char*
what() const throw();
137 void append ( const
char* aCStr ) throw();
152 std::vector< void* > mBacktrace;
155 boost::thread::id mThreadId;
exception & operator=(const exception &aExc)
Assignment operator.
exception const exception & aExc
Constructor.
virtual std::string description() const =0
Return the description associated with this type of exception.
void append(const char *aCStr)
Add additional information to the exception message.
char * mAdditionalInfo
Memory into which additional information is added by calls to append.
virtual void ThrowAsDerivedType_()=0
Function which casts a pointer from the base type of this object to a derived type of this object and...
An abstract base exception class providing an interface to a throw/ThrowAsDerivedType mechanism which...
timeval mTime
The time at which the exception was thrown.
virtual ~exception()
Destructor.
virtual exception * clone()=0
Return a new object of the derived exception type cloned from this object.
virtual const char * what() const
Function which returns the error message associated with an exception If no error message has previou...
char * mString
Memory which the call to "what()" uses when formatting the output string.