Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkSerializerMacros.h File Reference

Provides the MITK_REGISTER_SERIALIZER macro for automatic registration of serializer classes. More...

#include <itkObjectFactoryBase.h>
#include <itkVersion.h>

Go to the source code of this file.

Macros

#define MITK_REGISTER_SERIALIZER(classname)
 Registers a serializer class with the ITK object factory system. More...
 

Detailed Description

Provides the MITK_REGISTER_SERIALIZER macro for automatic registration of serializer classes.

This header defines a macro that generates an ITK object factory and a static registration helper for a given serializer class. The generated factory allows the serializer to be discovered and instantiated at runtime through the ITK object factory mechanism.

See also
mitk::BaseDataSerializer, mitk::BasePropertySerializer

Definition in file mitkSerializerMacros.h.

Macro Definition Documentation

◆ MITK_REGISTER_SERIALIZER

#define MITK_REGISTER_SERIALIZER (   classname)

Registers a serializer class with the ITK object factory system.

This macro generates two helper classes for the given serializer class name:

  • A factory class (classnameFactory) derived from itk::ObjectFactoryBase that creates instances of the serializer.
  • A registration class (classnameRegistrationMethod) whose static instance registers the factory at program startup and unregisters it on shutdown.

Usage: Place this macro in the global scope (outside any namespace) after including the serializer header, typically in the serializer's .cpp file.

Parameters
classnameThe unqualified name of the serializer class to register. The class must reside in the mitk namespace.
// In mitkMyPropertySerializer.cpp:
MITK_REGISTER_SERIALIZER(MyPropertySerializer);
MITK_REGISTER_SERIALIZER(LookupTablePropertySerializer)

Definition at line 51 of file mitkSerializerMacros.h.