$search

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, const DataException< Data > &e)
 DataException (const char *loc, ErrorFlag error, const std::string &msg, const Data &d)
 DataException (const char *loc, ErrorFlag error, Data &d)
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 52 of file data_exception.hpp.


Constructor & Destructor Documentation

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

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 82 of file data_exception.hpp.

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

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 95 of file data_exception.hpp.

template<typename Data >
ecl::DataException< Data >::DataException ( const char *  loc,
const DataException< Data > &  e 
) [inline]

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 108 of file data_exception.hpp.

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

Definition at line 39 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 44 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 43 of file data_exception.hpp.

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

Default exception handling output function.

Returns:
char const* : the output message.

Implements ecl::Exception.

Definition at line 122 of file data_exception.hpp.


Member Data Documentation

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

Definition at line 48 of file data_exception.hpp.

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

Definition at line 47 of file data_exception.hpp.

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

Definition at line 49 of file data_exception.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Defines


ecl_exceptions
Author(s): Daniel Stonier (d.stonier@gmail.com)
autogenerated on Fri Mar 1 15:20:36 2013