ZFFramework
|
retain count logic for ZFFramework More...
#include "ZFObjectCore.h"
Go to the source code of this file.
Macros | |
#define | zfAlloc(T_ZFObject, ...) |
alloc an object, see ZFObject | |
#define | zfunsafe_zfAlloc(T_ZFObject, ...) |
no lock version of zfAlloc, use with caution | |
#define | zfRetain(obj) |
retain an object, see ZFObject | |
#define | zfunsafe_zfRetain(obj) |
no lock version of zfRetain, use with caution | |
#define | zfRelease(obj) |
release an object, see ZFObject | |
#define | zfunsafe_zfRelease(obj) |
no lock version of zfRelease, use with caution | |
#define | ZFALLOC_CACHE_RELEASE(action) |
mark class that it should apply cache logic when alloc | |
#define | ZFALLOC_CACHE_RELEASE_ABSTRACT(action) |
ZFALLOC_CACHE_RELEASE for abstract class | |
#define | zfRetainChange(property, propertyValue) |
util to release property's old value, retain new value, then set to property | |
#define | zfunsafe_zfRetainChange(property, propertyValue) |
no lock version of zfRetainChange, use with caution | |
Functions | |
void | zfAllocCacheRemoveAll (void) |
remove all object cache, see ZFALLOC_CACHE_RELEASE | |
retain count logic for ZFFramework
#define zfAlloc | ( | T_ZFObject, | |
... ) |
alloc an object, see ZFObject
if your class has declared ZFALLOC_CACHE_RELEASE, then zfAlloc would automatically has cache logic
#define ZFALLOC_CACHE_RELEASE | ( | action | ) |
mark class that it should apply cache logic when alloc
usage:
once declared, when you alloc object with no extra param, the cache logic would automatically take effect:
note the alloc cache logic is explicitly attached to class, parent class' ZFALLOC_CACHE_RELEASE does not make child class cacheable, the child class must also explicitly declare ZFALLOC_CACHE_RELEASE to enable cache logic
#define zfRetainChange | ( | property, | |
propertyValue ) |
util to release property's old value, retain new value, then set to property
this macro is similar to the retain property in Object-C
typical usage: