Flow123d
jenkins-Flow123d-linux-release-multijob-282
|
Base of exceptions used in Flow123d. More...
#include <exceptions.hh>
Public Member Functions | |
ExceptionBase () | |
Default constructor, just calls fill_stacktrace() . More... | |
ExceptionBase (const ExceptionBase &other) | |
Copy constructor, performs deep copy of stacktrace. More... | |
void | fill_stacktrace () |
Call GNU backtrace if available, save call stack information into stacktrace member. More... | |
void | print_stacktrace (std::ostream &out) const |
Prints formated stacktrace into given stream out . More... | |
virtual void | print_info (std::ostringstream &out) const =0 |
virtual const char * | what () const throw () |
virtual | ~ExceptionBase () throw () |
Destructor, possibly free stacktrace. More... | |
Private Attributes | |
char ** | stacktrace |
Array of backtrace frames returned by glibc backtrace_symbols. More... | |
int | n_stacktrace_frames |
Size of stacktrace table - number of frames. More... | |
Base of exceptions used in Flow123d.
We use boost::exception as parent in order to allow passing some data through the exception object from the throw point to the catch point. See DECLARE_EXCEPTION macro for usage.
When deriving particular exceptions always use virtual inheritance:
Definition at line 55 of file exceptions.hh.
ExceptionBase::ExceptionBase | ( | ) |
Default constructor, just calls fill_stacktrace()
.
Definition at line 22 of file exceptions.cc.
ExceptionBase::ExceptionBase | ( | const ExceptionBase & | other | ) |
Copy constructor, performs deep copy of stacktrace.
Definition at line 30 of file exceptions.cc.
|
virtual |
Destructor, possibly free stacktrace.
Definition at line 48 of file exceptions.cc.
void ExceptionBase::fill_stacktrace | ( | ) |
Call GNU backtrace if available, save call stack information into stacktrace
member.
Definition at line 57 of file exceptions.cc.
|
pure virtual |
Purely virtual method, that should be implemented by descendants. Prints specific error message into stream out
. In particular you can use macros DECLARE_EXCEPTION or DECLARE_INPUT_EXCEPTION for easy declarations.
void ExceptionBase::print_stacktrace | ( | std::ostream & | out | ) | const |
Prints formated stacktrace into given stream out
.
Definition at line 75 of file exceptions.cc.
|
virtual |
Overloaded method for output the exception message if it is not catched. Implements composition of complex message including diagnostic informations and stack trace. Should not be overloded in descendant classes. Use print_info
instead.
Reimplemented in Input::Exception.
Definition at line 116 of file exceptions.cc.
|
private |
Size of stacktrace table - number of frames.
Definition at line 86 of file exceptions.hh.
|
private |
Array of backtrace frames returned by glibc backtrace_symbols.
Definition at line 83 of file exceptions.hh.