μHAL (v2.7.9)
Part of the IPbus software repository
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
uhal::exception::exception Class Referenceabstract

An abstract base exception class, including an interface to throw as the derived type (for passing exceptions between threads) More...

#include <uhal/log/exception.hpp>

Inheritance diagram for uhal::exception::exception:
[legend]
Collaboration diagram for uhal::exception::exception:
[legend]

Public Member Functions

exceptionoperator= (const exception &aExc)
 Assignment operator. More...
 
virtual ~exception () throw ()
 
virtual const char * what () const throw ()
 Function which returns the error message associated with an exception If no error message has previously been defined, then it makes the typename readable (where appropriate) and returns this instead. More...
 
virtual void throwAsDerivedType ()=0
 Function which casts a pointer from the base type of this object to a derived type of this object and rethrows as the derived type. More...
 
void append (const char *aCStr) throw ()
 Add additional information to the exception message. More...
 

Public Attributes

exception const exceptionaExc
 

Protected Member Functions

virtual std::string description () const =0 throw ()
 Return the description associated with this type of exception. More...
 

Private Attributes

timeval mTime
 The time at which the exception was thrown. More...
 
char * mString
 Memory into which message is added by calls to append. More...
 

Detailed Description

An abstract base exception class, including an interface to throw as the derived type (for passing exceptions between threads)

Definition at line 70 of file exception.hpp.

Constructor & Destructor Documentation

◆ ~exception()

uhal::exception::exception::~exception ( )
throw (
)
virtual

Definition at line 77 of file exception.cpp.

Member Function Documentation

◆ append()

void uhal::exception::exception::append ( const char *  aCStr)
throw (
)

Add additional information to the exception message.

Parameters
aCStradditional information to be added to the exception message

Definition at line 104 of file exception.cpp.

Referenced by uhal::log().

◆ description()

virtual std::string uhal::exception::exception::description ( ) const
throw (
)
protectedpure virtual

Return the description associated with this type of exception.

Returns
the description associated with this type of exception

◆ operator=()

exception & uhal::exception::exception::operator= ( const exception aExc)

Assignment operator.

Parameters
aExcan exception to copy
Returns
a reference to this object

Definition at line 70 of file exception.cpp.

◆ throwAsDerivedType()

virtual void uhal::exception::exception::throwAsDerivedType ( )
pure virtual

Function which casts a pointer from the base type of this object to a derived type of this object and rethrows as the derived type.

Referenced by uhal::Mmap::read(), and uhal::PCIe::read().

◆ what()

const char * uhal::exception::exception::what ( ) const
throw (
)
virtual

Function which returns the error message associated with an exception If no error message has previously been defined, then it makes the typename readable (where appropriate) and returns this instead.

Returns
the error message associated with an exception

Definition at line 87 of file exception.cpp.

References setupTemplate::description.

Referenced by uhal::Mmap::read(), uhal::PCIe::read(), uhal::TCP< InnerProtocol, nr_buffers_per_send >::read_callback(), and uhal::UDP< InnerProtocol >::read_callback().

Member Data Documentation

◆ aExc

exception const exception& uhal::exception::exception::aExc

Definition at line 76 of file exception.hpp.

◆ mString

char* uhal::exception::exception::mString
private

Memory into which message is added by calls to append.

Definition at line 116 of file exception.hpp.

◆ mTime

timeval uhal::exception::exception::mTime
private

The time at which the exception was thrown.

Definition at line 113 of file exception.hpp.


The documentation for this class was generated from the following files: