Base class for all MIRTK object classes
- Note
- This base class must be a virtual interface without any own data members to not change the type size of subclasses! Derive another intermediate abstract base class from it to add data members shared by a more specific class of objects.
Definition at line 51 of file Object.h.
template<typename... Args>
void mirtk::Object::Throw |
( |
ErrorType |
err, |
|
|
const char * |
func, |
|
|
Args... |
args |
|
) |
| const |
|
protected |
Raise error in member function
The current implementation prints the error message to STDERR and terminates the program with exit code 1. In future releases, when all library code has been rewritten to use this function, a suitable runtime exception may be thrown instead.
- Parameters
-
[in] | err | Error type. Unused at the moment, but may be used in future releases to throw the appropriate exception type. |
[in] | func | Name of member function which is throwing the error (i.e., func). |
[in] | args | Error message. The given arguments are converted to strings using the ToString template function. These strings are then concatenated to produce the complete error message. |
Definition at line 166 of file Object.h.
template<typename... Args>
void mirtk::Object::ThrowStatic |
( |
ErrorType |
err, |
|
|
const char * |
cls, |
|
|
const char * |
func, |
|
|
Args... |
args |
|
) |
| |
|
staticprotected |
Raise error in member function
The current implementation prints the error message to STDERR and terminates the program with exit code 1. In future releases, when all library code has been rewritten to use this function, a suitable runtime exception may be thrown instead.
- Parameters
-
[in] | err | Error type. Unused at the moment, but may be used in future releases to throw the appropriate exception type. |
[in] | cls | Name of class that defines the member function. |
[in] | func | Name of member function which is throwing the error (i.e., func). |
[in] | args | Error message. The given arguments are converted to strings using the ToString template function. These strings are then concatenated to produce the complete error message. |
Definition at line 156 of file Object.h.