17: _ZFP_obj(
zfRetain(_ZFP_zfanyCast(obj)))
20template<
typename T_ZFObject>
21zfauto::zfauto(
ZF_IN T_ZFObject
const &obj)
22: _ZFP_obj(
zfRetain(_ZFP_zfanyCast(obj)))
25inline zfauto::~zfauto(
void) {
35template<
typename T_ZFObject>
36zfauto &zfauto::operator = (
ZF_IN T_ZFObject
const &obj) {
43template<
typename T_ZFObject>
44zfbool zfauto::operator == (
ZF_IN T_ZFObject
const &obj)
const {
45 return this->
toObject() == _ZFP_zfanyCast(obj);
47template<
typename T_ZFObject>
48zfbool zfauto::operator != (
ZF_IN T_ZFObject
const &obj)
const {
49 return this->
toObject() != _ZFP_zfanyCast(obj);
52template<
typename T_ZFObject>
53inline zfauto::operator T_ZFObject * (void)
const {
54 return zfcast(T_ZFObject *, this->toObject());
57inline const ZFClass *zfauto::ClassData(
void) {
62 ZFObject *t = _ZFP_obj;
68 return _ZFP_obj ? _ZFP_obj->objectRetainCount() : 0;
70template<
typename T_ZFObject>
78template<
typename T_ZFObjectBase>
80 return zfcast(T_ZFObjectBase *, this->toObject());
83template<
typename T_ZFObjectBase>
85 return T_ZFObjectBase::ClassData();
#define ZFCoreMutexUnlock()
see ZFCoreMutexLock
Definition ZFCoreMutex.h:58
#define ZFCoreMutexLock()
internal use only
Definition ZFCoreMutex.h:51
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:184
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
retain count logic for ZFFramework
#define zfRelease(obj)
release an object, see ZFObject
Definition ZFObjectRetain.h:148
#define zfunsafe_zfRelease(obj)
no lock version of zfRelease, use with caution
Definition ZFObjectRetain.h:151
#define zfRetain(obj)
retain an object, see ZFObject
Definition ZFObjectRetain.h:128
#define zfunsafe_zfRetain(obj)
no lock version of zfRetain, use with caution
Definition ZFObjectRetain.h:131
ZFObject's class info.
Definition ZFClass.h:66
base class of all objects
Definition ZFObjectCore.h:205
static const ZFClass * ClassData(void)
get class info
Definition ZFObjectCore.h:207
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
T_ZFObject to(void) const
cast by zfcast
void zfunsafe_assign(ZFObject *obj)
no lock version of object assign, for low level impl only
ZFObject * toObject(void) const
get the holded object
Definition zfautoFwd.h:89
zfindex objectRetainCount(void) const
get current retain count
type restrict version of zfauto
Definition zfautoFwd.h:108
#define zfcast(T_To, obj)
safely cast ZFObject types, return null if not desired type
Definition zfcast.h:24