BALL
1.4.2
|
#include <BALL/COMMON/exception.h>
Public Member Functions | |
Constructors and Destructors | |
GeneralException () | |
Default constructor. More... | |
GeneralException (const char *file, int line) | |
Constructor. More... | |
GeneralException (const char *file, int line, const String &name, const String &message) | |
Constructor. More... | |
GeneralException (const GeneralException &exception) | |
Copy constructor. More... | |
virtual | ~GeneralException () throw () |
Destructor. More... | |
Accessors | |
const char * | getName () const |
Returns the name of the exception. More... | |
const char * | getMessage () const |
Returns the error message of the exception. More... | |
void | setMessage (const std::string &message) |
Modify the exception's error message. More... | |
int | getLine () const |
Returns the line number where it occured. More... | |
const char * | getFile () const |
Returns the file where it occured. More... | |
Protected Attributes | |
const char * | file_ |
int | line_ |
std::string | name_ |
std::string | message_ |
General exception class. This class is intended as a base class for all other exceptions. Each exception class should define a constructor taking a string and an int as parameters. These two values are interpreted as the current filename and line number and is usually printed in case of an uncaught exception. To support this feature, each <b>throw</b> directive should look as follows:\par <tt><b>throw Exception::GeneralException</b>(__FILE__, __LINE__);</tt>\par <tt>__FILE__</tt> and <tt>__LINE__</tt> are built-in preprocessor macros that hold the desired information.
cerr
and Log , and finally calls exits the program cleanly (with exit code 1). This can be rather inconvenient for debugging, since you are told where the exception was thrown, but in general you do not know anything about the context. Therefore terminate
can also create a core dump. Using a debugger (e.g. dbx or gdb) you can then create a stack traceback. To create a core dump, you should set the environment variable BALL_DUMP_CORE
to any (non empty) value. Definition at line 59 of file COMMON/exception.h.
BALL::Exception::GeneralException::GeneralException | ( | ) |
Default constructor.
BALL::Exception::GeneralException::GeneralException | ( | const char * | file, |
int | line | ||
) |
Constructor.
BALL::Exception::GeneralException::GeneralException | ( | const char * | file, |
int | line, | ||
const String & | name, | ||
const String & | message | ||
) |
Constructor.
BALL::Exception::GeneralException::GeneralException | ( | const GeneralException & | exception | ) |
Copy constructor.
|
virtual |
Destructor.
const char* BALL::Exception::GeneralException::getFile | ( | ) | const |
Returns the file where it occured.
int BALL::Exception::GeneralException::getLine | ( | ) | const |
Returns the line number where it occured.
const char* BALL::Exception::GeneralException::getMessage | ( | ) | const |
Returns the error message of the exception.
const char* BALL::Exception::GeneralException::getName | ( | ) | const |
Returns the name of the exception.
void BALL::Exception::GeneralException::setMessage | ( | const std::string & | message | ) |
Modify the exception's error message.
|
protected |
Definition at line 107 of file COMMON/exception.h.
|
protected |
Definition at line 108 of file COMMON/exception.h.
|
protected |
Definition at line 111 of file COMMON/exception.h.
|
protected |
Definition at line 110 of file COMMON/exception.h.