μHAL (v2.6.5)
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 providing an interface to a throw/ThrowAsDerivedType mechanism which will allow us to catch the base type and ThrowAsDerivedType the derived type. 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 ()
 Destructor. More...
 
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...
 
virtual exceptionclone ()=0
 Return a new object of the derived exception type cloned from this object. More...
 
void append (const char *aCStr) throw ()
 Add additional information to the exception message. More...
 

Public Attributes

exception const exceptionaExc
 Constructor. More...
 

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 which the call to "what()" uses when formatting the output string. More...
 
char * mAdditionalInfo
 Memory into which additional information is added by calls to append. More...
 

Detailed Description

An abstract base exception class providing an interface to a throw/ThrowAsDerivedType mechanism which will allow us to catch the base type and ThrowAsDerivedType the derived type.

Definition at line 89 of file exception.hpp.

Constructor & Destructor Documentation

◆ ~exception()

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

Destructor.

Definition at line 100 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 208 of file exception.cpp.

◆ clone()

virtual exception* uhal::exception::exception::clone ( )
pure virtual

Return a new object of the derived exception type cloned from this object.

Returns
a new object of the derived exception type

◆ 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 89 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.

◆ 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 116 of file exception.cpp.

References setupTemplate::description, and GccOutputCleaner::TStyle().

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

Member Data Documentation

◆ aExc

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

Constructor.

Copy constructor

Parameters
aExcan exception to copy

Definition at line 101 of file exception.hpp.

◆ mAdditionalInfo

char* uhal::exception::exception::mAdditionalInfo
private

Memory into which additional information is added by calls to append.

Definition at line 164 of file exception.hpp.

◆ mString

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

Memory which the call to "what()" uses when formatting the output string.

Definition at line 161 of file exception.hpp.

◆ mTime

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

The time at which the exception was thrown.

Definition at line 158 of file exception.hpp.


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