39#ifndef _uhal_log_exception_hpp_
40#define _uhal_log_exception_hpp_
49#define UHAL_DEFINE_DERIVED_EXCEPTION_CLASS( ClassName , BaseClassName, ClassDescription )\
50 class ClassName : public BaseClassName {\
52 ClassName() : BaseClassName() {}\
53 ClassName(const std::string& aMessage) : BaseClassName() {append(aMessage.c_str());}\
54 void throwAsDerivedType(){ throw ClassName(*this); } \
56 std::string description() const throw() { return std::string( ClassDescription ); } \
59#define UHAL_DEFINE_EXCEPTION_CLASS( ClassName , ClassDescription ) UHAL_DEFINE_DERIVED_EXCEPTION_CLASS(ClassName, uhal::exception::exception, ClassDescription)
92 virtual const
char*
what() const throw();
101 void append ( const
char* aCStr ) throw();
An abstract base exception class, including an interface to throw as the derived type (for passing ex...
exception const exception & aExc
exception & operator=(const exception &aExc)
Assignment operator.
timeval mTime
The time at which the exception was thrown.
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.
virtual const char * what() const
Function which returns the error message associated with an exception If no error message has previou...
virtual void throwAsDerivedType()=0
Function which casts a pointer from the base type of this object to a derived type of this object and...
char * mString
Memory into which message is added by calls to append.