Public Member Functions | Private Attributes
ecl::DataException< Data > Class Template Reference

Extended exception class that bundles location, message and data. More...

#include <data_exception.hpp>

Inheritance diagram for ecl::DataException< Data >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

const Data & data () const
 The bundled data object.
 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 ErrorFlagflag () const
 Flag enumerating the type of exception thrown.
const char * what () const throw ()
virtual ~DataException () throw ()

Private Attributes

Data error_data
ErrorFlag error_type
std::string message

Detailed Description

template<typename Data>
class ecl::DataException< Data >

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.

See also:
Exception, StandardException, Exceptions Guide.

Definition at line 58 of file data_exception.hpp.


Constructor & Destructor Documentation

template<typename Data >
ecl::DataException< Data >::DataException ( const char *  loc,
ErrorFlag  error,
Data &  d 
)

Default constructor for data exceptions.

Parameters:
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.

template<typename Data >
ecl::DataException< Data >::DataException ( const char *  loc,
ErrorFlag  error,
const std::string &  msg,
const Data &  d 
)

Constructor for data exceptions with a custom message.

Parameters:
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.

template<typename Data >
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.

Parameters:
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.

template<typename Data>
virtual ecl::DataException< Data >::~DataException ( ) throw () [inline, virtual]

Definition at line 65 of file data_exception.hpp.


Member Function Documentation

template<typename Data>
const Data& ecl::DataException< Data >::data ( ) const [inline]

The bundled data object.

Definition at line 70 of file data_exception.hpp.

template<typename Data>
const ErrorFlag& ecl::DataException< Data >::flag ( ) const [inline]

Flag enumerating the type of exception thrown.

Definition at line 69 of file data_exception.hpp.

template<typename Data >
const char * ecl::DataException< Data >::what ( ) const throw () [virtual]

Default exception handling output function.

Returns:
char const* : the output message.

Implements ecl::Exception.

Definition at line 128 of file data_exception.hpp.


Member Data Documentation

template<typename Data>
Data ecl::DataException< Data >::error_data [private]

Definition at line 74 of file data_exception.hpp.

template<typename Data>
ErrorFlag ecl::DataException< Data >::error_type [private]

Definition at line 73 of file data_exception.hpp.

template<typename Data>
std::string ecl::DataException< Data >::message [private]

Definition at line 75 of file data_exception.hpp.


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


ecl_exceptions
Author(s): Daniel Stonier (d.stonier@gmail.com)
autogenerated on Thu Jan 2 2014 11:11:54