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:108
#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:103
#define ZFPROPERTY_ASSIGN(Type, Name,...)
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:127
base class of call serializable object
Definition ZFSerializable.h:151
once declared, the object can be serialized by:
ZFSerializableData ZFObjectToData(ZFObject *obj, zfbool *outSuccess=0, zfstring *outErrorHint=0, ZFSerializable *referencedOwnerOrNull=0)
see ZFObjectFromDataT
zfauto ZFObjectFromData(const ZFSerializableData &serializableData, zfstring *outErrorHint=0, ZFSerializableData *outErrorPos=0)
see ZFObjectFromDataT
ZFSerializable's data container, see ZFSerializable.
Definition ZFSerializableData.h:72
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:164
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_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:58
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:62
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:66
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:50
#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