Go to the source code of this file.
Defines | |
| #define | SERIALOBJECT_HEADER 0xF5E4D3C2 |
| Header bytes (4 bytes) to specify the stream as a object stream. | |
| #define | SERIAL_INT32_ID 0x10 |
| #define | SERIAL_FLOAT64_ID 0x11 |
| #define | SERIAL_BOOL_ID 0x12 |
| #define | SERIAL_INT8_ID 0x14 |
| #define | SERIAL_INT16_ID 0x15 |
| #define | SERIAL_INT64_ID 0x16 |
| #define | SERIAL_FLOAT32_ID 0x17 |
| #define | SERIAL_UINT8_ID 0x18 |
| #define | SERIAL_UINT16_ID 0x19 |
| #define | SERIAL_UINT32_ID 0x1A |
| #define | SERIAL_UINT64_ID 0x1B |
| #define | SERIAL_STRING_ID 0x20 |
| #define | SERIAL_BYTEARRAY_ID 0x21 |
| #define | SERIAL_OBJECT_ID 0x22 |
| #define | SERIAL_XMLDOCUMENT_ID 0x23 |
| #define | SERIAL_GUID_ID 0x24 |
| #define | SERIAL_OBJECTLIST_ID 0x24 |
| #define | SERIAL_FLOAT64LIST_ID 0x30 |
| #define | SERIAL_STRINGLIST_ID 0x31 |
| #define | SERIAL_GUIDLIST_ID 0x32 |
| #define | SERIAL_UINT32LIST_ID 0x33 |
| #define | SERIAL_STRING_STRINGMAP_ID 0x50 |
| #define | SERIAL_OBJECT_GUIDMAP_ID 0x51 |
| #define | OBJECTFACTORY_REGISTER_CLASS(classid) classid::autoreg(true); |
| #define | SERIAL_CREATE_OBJECT_INTERNAL(classid) |
| #define | SERIAL_CONSTRUCTOR_START(classid) |
| #define | INLINE_SERIAL_CONSTRUCTOR_START(classid) |
| #define | SERIAL_CONSTRUCTOR_INIT rError = (doSerialize(uiObjectID, &rStream, this, NULL, NULL) != RET_NOERROR); |
| #define | SERIAL_CONSTRUCTOR(classid) |
| #define | INLINE_SERIAL_CONSTRUCTOR(classid) |
| #define | SERIAL_START_ABSTRACTCLASS(classid, classname) |
| #define | SERIAL_START(classid, classname) |
| #define | SERIAL_PARENTCLASS(classid) |
| #define | SERIAL_NUMERIC_CONV(attrib, att_type, conv_type, serialmethod, default_val) |
| #define | SERIAL_NUMERIC(attrib, att_type, serialmethod, default_val) SERIAL_NUMERIC_CONV(attrib, att_type, att_type, serialmethod, default_val) |
| #define | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, att_type, serialmethod, default_val) |
| #define | SERIAL_OBJECTREF(attrib, serialmethod) |
| #define | SERIAL_OBJECTREF_GET_SET(getmethod, setmethod, att_type, serialmethod) |
| #define | SERIAL_OBJECTPTR(attrib, serialmethod) |
| #define | SERIAL_BOOL(attrib) SERIAL_NUMERIC(attrib, bool, serializeBool, false) |
| #define | SERIAL_INT8(attrib) SERIAL_NUMERIC(attrib, Int8, serializeInt8, 0) |
| #define | SERIAL_INT16(attrib) SERIAL_NUMERIC(attrib, Int16, serializeInt16, 0) |
| #define | SERIAL_INT32(attrib) SERIAL_NUMERIC(attrib, Int32, serializeInt32, 0) |
| #define | SERIAL_INT64(attrib) SERIAL_NUMERIC(attrib, Int64, serializeInt64, 0) |
| #define | SERIAL_UINT8(attrib) SERIAL_NUMERIC(attrib, Uint8, serializeUint8, 0) |
| #define | SERIAL_UINT16(attrib) SERIAL_NUMERIC(attrib, Uint16, serializeUint16, 0) |
| #define | SERIAL_UINT32(attrib) SERIAL_NUMERIC(attrib, Uint32, serializeUint32, 0) |
| #define | SERIAL_UINT64(attrib) SERIAL_NUMERIC(attrib, Uint64, serializeUint64, 0) |
| #define | SERIAL_FLOAT32(attrib) SERIAL_NUMERIC(attrib, Float32, serializeFloat32, 0.0f) |
| #define | SERIAL_FLOAT64(attrib) SERIAL_NUMERIC(attrib, Float64, serializeFloat64, 0.0) |
| #define | SERIAL_ENUM(attrib, att_type) SERIAL_NUMERIC_CONV(attrib, att_type, Int32, serializeInt32, 0) |
| #define | SERIAL_STRING(attrib) SERIAL_OBJECTREF(attrib, serializeString) |
| #define | SERIAL_BYTEARRAY(attrib) SERIAL_OBJECTREF(attrib, serializeByteArray) |
| #define | SERIAL_XMLDOCUMENT(attrib) SERIAL_OBJECTPTR(attrib, serializeXMLDocument) |
| #define | SERIAL_GUID(attrib) SERIAL_OBJECTREF(attrib, serializeGUID) |
| #define | SERIAL_BOOLLIST(attrib) SERIAL_OBJECTREF(attrib, serializeBoolList) |
| #define | SERIAL_INT8LIST(attrib) SERIAL_OBJECTREF(attrib, serializeInt8List) |
| #define | SERIAL_INT16LIST(attrib) SERIAL_OBJECTREF(attrib, serializeInt16List) |
| #define | SERIAL_INT32LIST(attrib) SERIAL_OBJECTREF(attrib, serializeInt32List) |
| #define | SERIAL_INT64LIST(attrib) SERIAL_OBJECTREF(attrib, serializeInt64List) |
| #define | SERIAL_UINT8LIST(attrib) SERIAL_OBJECTREF(attrib, serializeUint8List) |
| #define | SERIAL_UINT16LIST(attrib) SERIAL_OBJECTREF(attrib, serializeUint16List) |
| #define | SERIAL_UINT32LIST(attrib) SERIAL_OBJECTREF(attrib, serializeUint32List) |
| #define | SERIAL_UINT64LIST(attrib) SERIAL_OBJECTREF(attrib, serializeUint64List) |
| #define | SERIAL_FLOAT32LIST(attrib) SERIAL_OBJECTREF(attrib, serializeFloat32List) |
| #define | SERIAL_FLOAT64LIST(attrib) SERIAL_OBJECTREF(attrib, serializeFloat64List) |
| #define | SERIAL_STRINGLIST(attrib) SERIAL_OBJECTREF(attrib, serializeStringList) |
| #define | SERIAL_GUIDLIST(attrib) SERIAL_OBJECTREF(attrib, serializeGUIDList) |
| #define | SERIAL_BOOL_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeBoolStringMap) |
| #define | SERIAL_INT8_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeInt8StringMap) |
| #define | SERIAL_INT16_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeInt16StringMap) |
| #define | SERIAL_INT32_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeInt32StringMap) |
| #define | SERIAL_INT64_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeInt64StringMap) |
| #define | SERIAL_UINT8_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeUint8StringMap) |
| #define | SERIAL_UINT16_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeUint16StringMap) |
| #define | SERIAL_UINT32_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeUint32StringMap) |
| #define | SERIAL_UINT64_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeUint64StringMap) |
| #define | SERIAL_FLOAT32_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeFloat32StringMap) |
| #define | SERIAL_FLOAT64_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeFloat64StringMap) |
| #define | SERIAL_STRING_STRINGMAP(attrib) SERIAL_OBJECTREF(attrib, serializeStringStringMap) |
| #define | SERIAL_BOOL_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, bool, serializeBool, false) |
| #define | SERIAL_INT8_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Int8, serializeInt8, 0) |
| #define | SERIAL_INT16_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Int16, serializeInt16, 0) |
| #define | SERIAL_INT32_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Int32, serializeInt32, 0) |
| #define | SERIAL_INT64_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Int64, serializeInt64, 0) |
| #define | SERIAL_UINT8_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Uint8, serializeUint8, 0) |
| #define | SERIAL_UINT16_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Uint16, serializeUint16, 0) |
| #define | SERIAL_UINT32_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Uint32, serializeUint32, 0) |
| #define | SERIAL_UINT64_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Uint64, serializeUint64, 0) |
| #define | SERIAL_FLOAT32_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Float32, serializeFloat32, 0.0f) |
| #define | SERIAL_FLOAT64_GET_SET(getmethod, setmethod) SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Float64, serializeFloat64, 0.0) |
| #define | SERIAL_STRING_GET_SET(getmethod, setmethod) SERIAL_OBJECTREF_GET_SET(getmethod, setmethod, TString, serializeString) |
| #define | SERIAL_BYTEARRAY_GET_SET(getmethod, setmethod) SERIAL_OBJECTREF_GET_SET(getmethod, setmethod, TByteArray, serializeByteArray) |
| #define | SERIAL_BYTEARRAY_PTR(attrib) |
| #define | SERIAL_OBJECT(interface_id, attrib) |
| #define | SERIAL_OBJECTLIST(interface_id, subclass, attrib) |
| #define | SERIAL_OBJECT_GUIDMAP(interface_id, subclass, attrib) |
| #define | SERIAL_CUSTOM_START |
| #define | SERIAL_CUSTOM_END } |
| #define | SERIAL_END |
| #define INLINE_SERIAL_CONSTRUCTOR | ( | classid ) |
INLINE_SERIAL_CONSTRUCTOR_START(classid) \ { \ SERIAL_CONSTRUCTOR_INIT; \ }
inline standard constructor for serializing
| classid | : ID of the serializable class |
| #define INLINE_SERIAL_CONSTRUCTOR_START | ( | classid ) |
inline SERIAL_CREATE_OBJECT_INTERNAL(classid)\ inline classid::classid(Uint uiObjectID, IInputStream& rStream, bool& rError)
Inline implementation of some methods and the serializing constructor
| classid | : ID of the serializable class |
| #define OBJECTFACTORY_REGISTER_CLASS | ( | classid ) | classid::autoreg(true); |
Macro to register the serializable class at the object factory.
| classid | : ID of the serializable class |
| #define SERIAL_BOOL | ( | attrib ) | SERIAL_NUMERIC(attrib, bool, serializeBool, false) |
| #define SERIAL_BOOL_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, bool, serializeBool, false) |
| #define SERIAL_BOOL_ID 0x12 |
| #define SERIAL_BOOL_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeBoolStringMap) |
| #define SERIAL_BOOLLIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeBoolList) |
| #define SERIAL_BYTEARRAY | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeByteArray) |
| #define SERIAL_BYTEARRAY_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_OBJECTREF_GET_SET(getmethod, setmethod, TByteArray, serializeByteArray) |
| #define SERIAL_BYTEARRAY_ID 0x21 |
| #define SERIAL_BYTEARRAY_PTR | ( | attrib ) |
if (retValue == RET_NOERROR) \ { \ if (obj_old->attrib != NULL)\ { \ if (lMode == 2) \ { \ TSerializer::serializeByteArray(*stream_out, *obj_old->attrib); \ } \ else \ { \ retValue = TSerializer::deserializeByteArray(*stream_in, *obj_new->attrib); \ } \ } \ else \ { \ retValue = RET_REQUEST_FAILED; \ } \ }
Serializing a byte array pointer attribute.
| attrib | : Signature of the attribute |
| #define SERIAL_CONSTRUCTOR | ( | classid ) |
SERIAL_CONSTRUCTOR_START(classid) \ { \ SERIAL_CONSTRUCTOR_INIT; \ }
Standard constructor for serializing
| classid | : ID of the serializable class |
| #define SERIAL_CONSTRUCTOR_INIT rError = (doSerialize(uiObjectID, &rStream, this, NULL, NULL) != RET_NOERROR); |
Termination of the serializing constructor. Between the beginning and this end, you may place your own code to initialize the object.
| #define SERIAL_CONSTRUCTOR_START | ( | classid ) |
SERIAL_CREATE_OBJECT_INTERNAL(classid)\ classid::classid(Uint uiObjectID, IInputStream& rStream, bool& rError)
Implementation of some methods and the serializing constructor
| classid | : ID of the serializable class |
| #define SERIAL_CREATE_OBJECT_INTERNAL | ( | classid ) |
internal macro to create the objects
| #define SERIAL_CUSTOM_END } |
This ends the customized serializing of data.
| #define SERIAL_CUSTOM_START |
if (retValue == RET_NOERROR) \ { \
This starts the customized serializing of data.
| #define SERIAL_END |
} \
return retValue; \
}
End of the serializing part.
| #define SERIAL_ENUM | ( | attrib, | |
| att_type | |||
| ) | SERIAL_NUMERIC_CONV(attrib, att_type, Int32, serializeInt32, 0) |
| #define SERIAL_FLOAT32 | ( | attrib ) | SERIAL_NUMERIC(attrib, Float32, serializeFloat32, 0.0f) |
| #define SERIAL_FLOAT32_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Float32, serializeFloat32, 0.0f) |
| #define SERIAL_FLOAT32_ID 0x17 |
| #define SERIAL_FLOAT32_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeFloat32StringMap) |
| #define SERIAL_FLOAT32LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeFloat32List) |
| #define SERIAL_FLOAT64 | ( | attrib ) | SERIAL_NUMERIC(attrib, Float64, serializeFloat64, 0.0) |
| #define SERIAL_FLOAT64_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Float64, serializeFloat64, 0.0) |
| #define SERIAL_FLOAT64_ID 0x11 |
| #define SERIAL_FLOAT64_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeFloat64StringMap) |
| #define SERIAL_FLOAT64LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeFloat64List) |
| #define SERIAL_FLOAT64LIST_ID 0x30 |
| #define SERIAL_GUID | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeGUID) |
| #define SERIAL_GUID_ID 0x24 |
| #define SERIAL_GUIDLIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeGUIDList) |
| #define SERIAL_GUIDLIST_ID 0x32 |
| #define SERIAL_INT16 | ( | attrib ) | SERIAL_NUMERIC(attrib, Int16, serializeInt16, 0) |
| #define SERIAL_INT16_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Int16, serializeInt16, 0) |
| #define SERIAL_INT16_ID 0x15 |
| #define SERIAL_INT16_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeInt16StringMap) |
| #define SERIAL_INT16LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeInt16List) |
| #define SERIAL_INT32 | ( | attrib ) | SERIAL_NUMERIC(attrib, Int32, serializeInt32, 0) |
| #define SERIAL_INT32_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Int32, serializeInt32, 0) |
| #define SERIAL_INT32_ID 0x10 |
| #define SERIAL_INT32_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeInt32StringMap) |
| #define SERIAL_INT32LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeInt32List) |
| #define SERIAL_INT64 | ( | attrib ) | SERIAL_NUMERIC(attrib, Int64, serializeInt64, 0) |
| #define SERIAL_INT64_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Int64, serializeInt64, 0) |
| #define SERIAL_INT64_ID 0x16 |
| #define SERIAL_INT64_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeInt64StringMap) |
| #define SERIAL_INT64LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeInt64List) |
| #define SERIAL_INT8 | ( | attrib ) | SERIAL_NUMERIC(attrib, Int8, serializeInt8, 0) |
| #define SERIAL_INT8_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Int8, serializeInt8, 0) |
| #define SERIAL_INT8_ID 0x14 |
| #define SERIAL_INT8_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeInt8StringMap) |
| #define SERIAL_INT8LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeInt8List) |
| #define SERIAL_NUMERIC | ( | attrib, | |
| att_type, | |||
| serialmethod, | |||
| default_val | |||
| ) | SERIAL_NUMERIC_CONV(attrib, att_type, att_type, serialmethod, default_val) |
Serializes a numeric member value
| attrib | : Member attribute |
| att_type | : Type of the attribute |
| serialmethod | : Method used to serialize and deserialize the value |
| default_val | : default value |
| #define SERIAL_NUMERIC_CONV | ( | attrib, | |
| att_type, | |||
| conv_type, | |||
| serialmethod, | |||
| default_val | |||
| ) |
if (retValue == RET_NOERROR) \ { \ if (lMode == 2) \ { \ TSerializer::serialmethod(*stream_out, static_cast<conv_type>(obj_old->attrib)); \ } \ else \ { \ conv_type vValue = default_val;\ retValue = TSerializer::de ## serialmethod(*stream_in, vValue); \ obj_new->attrib = static_cast<att_type>(vValue);\ } \ }
Serializes a numeric member value
| attrib | : Member attribute |
| att_type | : Type of the attribute |
| conv_type | : Type of the attribute convertion |
| serialmethod | : Method used to serialize and deserialize the value |
| default_val | : default value |
| #define SERIAL_NUMERIC_GET_SET | ( | getmethod, | |
| setmethod, | |||
| att_type, | |||
| serialmethod, | |||
| default_val | |||
| ) |
if (retValue == RET_NOERROR) \ { \ if (lMode == 2) \ { \ att_type vValue = static_cast<att_type>(obj_old->getmethod()); \ TSerializer::serialmethod(*stream_out, vValue); \ } \ else \ { \ att_type vValue = default_val;\ retValue = TSerializer::de ## serialmethod(*stream_in, vValue); \ obj_new->setmethod(vValue);\ } \ }
Serializes a numeric member value hidden by get and set methods
| getmethod | : method to get the attribute |
| setmethod | : method to set the attribute |
| att_type | : Type of the attribute |
| serialmethod | : Method used to serialize and deserialize the value |
| default_val | : default value |
| #define SERIAL_OBJECT | ( | interface_id, | |
| attrib | |||
| ) |
if (retValue == RET_NOERROR) \ { \ if (lMode == 2) \ { \ TSerializer::serializeObject(*stream_out, obj_old->attrib); \ } \ else \ { \ retValue = TSerializer::deserializeObject(*stream_in, interface_id, ICAST(obj_new->attrib)); \ if (retValue != RET_NOERROR) \ { \ obj_new->attrib = NULL; \ retValue = RET_NOERROR;\ } \ } \ } \ else \ { \ if (lMode == 1)\ { \ obj_new->attrib = NULL; \ } \ } \
Serializing a sub object of this object. The sub object must inhire also the ISerializable Interface.
| interface_id | : interface id of this object. Needed for up casts |
| attrib | : Signature of the attribute |
| #define SERIAL_OBJECT_GUIDMAP | ( | interface_id, | |
| subclass, | |||
| attrib | |||
| ) |
Serializing an object map. As key a GUID is used
| interface_id | : interface id of this object. Needed for up casts |
| subclass | : interface of this object. Needed for up casts |
| attrib | : Signature of the attribute list |
| #define SERIAL_OBJECT_GUIDMAP_ID 0x51 |
| #define SERIAL_OBJECT_ID 0x22 |
| #define SERIAL_OBJECTLIST | ( | interface_id, | |
| subclass, | |||
| attrib | |||
| ) |
Serializing an object list
| interface_id | : interface id of this object. Needed for up casts |
| subclass | : interface of this object. Needed for up casts |
| attrib | : Signature of the attribute list |
| #define SERIAL_OBJECTLIST_ID 0x24 |
| #define SERIAL_OBJECTPTR | ( | attrib, | |
| serialmethod | |||
| ) |
if (retValue == RET_NOERROR) \ { \ if (lMode == 2) \ { \ TSerializer::serialmethod(*stream_out, obj_old->attrib); \ } \ else \ { \ retValue = TSerializer::de ## serialmethod(*stream_in, obj_new->attrib); \ if (retValue == RET_REQUEST_FAILED) \ { \ obj_new->attrib = NULL; \ retValue = RET_NOERROR; \ } \ } \ }
Serializing an object pointer attribute. If the serializing fails with RET_REQUEST_FAILED, the pointer is simply set to NULL.
| attrib | : Signature of the attribute |
| serialmethod | : Method used to serialize and deserialize the value |
| #define SERIAL_OBJECTREF | ( | attrib, | |
| serialmethod | |||
| ) |
if (retValue == RET_NOERROR) \ { \ if (lMode == 2) \ { \ TSerializer::serialmethod(*stream_out, obj_old->attrib); \ } \ else \ { \ retValue = TSerializer::de ## serialmethod(*stream_in, obj_new->attrib); \ } \ }
Serializing an object or a reference attribute.
| attrib | : Signature of the attribute |
| serialmethod | : Method used to serialize and deserialize the value |
| #define SERIAL_OBJECTREF_GET_SET | ( | getmethod, | |
| setmethod, | |||
| att_type, | |||
| serialmethod | |||
| ) |
if (retValue == RET_NOERROR) \ { \ if (lMode == 2) \ { \ att_type vValue = obj_old->getmethod(); \ TSerializer::serialmethod(*stream_out, vValue); \ } \ else \ { \ att_type vValue; \ retValue = TSerializer::de ## serialmethod(*stream_in, vValue); \ obj_new->setmethod(vValue); \ } \ }
Serializing an object or a reference attribute using get and set methods
| getmethod | : method to get the attribute |
| setmethod | : method to set the attribute |
| att_type | : Type of the attribute |
| serialmethod | : Method used to serialize and deserialize the value |
| #define SERIAL_PARENTCLASS | ( | classid ) |
if (retValue == RET_NOERROR) \ { \ retValue = classid::doSerialize(obj_id_in, stream_in, obj_new, stream_out, obj_old, false); \ }
Serializes the parent class. The header info is not written.
| classid | : ID of the parent class |
| #define SERIAL_START | ( | classid, | |
| classname | |||
| ) |
public : \ classid(Uint uiObjectID, IInputStream& rStream, bool& rError);\ static Retval MQUALIFIER createObject(Uint uiObjectID, IInputStream* pStream, IZUnknown*& rpObj); \ \ inline static void autoreg(bool bReg)\ { \ static Uint classid##Handle = 0;\ TString strClassName(classname); \ if (bReg) \ { \ classid##Handle = ZObjectFactory.registerClass(strClassName, createObject); \ } \ else \ { \ ZObjectFactory.unregisterClass(strClassName, classid##Handle); \ } \ } \ SERIAL_START_ABSTRACTCLASS(classid, classname)
Starts the serializing part of your class.
| classid | : ID of the serializable class |
| classname | : Name of the serializable class |
| #define SERIAL_START_ABSTRACTCLASS | ( | classid, | |
| classname | |||
| ) |
Starts the serializing part of your class without defining the registration and constructor part of the class. This is used for abstract classes
| classid | : ID of the serializable class |
| classname | : Name of the serializable class |
| #define SERIAL_STRING | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeString) |
| #define SERIAL_STRING_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_OBJECTREF_GET_SET(getmethod, setmethod, TString, serializeString) |
| #define SERIAL_STRING_ID 0x20 |
| #define SERIAL_STRING_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeStringStringMap) |
| #define SERIAL_STRING_STRINGMAP_ID 0x50 |
| #define SERIAL_STRINGLIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeStringList) |
| #define SERIAL_STRINGLIST_ID 0x31 |
| #define SERIAL_UINT16 | ( | attrib ) | SERIAL_NUMERIC(attrib, Uint16, serializeUint16, 0) |
| #define SERIAL_UINT16_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Uint16, serializeUint16, 0) |
| #define SERIAL_UINT16_ID 0x19 |
| #define SERIAL_UINT16_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeUint16StringMap) |
| #define SERIAL_UINT16LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeUint16List) |
| #define SERIAL_UINT32 | ( | attrib ) | SERIAL_NUMERIC(attrib, Uint32, serializeUint32, 0) |
| #define SERIAL_UINT32_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Uint32, serializeUint32, 0) |
| #define SERIAL_UINT32_ID 0x1A |
| #define SERIAL_UINT32_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeUint32StringMap) |
| #define SERIAL_UINT32LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeUint32List) |
| #define SERIAL_UINT32LIST_ID 0x33 |
| #define SERIAL_UINT64 | ( | attrib ) | SERIAL_NUMERIC(attrib, Uint64, serializeUint64, 0) |
| #define SERIAL_UINT64_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Uint64, serializeUint64, 0) |
| #define SERIAL_UINT64_ID 0x1B |
| #define SERIAL_UINT64_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeUint64StringMap) |
| #define SERIAL_UINT64LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeUint64List) |
| #define SERIAL_UINT8 | ( | attrib ) | SERIAL_NUMERIC(attrib, Uint8, serializeUint8, 0) |
| #define SERIAL_UINT8_GET_SET | ( | getmethod, | |
| setmethod | |||
| ) | SERIAL_NUMERIC_GET_SET(getmethod, setmethod, Uint8, serializeUint8, 0) |
| #define SERIAL_UINT8_ID 0x18 |
| #define SERIAL_UINT8_STRINGMAP | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeUint8StringMap) |
| #define SERIAL_UINT8LIST | ( | attrib ) | SERIAL_OBJECTREF(attrib, serializeUint8List) |
| #define SERIAL_XMLDOCUMENT | ( | attrib ) | SERIAL_OBJECTPTR(attrib, serializeXMLDocument) |
| #define SERIAL_XMLDOCUMENT_ID 0x23 |
| #define SERIALOBJECT_HEADER 0xF5E4D3C2 |
Header bytes (4 bytes) to specify the stream as a object stream.