Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
mirtk::Object Class Referenceabstract

#include <Object.h>

Inheritance diagram for mirtk::Object:
Inheritance graph
Collaboration diagram for mirtk::Object:
Collaboration graph

Public Member Functions

virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
virtual ParameterList Parameter () const
 Get parameter name/value pairs.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual bool Set (const char *name, const char *value)
 
virtual ~Object ()
 Destructor.
 

Static Public Member Functions

static const char * NameOfType ()
 Get name of this class type.
 

Protected Member Functions

template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Static Protected Member Functions

template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

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.

Member Function Documentation

§ Set()

bool mirtk::Object::Set ( const char *  name,
const char *  value 
)
inlinevirtual

§ Throw()

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]errError type. Unused at the moment, but may be used in future releases to throw the appropriate exception type.
[in]funcName of member function which is throwing the error (i.e., func).
[in]argsError 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.

§ ThrowStatic()

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]errError type. Unused at the moment, but may be used in future releases to throw the appropriate exception type.
[in]clsName of class that defines the member function.
[in]funcName of member function which is throwing the error (i.e., func).
[in]argsError 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.


The documentation for this class was generated from the following file: