ZFFramework
 
Loading...
Searching...
No Matches
ZFAutoReleasePool.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFAutoReleasePool_h_
7#define _ZFI_ZFAutoReleasePool_h_
8
9#include "ZFObject.h"
11
12zfclassNotPOD _ZFP_ZFAutoReleasePoolPrivate;
19zfclass ZFLIB_ZFCore ZFAutoReleasePool : zfextend ZFObject {
20 ZFOBJECT_DECLARE(ZFAutoReleasePool, ZFObject)
21
22
31
32protected:
37
39 virtual void objectOnInit(void);
41 virtual void objectOnDealloc(void);
43 virtual void objectOnDeallocPrepare(void);
44
47
48public:
52 virtual void poolAdd(ZF_IN ZFObject *obj);
58 virtual void poolDrain();
59
60private:
61 _ZFP_ZFAutoReleasePoolPrivate *d;
62};
63
65#endif // #ifndef _ZFI_ZFAutoReleasePool_h_
66
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define zfclassNotPOD
shows the class is not a POD type, you should not memset it or declare it in stack or copy value by c...
Definition ZFCoreTypeDef_ClassType.h:48
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFMP_IN(ParamType, paramName)
macro to wrap param types for ZFMETHOD_INLINE_0 series
Definition ZFMethod.h:105
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
ZFObject related include.
#define zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
#define ZFOBJECT_ON_INIT_DECLARE_1(ZFMP_0)
see ZFOBJECT_ON_INIT_INLINE_1
Definition ZFObjectDeclare.h:263
#define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
necessary for every class inherit from ZFObject
Definition ZFObjectDeclare.h:126
#define ZFOBJECT_SINGLETON_DECLARE(AccessTypeName, accessMethodName)
util macro to declare a singleton instance access for ZFObject type
Definition ZFObjectGlobalInstance.h:256
virtual void poolAdd(ZFObject *obj)
add an object which would be auto released upon pool's drain or delete
virtual void objectOnInit(zfindex maxSize)
init with max capacity
virtual void objectOnDealloc(void)
override this to destroy your object
virtual void poolDrain()
manually drain a pool, all object in the pool would be released immediately
static ZFAutoReleasePool * instance()
global memory pool, you should drain it manually and you take full responsibility to keep it safe to ...
virtual void objectInfoImplAppend(zfstring &ret)
see objectInfo
virtual void objectOnDeallocPrepare(void)
called before objectOnDealloc, safe to call virtual functions here