like many other application framework, ZFFramework use single inheritance, most of elements inherit from ZFObject
and, we use retain count logic to manage memory, just like Object-C
to create an object, you must use one of alloc function supplied by ZFFramework:
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
#define zfobjRetain(obj)
retain an object, see ZFObject
Definition ZFObjectRetain.h:128
#define zfobjAlloc(T_ZFObject,...)
alloc an object, see ZFObject
Definition ZFObjectRetain.h:104
#define zfobjRelease(obj)
release an object, see ZFObject
Definition ZFObjectRetain.h:148
base class of all objects
Definition ZFObjectCore.h:196
once allocated, you may use object's member method just like normal C++ object:
Advanced
tired of writing retain and release everywhere? we also supply some utility methods to make it easier to manage allocated object:
{
}
{
}
#define zfobjAutoRelease(obj)
make object autorelease, which would be released by the owner thread
Definition ZFThread_zfobjAutoRelease.h:38
type restrict version of zfauto
Definition zfautoFwd.h:108
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:79
it's recommended to use zfauto for API design when your function needs to return an allocated object
return obj;
}
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34