to make an object serializable is easy:
};
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define ZFIMPLEMENT_DECLARE(ImplementedInterfaces,...)
see ZFINTERFACE_DECLARE
Definition ZFObjectInterface.h:169
#define zfimplement
shows class implement from interface, see ZFInterface
Definition ZFObjectInterface.h:24
#define ZFPROPERTY_RETAIN(Type, Name,...)
declare a retain property
Definition ZFPropertyDeclare.h:104
#define ZFPROPERTY_ASSIGN(Type, Name,...)
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:128
base class of call serializable object
Definition ZFSerializable.h:163
see zfany
Definition zfany.h:106
once declared, the object can be serialized by:
ZFSerializableData ZFObjectToData(ZFObject *obj, zfbool *outSuccess=zft_zfnull, zfstring *outErrorHint=zft_zfnull, ZFSerializable *refOwner=zft_zfnull)
see ZFObjectFromDataT
zfauto ZFObjectFromData(const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
see ZFObjectFromDataT
ZFSerializable's data container, see ZFSerializable.
Definition ZFSerializableData.h:74
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:157
Advanced
if any of contents of your object can't be serialized automatically, you may override some methods to supply your own serialize logic:
protected:
virtual zfbool serializableOnSerializeFromData(
) {
}
virtual zfbool serializableOnSerializeToData(
) {
}
private:
YourNotSerializableType data;
};
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:192
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define zfsuperI(T_SuperType)
class ref to proper super type, see ZFObject for more info
Definition ZFObjectDeclare.h:26
base class of all objects
Definition ZFObjectCore.h:209
for detailed usage, please refer to ZFSerializable