ML Reference
MeVis/Foundation/Sources/MLUtilities/mlRuntimeSubClass.h File Reference

This file defines macros, which are inserted in classes to declare and implement additional class members for the Runtime Type System (see also mlRuntimeType.h, mlRuntime.h and mlRuntimeDict.h) More...

#include "mlRuntime.h"
#include "mlErrorOutput.h"
#include "mlErrorOutputInfos.h"

Go to the source code of this file.

Defines

#define ML_BASE_IS_A(base, type)   ((base && base->getTypeId()) ? base->getTypeId()->isDerivedFrom(type::getClassTypeId()) : false)
 ML_BASE_IS_A macro is used to check if the given Base pointer is of the wanted type.
#define ML_EMPTY_PARAM
 Define an empty macro needed to pass empty macro parameters.
#define ML_CLASS_HEADER_EXPORTED(className, EXP_SYM)
 This macro has to be put into the header of a non-abstract class to declare some additional methods described below.
#define ML_CLASS_HEADER(className)   ML_CLASS_HEADER_EXPORTED(className, ML_EMPTY_PARAM)
 Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
#define ML_CLASS_SOURCE(className, parentName)
 This macro has to be put into the source file of a non-abstract class to implement the methods declared with ML_CLASS_HEADER This interface implemented by this macro permits the handling of this class type by the runtime type interface.
#define ML_ROOT_CLASS_SOURCE(className)   ML_CLASS_SOURCE(className,)
 This macro has to be put into the source file of a non-abstract class to implement the methods declared with ML_CLASS_HEADER This version shall be used for classes with no parent class.
#define ML_ABSTRACT_CLASS_HEADER_EXPORTED(className, EXP_SYM)
 This macro has to be put into the header of an abstract class to declare some additional methods described below This interface implemented by this macro permits the handling of this class type by the runtime type interface.
#define ML_ABSTRACT_CLASS_HEADER(className)   ML_ABSTRACT_CLASS_HEADER_EXPORTED(className, ML_EMPTY_PARAM)
 Same like ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non existing export symbol.
#define ML_ABSTRACT_CLASS_SOURCE(className, parentName)
 This macro has to be put into the source file of an abstract class to implement the methods declared with ML_ABSTRACT_CLASS_HEADER This interface implemented by this macro permits the handling of this class type by the runtime type interface.
#define ML_ABSTRACT_ROOT_CLASS_SOURCE(className)   ML_ABSTRACT_CLASS_SOURCE(className,)
 This macro has to be put into the source file of an abstract class to implement the methods declared with ML_ABSTRACT_CLASS_HEADER This version shall be used for classes with no parent class.
#define ML_MODULE_CLASS_HEADER(className)
 Like ML_CLASS_HEADER for the usage of derived classes from Module.
#define ML_MODULE_CLASS_SOURCE(className, parentName)
 Like ML_CLASS_SOURCE for the usage of derived classes from Module.
#define ML_ABSTRACT_MODULE_CLASS_HEADER(className)
 Like ML_ABSTRACT_CLASS_HEADER for the usage of derived classes from Module.
#define ML_ABSTRACT_MODULE_CLASS_SOURCE(className, parentName)
 Like ML_ABSTRACT_CLASS_SOURCE for the usage of derived classes from Module.
#define ML_MODULE_CLASS_SOURCE_EXT(className, parentName, superClassConstructs)
 Like ML_MODULE_CLASS_SOURCE where some stuff can be passed which initializes super class stuff or members.
#define ML_ABSTRACT_MODULE_CLASS_SOURCE_EXT(className, parentName, superClassConstructs)
 Like ML_ABSTRACT_MODULE_CLASS_SOURCE where some stuff can be passed which initializes super class stuff or members.
Deprecated
#define BASE_IS_A(base, type)   ML_BASE_IS_A(base, type)
#define ML_BASEOP_CLASS_HEADER(className)   ML_MODULE_CLASS_HEADER(className)
#define ML_BASEOP_CLASS_SOURCE(className, parentName)   ML_MODULE_CLASS_SOURCE(className, parentName)
#define ML_ABSTRACT_BASEOP_CLASS_HEADER(className)   ML_ABSTRACT_MODULE_CLASS_HEADER(className)
#define ML_ABSTRACT_BASEOP_CLASS_SOURCE(className, parentName)   ML_ABSTRACT_MODULE_CLASS_SOURCE(className, parentName)
#define ML_BASEOP_CLASS_SOURCE_EXT(className, parentName, superClassConstructs)   ML_CLASS_SOURCE(className, parentName)
#define ML_ABSTRACT_BASEOP_CLASS_SOURCE_EXT(className, parentName, superClassConstructs)   ML_ABSTRACT_CLASS_SOURCE(className, parentName)

Detailed Description

This file defines macros, which are inserted in classes to declare and implement additional class members for the Runtime Type System (see also mlRuntimeType.h, mlRuntime.h and mlRuntimeDict.h)

Author:
Florian Link, Wolf Spindler

Definition in file mlRuntimeSubClass.h.


Define Documentation

#define BASE_IS_A (   base,
  type 
)    ML_BASE_IS_A(base, type)
Deprecated:
Use ML_BASE_IS_A instead.

Better even: use mlbase_cast<BaseType*>(base) and check for the result being NULL; if it is not NULL, the base was of the type BaseType.

Definition at line 51 of file mlRuntimeSubClass.h.

#define ML_ABSTRACT_BASEOP_CLASS_HEADER (   className)    ML_ABSTRACT_MODULE_CLASS_HEADER(className)
Deprecated:
Use ML_ABSTRACT_MODULE_CLASS_HEADER instead.

Definition at line 443 of file mlRuntimeSubClass.h.

#define ML_ABSTRACT_BASEOP_CLASS_SOURCE (   className,
  parentName 
)    ML_ABSTRACT_MODULE_CLASS_SOURCE(className, parentName)
Deprecated:
Use ML_ABSTRACT_MODULE_CLASS_SOURCE instead.

Definition at line 448 of file mlRuntimeSubClass.h.

#define ML_ABSTRACT_BASEOP_CLASS_SOURCE_EXT (   className,
  parentName,
  superClassConstructs 
)    ML_ABSTRACT_CLASS_SOURCE(className, parentName)
#define ML_ABSTRACT_CLASS_HEADER_EXPORTED (   className,
  EXP_SYM 
)
Value:
public:                                                           \
  /* Creates a new runtime type from class name and insert      */\
  /* it into the runtime type system.                           */\
  /* A \p classPrefix (a null terminated string) can be passed  */\
  /* which then will be prefixed to the class name before       */\
  /* creating the runtime type name from it.                    */\
  /* \p nameReplacement is also a null terminated string which  */\
  /* will be used as replacement of the class name if passed as */\
  /* non NULL. It will still be prefixed if a prefix is passed. */\
  EXP_SYM static void initClass(const char* classPrefix=NULL,     \
                                const char* nameReplacement=NULL);\
                                                                  \
  /* Removes the class type from the runtime type system. */      \
  EXP_SYM static void destroyClass();                             \
                                                                  \
  /* Returns the runtime type of this class. */                   \
  EXP_SYM static  const RuntimeType* getClassTypeId();            \
                                                                  \
  /* Returns the (evt. overloaded) runtime type of this object.*/ \
  EXP_SYM virtual const RuntimeType* getTypeId() const;           \
                                                                  \
  /* Returns the null terminated type name of this runtime type*/ \
  /* or the string "<Name of Uninitialized Type>" if the type  */ \
  /* is still uninitialized. That case will also cause an ML   */ \
  /* error message with code ML_TYPE_NOT_REGISTERED.           */ \
  EXP_SYM virtual const char* getTypeIdName() const;              \
                                                                  \
private:                                                          \
  static const RuntimeType* _classType;                           \

This macro has to be put into the header of an abstract class to declare some additional methods described below This interface implemented by this macro permits the handling of this class type by the runtime type interface.

Definition at line 217 of file mlRuntimeSubClass.h.

#define ML_BASEOP_CLASS_HEADER (   className)    ML_MODULE_CLASS_HEADER(className)
Deprecated:
Use ML_MODULE_CLASS_HEADER instead.

Definition at line 434 of file mlRuntimeSubClass.h.

#define ML_BASEOP_CLASS_SOURCE (   className,
  parentName 
)    ML_MODULE_CLASS_SOURCE(className, parentName)
Deprecated:
Use ML_MODULE_CLASS_SOURCE instead.

Definition at line 438 of file mlRuntimeSubClass.h.

#define ML_BASEOP_CLASS_SOURCE_EXT (   className,
  parentName,
  superClassConstructs 
)    ML_CLASS_SOURCE(className, parentName)
Deprecated:
Use ML_MODULE_CLASS_SOURCE_EXT instead.

Definition at line 453 of file mlRuntimeSubClass.h.

#define ML_CLASS_HEADER (   className)    ML_CLASS_HEADER_EXPORTED(className, ML_EMPTY_PARAM)

Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.

Definition at line 112 of file mlRuntimeSubClass.h.

#define ML_CLASS_HEADER_EXPORTED (   className,
  EXP_SYM 
)

This macro has to be put into the header of a non-abstract class to declare some additional methods described below.

This interface implemented by this macro permits the handling of this class type by the runtime type interface. EXP_SYM can be an export symbol for the case that the class itself is not exported.

Definition at line 71 of file mlRuntimeSubClass.h.

#define ML_EMPTY_PARAM

Define an empty macro needed to pass empty macro parameters.

Definition at line 59 of file mlRuntimeSubClass.h.