48 #ifndef __DAAL_SERIALIZE_H__ 49 #define __DAAL_SERIALIZE_H__ 51 #include "services/base.h" 52 #include "services/daal_memory.h" 53 #include "services/error_handling.h" 57 namespace data_management
68 class InputDataArchive;
69 class OutputDataArchive;
76 class DAAL_EXPORT SerializationIface :
public Base
79 virtual ~SerializationIface() {}
85 void serialize(interface1::InputDataArchive &archive);
91 void deserialize(interface1::OutputDataArchive &archive);
97 virtual int getSerializationTag()
const = 0;
103 virtual services::Status serializeImpl(interface1::InputDataArchive *archive) = 0;
109 virtual services::Status deserializeImpl(
const interface1::OutputDataArchive *archive) = 0;
114 class DAAL_EXPORT SerializationDesc
117 typedef SerializationIface* (*creatorFunc)();
118 SerializationDesc(creatorFunc func,
int tag);
119 int tag()
const {
return _tag; }
120 creatorFunc creator()
const {
return _f; }
121 const SerializationDesc* next()
const {
return _next; }
122 static const SerializationDesc* first();
127 SerializationDesc* _next;
133 using interface1::SerializationIface;
134 using interface1::SerializationDesc;
138 #define DECLARE_SERIALIZABLE_IMPL() \ 139 services::Status serializeImpl (data_management::InputDataArchive *arch) DAAL_C11_OVERRIDE \ 140 { return serialImpl<data_management::InputDataArchive, false>( arch ); } \ 141 services::Status deserializeImpl(const data_management::OutputDataArchive *arch) DAAL_C11_OVERRIDE \ 142 { return serialImpl<const data_management::OutputDataArchive, true>( arch ); } 144 #define DECLARE_SERIALIZABLE() \ 146 static data_management::SerializationDesc _desc; \ 148 DECLARE_SERIALIZABLE_IMPL() \ 149 static int serializationTag(); \ 150 virtual int getSerializationTag() const DAAL_C11_OVERRIDE; 152 #define DECLARE_SERIALIZABLE_IFACE() \ 154 static data_management::SerializationDesc _desc; \ 156 static int serializationTag(); \ 157 virtual int getSerializationTag() const DAAL_C11_OVERRIDE; 159 #define DECLARE_SERIALIZABLE_TAG() \ 161 static int serializationTag(); \ 162 virtual int getSerializationTag() const DAAL_C11_OVERRIDE; 164 #define DECLARE_SERIALIZABLE_CAST(ClassName) \ 165 DECLARE_SERIALIZABLE(); \ 166 DAAL_CAST_OPERATOR(ClassName); 168 #define DECLARE_MODEL(DstClassName, SrcClassName) \ 169 DECLARE_SERIALIZABLE(); \ 170 DAAL_CAST_OPERATOR(DstClassName); \ 171 DAAL_DOWN_CAST_OPERATOR(DstClassName, SrcClassName) 173 #define DECLARE_MODEL_IFACE(DstClassName, SrcClassName) \ 174 DECLARE_SERIALIZABLE_IFACE(); \ 175 DAAL_CAST_OPERATOR(DstClassName); \ 176 DAAL_DOWN_CAST_OPERATOR(DstClassName, SrcClassName) daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::data_management::interface1::OutputDataArchive
Provides methods to restore an object from its serialized counterpart and access the restored object...
Definition: data_archive.h:978
daal::Base
Base class for Intel(R) Data Analytics Acceleration Library objects
Definition: base.h:65
daal::data_management::interface1::SerializationIface
Abstract interface class that defines the interface for serialization and deserialization.
Definition: data_serialize.h:76