|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
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();
virtual const char * what() const
Function which returns the error message associated with an exception If no error message has previou...
timeval mTime
The time at which the exception was thrown.
void append(const char *aCStr)
Add additional information to the exception message.
An abstract base exception class, including an interface to throw as the derived type (for passing ex...
virtual std::string description() const =0
Return the description associated with this type of exception.
virtual void throwAsDerivedType()=0
Function which casts a pointer from the base type of this object to a derived type of this object and...
exception & operator=(const exception &aExc)
Assignment operator.
exception const exception & aExc
char * mString
Memory into which message is added by calls to append.