Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually, but use the exception macros (file mitkExceptionMacro.h) instead. Simple use in your code is: More...
#include <mitkException.h>
Classes | |
struct | ReThrowData |
Public Member Functions | |
Exception (const char *file, unsigned int lineNumber=0, const char *desc="None", const char *loc="Unknown") | |
virtual | ~Exception () throw () |
virtual const char * | GetClassName () const |
void | AddRethrowData (const char *file, unsigned int lineNumber, const char *message) |
Adds rethrow data to this exception. More... | |
int | GetNumberOfRethrows () |
void | GetRethrowData (int rethrowNumber, std::string &file, int &line, std::string &message) |
template<class T > | |
Exception & | operator<< (const T &data) |
Definition of the bit shift operator for this class. More... | |
template<class T > | |
Exception & | operator<< (T &data) |
Definition of the bit shift operator for this class (for non const data). More... | |
Exception & | operator<< (std::ostream &(*func)(std::ostream &)) |
Definition of the bit shift operator for this class (for functions). More... | |
Protected Attributes | |
std::vector< ReThrowData > | m_RethrowData |
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually, but use the exception macros (file mitkExceptionMacro.h) instead. Simple use in your code is:
Documentation mitkThrow() << "optional exception message";
You can also define specialized exceptions which must inherit from this class. Please always use the mitkExceptionClassMacro when implementing specialized exceptions. A simple implementation can look like:
class MyException : public mitk::Exception { public: mitkExceptionClassMacro(MyException,mitk::Exception); };
You can then throw your specialized exceptions by using the macro
mitkThrowException(MyException) << "optional exception message";
Definition at line 49 of file mitkException.h.
|
inline |
Definition at line 52 of file mitkException.h.
|
inlinevirtual |
Definition at line 57 of file mitkException.h.
void mitk::Exception::AddRethrowData | ( | const char * | file, |
unsigned int | lineNumber, | ||
const char * | message | ||
) |
Adds rethrow data to this exception.
Definition at line 19 of file mitkException.cpp.
References m_RethrowData.
|
virtual |
Reimplemented in mitk::MemoryIsLockedException.
int mitk::Exception::GetNumberOfRethrows | ( | ) |
Definition at line 25 of file mitkException.cpp.
void mitk::Exception::GetRethrowData | ( | int | rethrowNumber, |
std::string & | file, | ||
int & | line, | ||
std::string & | message | ||
) |
rethrowNumber | The internal number of the rethrow. |
file | (returnvalue) This varaiable will be filled with the file of the specified rethrow. |
file | (returnvalue) This varaiable will be filled with the line of the specified rethrow. |
file | (returnvalue) This varaiable will be filled with the message of the specified rethrow. |
Definition at line 30 of file mitkException.cpp.
|
inline |
Definition of the bit shift operator for this class.
Definition at line 78 of file mitkException.h.
|
inline |
Definition of the bit shift operator for this class (for non const data).
Definition at line 88 of file mitkException.h.
|
inline |
Definition of the bit shift operator for this class (for functions).
Definition at line 97 of file mitkException.h.
|
protected |
Definition at line 113 of file mitkException.h.
Referenced by AddRethrowData().