48 #ifndef _MIRA_SERIALIZATION_H_ 49 #define _MIRA_SERIALIZATION_H_ 71 template<
typename Serializer,
typename T>
72 class SerializerClassTypeRegisterer
75 SerializerClassTypeRegisterer()
78 Serializer::template registerClass<T>();
81 ~SerializerClassTypeRegisterer()
84 Serializer::template unregisterClass<T>();
88 #define MIRA_CURRENT_SERIALIZER_SEQUENCE \ 89 (mira::XMLSerializer) \ 90 (mira::XMLDeserializer) \ 91 (mira::JSONSerializer) \ 92 (mira::JSONDeserializer) \ 93 (mira::BinaryBufferSerializer) \ 94 (mira::BinaryBufferDeserializer) \ 95 (mira::BinaryStreamSerializer) \ 96 (mira::BufferedBinaryStreamSerializer) \ 97 (mira::BinaryStreamDeserializer) \ 98 (mira::PropertySerializer) \ 99 (mira::MetaSerializer) 101 #define MIRA_LEGACY_SERIALIZER_SEQUENCE \ 102 (mira::BinaryBufferSerializerLegacy) \ 103 (mira::BinaryBufferDeserializerLegacy) \ 104 (mira::BinaryBufferDeserializerLegacyMarked) \ 105 (mira::BinaryStreamSerializerLegacy) \ 106 (mira::BinaryStreamDeserializerLegacy) \ 107 (mira::BinaryStreamDeserializerLegacyMarked) 109 #ifdef MIRA_REGISTER_LEGACY_SERIALIZERS 110 #define MIRA_SERIALIZER_SEQUENCE \ 111 MIRA_CURRENT_SERIALIZER_SEQUENCE \ 112 MIRA_LEGACY_SERIALIZER_SEQUENCE 114 #define MIRA_SERIALIZER_SEQUENCE \ 115 MIRA_CURRENT_SERIALIZER_SEQUENCE 118 #define MIRA_CLASS_SERIALIZATION_IMPL(r, Class, Serializer) \ 119 MIRA_REGISTRAR(MIRA_PPARAM(mira::SerializerClassTypeRegisterer<Serializer, Class>)) \ 139 #define MIRA_CLASS_SERIALIZATION( pCLASS, ... ) \ 140 MIRA_CLASS_REGISTER( pCLASS, __VA_ARGS__ ) \ 141 BOOST_PP_SEQ_FOR_EACH( MIRA_CLASS_SERIALIZATION_IMPL, pCLASS, MIRA_SERIALIZER_SEQUENCE ) 144 #define MIRA_INTERNAL_TEMPLATE_CLASS_SERIALIZATION_IMPL(r, Args, i, Serializer) \ 149 MIRA_REGISTRAR(MIRA_PPARAM(mira::SerializerClassTypeRegisterer<Serializer, \ 150 MIRA_INTERNAL_CONC_NAMESPACE(Args,3)BOOST_PP_SEQ_ELEM(2,Args)<BOOST_PP_TUPLE_REM_CTOR( BOOST_PP_SEQ_ELEM(1,Args), BOOST_PP_SEQ_ELEM(0,Args))> >))\ 153 #define MIRA_INTERNAL_TEMPLATE_CLASS_SERIALIZATION(r, Args, TmplSpec) \ 157 BOOST_PP_SEQ_FOR_EACH_I(MIRA_INTERNAL_TEMPLATE_CLASS_SERIALIZATION_IMPL, \ 158 (TmplSpec)Args, MIRA_SERIALIZER_SEQUENCE) 170 #define MIRA_TEMPLATE_CLASS_SERIALIZATION(Namespace, Class, TmplSpec, ... ) \ 171 MIRA_TEMPLATE_CLASS_REGISTER(Namespace, Class, TmplSpec, __VA_ARGS__ ) \ 172 BOOST_PP_SEQ_FOR_EACH(MIRA_INTERNAL_TEMPLATE_CLASS_SERIALIZATION, (1)(Class)Namespace,MIRA_MAKE_SEQ(1,TmplSpec)) 182 #define MIRA_VARTEMPLATE_CLASS_SERIALIZATION(Namespace, Class, NumTmplPrm, TmplSpec, ... ) \ 183 MIRA_VARTEMPLATE_CLASS_REGISTER(Namespace, Class, NumTmplPrm, \ 184 TmplSpec, __VA_ARGS__ ) \ 185 BOOST_PP_SEQ_FOR_EACH(MIRA_INTERNAL_TEMPLATE_CLASS_SERIALIZATION, \ 186 (NumTmplPrm)(Class)Namespace, \ 187 MIRA_MAKE_SEQ(NumTmplPrm,TmplSpec)) Registration and unregistration helper class.
Preprocessor workaround to handle single parameters that contain a comma.
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
$Header file containing base classes to enable class creation using a class factory$ ...
Binary serializer and deserializer.
Serializer that handles properties and creates PropertyNodes.
Provides print() method that uses serialization to print objects.
XMLSerializer and XMLDeserializer.
Serializer and Deserializer for JSON format.