Public Member Functions | Protected Attributes

ExceptionBase Class Reference
[Exceptions and assertions]

Inheritance diagram for ExceptionBase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ExceptionBase ()
 ExceptionBase (const char *f, const int l, const char *func, const char *c, const char *e)
 ExceptionBase (const ExceptionBase &exc)
virtual ~ExceptionBase () throw ()
void set_fields (const char *f, const int l, const char *func, const char *c, const char *e)
void print_exc_data (std::ostream &out) const
virtual void print_info (std::ostream &out) const
virtual const char * what () const throw ()
void print_stack_trace (std::ostream &out) const

Protected Attributes

const char * file
unsigned int line
const char * function
const char * cond
const char * exc
char ** stacktrace
int n_stacktrace_frames

Detailed Description

This class is the base class for all exception classes. Do not use its methods and variables directly since the interface and mechanism may be subject to change. Rather create new exception classes using the DeclException macro family.

See the Exceptions and assertions module for more details on this class and what can be done with classes derived from it.

Author:
Wolfgang Bangerth, 1997, extensions 1998

Definition at line 48 of file exceptions.h.


Constructor & Destructor Documentation

ExceptionBase::ExceptionBase (  )

Default constructor.

ExceptionBase::ExceptionBase ( const char *  f,
const int  l,
const char *  func,
const char *  c,
const char *  e 
)

The constructor takes the file in which the error happened, the line and the violated condition as well as the name of the exception class as a char* as arguments.

ExceptionBase::ExceptionBase ( const ExceptionBase exc )

Copy constructor.

virtual ExceptionBase::~ExceptionBase (  ) throw () [virtual]

Destructor. Empty, but needed for the sake of exception specification, since the base class has this exception specification and the automatically generated destructor would have a different one due to member objects.


Member Function Documentation

void ExceptionBase::set_fields ( const char *  f,
const int  l,
const char *  func,
const char *  c,
const char *  e 
)

Set the file name and line of where the exception appeared as well as the violated condition and the name of the exception as a char pointer.

void ExceptionBase::print_exc_data ( std::ostream &  out ) const

Print out the general part of the error information.

virtual void ExceptionBase::print_info ( std::ostream &  out ) const [virtual]

Print more specific information about the exception which occured. Overload this function in your own exception classes.

virtual const char* ExceptionBase::what (  ) const throw () [virtual]

Function derived from the base class which allows to pass information like the line and name of the file where the exception occured as well as user information.

This function is mainly used when using exceptions declared by the DeclException* macros with the throw mechanism or the AssertThrow macro.

void ExceptionBase::print_stack_trace ( std::ostream &  out ) const

Print a stacktrace, if one has been recorded previously, to the given stream.


Member Data Documentation

const char* ExceptionBase::file [protected]

Name of the file this exception happen in.

Definition at line 138 of file exceptions.h.

unsigned int ExceptionBase::line [protected]

Line number in this file.

Definition at line 143 of file exceptions.h.

const char* ExceptionBase::function [protected]

Name of the function, pretty printed.

Definition at line 148 of file exceptions.h.

const char* ExceptionBase::cond [protected]

The violated condition, as a string.

Definition at line 153 of file exceptions.h.

const char* ExceptionBase::exc [protected]

Name of the exception and call sequence.

Definition at line 158 of file exceptions.h.

char** ExceptionBase::stacktrace [protected]

A backtrace to the position where the problem happened, if the system supports this.

Definition at line 165 of file exceptions.h.

The number of stacktrace frames that are stored in the previous variable. Zero if the system does not support stack traces.

Definition at line 174 of file exceptions.h.


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

deal.II documentation generated on Fri Feb 3 2012 06:04:07 by doxygen 1.7.2