Medical Imaging Interaction Toolkit
2024.06.99-2ddd1118
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") | |
~Exception () override 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 45 of file mitkException.h.
|
inline |
Definition at line 48 of file mitkException.h.
|
inlineoverride |
Definition at line 53 of file mitkException.h.
void mitk::Exception::AddRethrowData | ( | const char * | file, |
unsigned int | lineNumber, | ||
const char * | message | ||
) |
Adds rethrow data to this exception.
|
virtual |
Reimplemented in mitk::NoPropertyRelationException, mitk::InvalidPathNodeException, and mitk::MemoryIsLockedException.
int mitk::Exception::GetNumberOfRethrows | ( | ) |
void mitk::Exception::GetRethrowData | ( | int | rethrowNumber, |
std::string & | file, | ||
int & | line, | ||
std::string & | message | ||
) |
Returns the rethrow data of the specified rethrow number. Returns empty data, if the rethrowNumber doesn't exist.
rethrowNumber | The internal number of the rethrow. |
file | (returnvalue) This variable will be filled with the file of the specified rethrow. |
line | (returnvalue) This variable will be filled with the line of the specified rethrow. |
message | (returnvalue) This variable will be filled with the message of the specified rethrow. |
|
inline |
Definition of the bit shift operator for this class.
Definition at line 74 of file mitkException.h.
|
inline |
Definition of the bit shift operator for this class (for functions).
Definition at line 93 of file mitkException.h.
|
inline |
Definition of the bit shift operator for this class (for non const data).
Definition at line 84 of file mitkException.h.
|
protected |
Definition at line 109 of file mitkException.h.