Extended exception class that bundles location, message and data. More...
#include <data_exception.hpp>
Public Member Functions | |
const Data & | data () const |
The bundled data object. More... | |
DataException (const char *loc, ErrorFlag error, Data &d) | |
DataException (const char *loc, ErrorFlag error, const std::string &msg, const Data &d) | |
DataException (const char *loc, const DataException< Data > &e) | |
const ErrorFlag & | flag () const |
Flag enumerating the type of exception thrown. More... | |
const char * | what () const throw () |
virtual | ~DataException () throw () |
Public Member Functions inherited from ecl::Exception | |
virtual | ~Exception () throw () |
Private Attributes | |
Data | error_data |
ErrorFlag | error_type |
std::string | message |
Additional Inherited Members | |
Protected Member Functions inherited from ecl::Exception | |
Exception () | |
Exception (const char *loc) | |
Protected Attributes inherited from ecl::Exception | |
std::string | location |
Extended exception class that bundles location, message and data.
This exception class extends the StandardException to include an additional component, a single data object. Usually its a good idea to keep the data object small - it is copied into the exception so that it cannot be lost if the original object should die.
The bundled data object must be streamable to standard output if this class is going to utilise the generic what() output.
Definition at line 58 of file data_exception.hpp.
ecl::DataException< Data >::DataException | ( | const char * | loc, |
ErrorFlag | error, | ||
Data & | d | ||
) |
Default constructor for data exceptions.
loc | : use with the LOC macro, identifies the line and file of the code. |
error | : enumerated exception error type. |
d | : the data bundled with the exception. |
Definition at line 88 of file data_exception.hpp.
ecl::DataException< Data >::DataException | ( | const char * | loc, |
ErrorFlag | error, | ||
const std::string & | msg, | ||
const Data & | d | ||
) |
Constructor for data exceptions with a custom message.
loc | : use with the LOC macro, identifies the line and file of the code. |
error | : enumerated exception error type. |
msg | : extra detail message. |
d | : the data bundled with the exception. |
Definition at line 101 of file data_exception.hpp.
ecl::DataException< Data >::DataException | ( | const char * | loc, |
const DataException< Data > & | e | ||
) |
Constructor for data exceptions that enables rethrowing of an existing exception up the heirarchy with a new code location stamp.
loc | : use with the LOC macro, identifies the line and file of the code. |
e | : a caught standard exception that is to be rethrown. |
Definition at line 114 of file data_exception.hpp.
|
inlinevirtual |
Definition at line 65 of file data_exception.hpp.
|
inline |
The bundled data object.
Definition at line 70 of file data_exception.hpp.
|
inline |
Flag enumerating the type of exception thrown.
Definition at line 69 of file data_exception.hpp.
|
virtual |
Default exception handling output function.
Implements ecl::Exception.
Definition at line 128 of file data_exception.hpp.
|
private |
Definition at line 74 of file data_exception.hpp.
|
private |
Definition at line 73 of file data_exception.hpp.
|
private |
Definition at line 75 of file data_exception.hpp.