![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
The base class for all exceptions defined in CTK. More...
#include <Libs/Core/ctkException.h>
Classes | |
class | TraceManipulator |
Public Member Functions | |
const ctkException * | cause () const throw () |
Gets the nested exception which caused this exception. More... | |
virtual const char * | className () const throw () |
Returns the class name for this exception. More... | |
virtual ctkException * | clone () const |
Creates a copy of this exception. Use rethrow() to throw the copy again. More... | |
ctkException (const ctkException &o) | |
Copy constructor. More... | |
ctkException (const QString &msg) | |
Create a new ctkException. More... | |
ctkException (const QString &msg, const ctkException &cause) | |
Create a new ctkException containing another exception as the cause. More... | |
QString | message () const throw () |
Returns the detail message string of this exception. More... | |
virtual const char * | name () const throw () |
Returns the name for this exception. More... | |
ctkException & | operator= (const ctkException &o) |
Assignment operator. More... | |
TraceManipulator | printStackTrace () const |
Returns an object suitable for printing this executable and its backtrace via qDebug(). More... | |
virtual void | rethrow () const |
(Re)Throws this exception. More... | |
void | setCause (const ctkException &cause) |
Sets the cause for this exception. More... | |
virtual const char * | what () const throw () |
Returns a static string describing this exception. More... | |
~ctkException () throw () | |
![]() | |
ctkBackTrace (const ctkBackTrace &other) | |
ctkBackTrace (size_t framesNumber=DefaultStackSize) | |
Create a back trace. More... | |
void * | returnAddress (unsigned frameNumber) const |
Get the return address for a given stack frame. More... | |
QString | stackFrame (unsigned frameNumber) const |
Get a textual representation for a given stack frame. More... | |
size_t | stackSize () const |
Get the stack size. More... | |
QList< QString > | stackTrace () const |
Provides programmatic access to the stack trace information. More... | |
virtual | ~ctkBackTrace () throw () |
Protected Member Functions | |
virtual QDebug | printStackTrace (QDebug dbg) const |
Print the stack trace of this exception using the given QDebug object. More... | |
Friends | |
class | TraceManipulator |
Additional Inherited Members | |
![]() | |
static size_t const | DefaultStackSize |
The base class for all exceptions defined in CTK.
This exception class takes a QString object as the message text and can optionally store another ctkException instance which caused this exception.
ctkException classes can be copied, saved, and rethrown.
Definition at line 45 of file ctkException.h.
|
explicit |
Create a new ctkException.
msg | The exception message. |
ctkException::ctkException | ( | const QString & | msg, |
const ctkException & | cause | ||
) |
Create a new ctkException containing another exception as the cause.
msg | The exception message. |
cause | The nested exception causing this exception. |
ctkException::ctkException | ( | const ctkException & | o | ) |
Copy constructor.
o | The exception to copy. |
ctkException::~ctkException | ( | ) | ||
throw | ( | |||
) |
const ctkException* ctkException::cause | ( | ) | const | |
throw | ( | |||
) |
Gets the nested exception which caused this exception.
NULL
if there is none.
|
virtual |
Returns the class name for this exception.
Reimplemented in ctkCmdLineModuleTimeoutException, and ctkCmdLineModuleRunException.
|
virtual |
Creates a copy of this exception. Use rethrow() to throw the copy again.
Reimplemented in ctkConfigurationException, ctkApplicationException, ctkServiceException, ctkPluginException, ctkPluginDatabaseException, ctkIllegalStateException, ctkInvalidArgumentException, ctkRuntimeException, ctkUnsupportedOperationException, ctkCmdLineModuleTimeoutException, and ctkCmdLineModuleRunException.
QString ctkException::message | ( | ) | const | |
throw | ( | |||
) |
Returns the detail message string of this exception.
|
virtual |
Returns the name for this exception.
Reimplemented in ctkConfigurationException, ctkApplicationException, ctkServiceException, ctkPluginException, ctkPluginDatabaseException, ctkIllegalStateException, ctkInvalidArgumentException, ctkRuntimeException, ctkUnsupportedOperationException, ctkCmdLineModuleTimeoutException, and ctkCmdLineModuleRunException.
ctkException& ctkException::operator= | ( | const ctkException & | o | ) |
Assignment operator.
o | The exception to assign to this exception. |
TraceManipulator ctkException::printStackTrace | ( | ) | const |
Returns an object suitable for printing this executable and its backtrace via qDebug().
Example usage:
|
protectedvirtual |
Print the stack trace of this exception using the given QDebug object.
dbg |
|
virtual |
(Re)Throws this exception.
Reimplemented in ctkConfigurationException, ctkApplicationException, ctkServiceException, ctkPluginException, ctkPluginDatabaseException, ctkIllegalStateException, ctkInvalidArgumentException, ctkRuntimeException, ctkUnsupportedOperationException, ctkCmdLineModuleTimeoutException, and ctkCmdLineModuleRunException.
void ctkException::setCause | ( | const ctkException & | cause | ) |
Sets the cause for this exception.
cause | The exception causing this exception. |
|
virtual |
Returns a static string describing this exception.
|
friend |
Definition at line 154 of file ctkException.h.