CTL  0.6.1
Computed Tomography Library
Classes
serializationhelper.h File Reference
#include <QMap>
Include dependency graph for serializationhelper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CTL::SerializationHelper
 Singleton that manages factory functions for parsing QVariant(Maps) to CTL types. More...
 
struct  CTL::SerializationHelper::RegisterWithSerializationHelper< SerializableType >
 

Macros

#define DECLARE_SERIALIZABLE_TYPE(className_woNamespace)
 

Macro Definition Documentation

◆ DECLARE_SERIALIZABLE_TYPE

#define DECLARE_SERIALIZABLE_TYPE (   className_woNamespace)
Value:
SERIALIZATION_HELPER_KNOWS_ ## className_woNamespace;

Declares a global variable for a certain serializable class. Its initialization registers this class with the SerializationHelper. The argument of this macro must be the name of the concrete class that should be registered. The name must not contain any namespace, which can be achieved by using this macro inside the according namespace. The macro should be placed in one .cpp file only (below the the include statement of the header that defines the class className_woNamespace):

#include "myclass.h"
namespace possible_namespace {
// ...
}

This macro can only be applied to classes with SerializationInterface as base class. These classes should also used the CTL_TYPE_ID(id) macro in their class definitions in order to define a unique type ID within their category, which may be either AbstractDataModel, AbstractPrepareStep, SystemComponent or none of the aforementioned, but at least SerializationInterface as base class.

The global variable name is SERIALIZATION_HELPER_KNOWS_<className_woNamespace>. Its type is CTL::SerializationHelper::RegisterWithSerializationHelper<className_woNamespace>.

See also
CTL_TYPE_ID(newIndex)