#include <Exception.h>


Public Member Functions | |
| Exception (const String &msg, const String &sourceFile, int line) | |
| Exception (const String &msg, const String &sourceFile, int line, const String callerName) | |
| Exception (const Exception &) | |
| virtual | ~Exception () |
| virtual String | toString () const |
| virtual String | getClassName () const |
| String | stackTrace (const String callerName) const |
| Tries to get the stack trace of current point. | |
Public Attributes | |
| const String | msg |
| const String | sourceFile |
| const int | line |
| String | trace |
| gets filled by sTrace upon throwing time to fetch current stack trace | |
Private Member Functions | |
| bool | operator== (const Exception &) const |
| bool | operator!= (const Exception &e) const |
| const Exception & | operator= (const Exception &) |
Base class for exceptions
Definition at line 81 of file Exception.h.
Create an Exception object Also tries to fetch a stack trace and stores it in the trace field.
| msg | detailed message |
| sourceFile | name of the source file that thrown the exception |
| line | line number in the souce file |
Definition at line 72 of file Exception.cpp.
| Exception::Exception | ( | const String & | msg, |
| const String & | sourceFile, | ||
| int | line, | ||
| const String | callerName | ||
| ) | [explicit] |
Definition at line 79 of file Exception.cpp.
| Exception::Exception | ( | const Exception & | e ) |
Definition at line 82 of file Exception.cpp.
| Exception::~Exception | ( | ) | [virtual] |
Definition at line 197 of file Exception.cpp.
| String Exception::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
Reimplemented in alize::IndexOutOfBoundsException, alize::IOException, alize::IdAlreadyExistsException, alize::InvalidDataException, alize::FileNotFoundException, alize::EOFException, alize::OutOfMemoryException, alize::ParamNotFoundInConfigException, and alize::ConfigCheckException.
Definition at line 94 of file Exception.cpp.
| bool alize::Exception::operator!= | ( | const Exception & | e ) | const [private] |
Not implemented
| bool alize::Exception::operator== | ( | const Exception & | ) | const [private] |
Tries to get the stack trace of current point.
| callerName | name of the class derived FooException class (used to avoid gathering stack trace for EOFException which are non-failing) |
/brief stackTrace - tries to get the stack trace of current point. If (libALIZE and) MISTRAL bits were compiled with -g or -ggdb option, prints srcFile+line and method parameters. Otherwise, just method names.
ATTENTION: works only on GNU/Linux systems, because:
CREDITS: Idea to call gdb from within exception/crash handler to get a correct stack trace comes from: Mark Kretschmann markey, prominent Amarok hacker / C++ guru 20080904120004 Florian Verdet _goto. <florian.verdet@univ-avignon.fr>,<hacking@verdet.ch>
TODO: make gdb call etc. parametrable through a config option (i.e. debugLevel) for:
EOFException is usually catched non-failing and occurs for every file read. Thus we don't build a stack trace (otherwise, we loose far too much time.
FileNotFoundException may be catched non-failing in EnergyDetectorMain.cpp(1*), SegTools.cpp(each lblFile, currently unused), LabelFusion.cpp(1*). Since there's no so many (useless) cases, we build a stack trace anyway (no special handling)
< fetch required bits (workaround the fact we don't have access to any info (argv[0] i.e.) )
Definition at line 122 of file Exception.cpp.
References NULL.
| String Exception::toString | ( | ) | const [virtual] |
This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object
Reimplemented from alize::Object.
Reimplemented in alize::IndexOutOfBoundsException, and alize::IOException.
Definition at line 85 of file Exception.cpp.
References line, msg, sourceFile, trace, and alize::String::valueOf().
Referenced by alize::ULongVector::load(), alize::Matrix< T >::loadDB(), alize::Matrix< T >::randomInit(), alize::ULongVector::save(), and alize::Matrix< T >::saveDB().
| const int alize::Exception::line |
Definition at line 121 of file Exception.h.
Referenced by toString().
| const String alize::Exception::msg |
Definition at line 119 of file Exception.h.
Referenced by toString().
Definition at line 120 of file Exception.h.
Referenced by toString().
gets filled by sTrace upon throwing time to fetch current stack trace
Definition at line 122 of file Exception.h.
Referenced by toString().
1.7.2