![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Global exception object for all non-standard exceptions thrown by the code. More...
#include <Exception.hh>
Public Member Functions | |
| Exception () throw () | |
| Default constructor, initilizes everything to 0. More... | |
| Exception (exceptionLevel level, std::string errorMessage, std::string location) throw () | |
| Normal constructor with error level, error message and location. More... | |
| ~Exception () throw () | |
| Destructor. More... | |
| const char * | what () const throw () |
| Return char buffer of message+" at "+location, memory remains owned by Exception. More... | |
| void | Print () |
| Print the error message and location. More... | |
| exceptionLevel | GetErrorLevel () const |
| Get the severity of the exception. More... | |
| std::string | GetMessage () const |
| Get the error message (as defined by constructor) More... | |
| void | SetMessage (std::string new_message) |
| Set the error message. More... | |
| std::string | GetLocation () const |
| Get the location (as defined by Exception constructor) of the error. More... | |
| std::string | GetStackTrace () const |
| Return the stack trace if it was stored. More... | |
Static Public Member Functions | |
| static std::string | MakeStackTrace (size_t skipTrace) |
| Gcc-specific code to recover the stack trace as a string. More... | |
| static void | SetWillDoStackTrace (bool willDoStackTrace) |
| Set that it makes a stack trace on exception. More... | |
| static bool | GetWillDoStackTrace () |
| Return whether makes a stack trace on exception. More... | |
Private Member Functions | |
| void | SetWhat (std::string what_str) |
| Sets the reason for the exception. More... | |
Private Attributes | |
| std::string | _message |
| Message to be thrown. More... | |
| std::string | _location |
| Name of the function that threw. More... | |
| std::string | _stacktrace |
| Stack trace as an std::string. More... | |
| std::vector< char > | _what |
| Reason for throwing. More... | |
| exceptionLevel | _level |
| Severity of the exception. More... | |
Static Private Attributes | |
| static const size_t | _maxStackSize = 100 |
| Maximum memory size of the stack. More... | |
| static bool | _willDoStackTrace = true |
| Returns the stack trace if true. More... | |
Global exception object for all non-standard exceptions thrown by the code.
Exception has a severity (exceptionLevel), an error message and a location. Also a function to return the stack trace (gcc only).
If not using gcc, define NO_STACKTRACE at compile time
Note that the throw() directives are there to explicitly declare that exceptions cannot be thrown in the constructors and destructors
| Exceptions::Exception::Exception | ( | ) | ||
| throw | ( | |||
| ) | ||||
Default constructor, initilizes everything to 0.
| Exceptions::Exception::Exception | ( | exceptionLevel | level, |
| std::string | errorMessage, | ||
| std::string | location | ||
| ) | |||
| throw | ( | ||
| ) | |||
Normal constructor with error level, error message and location.
| level | Severity of the exeption |
| errorMessage | Error message to throw |
| location | Location of the exception in the code |
|
inline | |||||||||||||
Destructor.
|
inline |
Get the severity of the exception.
|
inline |
Get the location (as defined by Exception constructor) of the error.
|
inline |
Get the error message (as defined by constructor)
|
inline |
Return the stack trace if it was stored.
|
static |
Return whether makes a stack trace on exception.
|
static |
| void Exceptions::Exception::Print | ( | ) |
Print the error message and location.
Prints to error message to Pitch::mout(Pitch::error) and Location to Pitch::mout(Pitch::debug)
|
inline |
Set the error message.
|
inlineprivate |
Sets the reason for the exception.
|
static |
Set that it makes a stack trace on exception.
|
inline | |||||||||||||
Return char buffer of message+" at "+location, memory remains owned by Exception.
|
private |
Severity of the exception.
|
private |
Name of the function that threw.
|
staticprivate |
Maximum memory size of the stack.
|
private |
Message to be thrown.
|
private |
Stack trace as an std::string.
|
private |
Reason for throwing.
|
staticprivate |
Returns the stack trace if true.
1.8.6