6#ifndef _ZFI_ZFObjectAutoPtr_h_
7#define _ZFI_ZFObjectAutoPtr_h_
24 template<
typename T_ZFObject>
25 T_ZFObject set(T_ZFObject obj) {
30 _ZFP_zflineRelease(
void)
34 ~_ZFP_zflineRelease(
void) {
42 template<
typename T_ZFObject>
43 T_ZFObject set(T_ZFObject obj) {
48 _ZFP_zfunsafe_zflineRelease(
void)
52 ~_ZFP_zfunsafe_zflineRelease(
void) {
82#define zflineRelease(obj) (_ZFP_zflineRelease().set(obj))
84#define zfunsafe_zflineRelease(obj) (_ZFP_zfunsafe_zflineRelease().set(obj))
90#define zflineAlloc(T_ZFObject, ...) \
91 zflineRelease(zfAlloc(T_ZFObject, ##__VA_ARGS__))
93#define zfunsafe_zflineAlloc(T_ZFObject, ...) \
94 zfunsafe_zflineRelease(zfunsafe_zfAlloc(T_ZFObject, ##__VA_ARGS__))
99 template<
typename T_ZFObject>
100 _ZFP_zfblockedReleaseContainer(
ZF_IN T_ZFObject obj)
104 ~_ZFP_zfblockedReleaseContainer(
void) {
112 template<
typename T_ZFObject>
113 _ZFP_zfunsafe_zfblockedReleaseContainer(
ZF_IN T_ZFObject obj)
117 ~_ZFP_zfunsafe_zfblockedReleaseContainer(
void) {
134#define zfblockedRelease(obj) \
135 _ZFP_zfblockedReleaseContainer ZFUniqueName(zfblockedRelease) (obj)
137#define zfunsafe_zfblockedRelease(obj) \
138 _ZFP_zfunsafe_zfblockedReleaseContainer ZFUniqueName(zfblockedRelease) (obj)
156template<
typename T_ZFObjectBase>
164 template<
typename P0>
169 template<
typename P0,
typename P1>
170 zfobj(P0
const &p0, P1
const &p1)
174 template<
typename P0,
typename P1,
typename P2>
175 zfobj(P0
const &p0, P1
const &p1, P2
const &p2)
179 template<
typename P0,
typename P1,
typename P2,
typename P3>
180 zfobj(P0
const &p0, P1
const &p1, P2
const &p2, P3
const &p3)
184 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4>
185 zfobj(P0
const &p0, P1
const &p1, P2
const &p2, P3
const &p3, P4
const &p4)
189 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
190 zfobj(P0
const &p0, P1
const &p1, P2
const &p2, P3
const &p3, P4
const &p4, P5
const &p5)
194 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
195 zfobj(P0
const &p0, P1
const &p1, P2
const &p2, P3
const &p3, P4
const &p4, P5
const &p5, P6
const &p6)
199 template<
typename P0,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7>
200 zfobj(P0
const &p0, P1
const &p1, P2
const &p2, P3
const &p3, P4
const &p4, P5
const &p5, P6
const &p6, P7
const &p7)
206 zfauto::operator = (obj);
210 zfauto::operator = ((
zfauto const &)obj);
214 zfauto::operator = ((
zfauto const &)obj);
217 template<
typename T_ZFObject>
219 zfauto::operator = (obj);
224 template<
typename T_ZFObject>
225 inline zfbool operator == (
ZF_IN T_ZFObject
const &obj)
const {
226 return this->
toObject() == _ZFP_zfanyCast(obj);
228 template<
typename T_ZFObject>
229 inline zfbool operator != (
ZF_IN T_ZFObject
const &obj)
const {
230 return this->
toObject() != _ZFP_zfanyCast(obj);
234 T_ZFObjectBase *operator -> (
void)
const {
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define ZFCOREPOINTER_DECLARE(T_ZFCorePointer, pointerRetainAction, pointerDeleteAction)
declare your custom ZFCorePointerT type
Definition ZFCorePointer.h:347
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#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
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define zfunsafe_zflineAlloc(T_ZFObject,...)
no lock version of zflineAlloc, use with caution
Definition ZFObjectAutoPtr.h:93
#define zfcast(T_To, obj)
safely cast ZFObject types, return null if not desired type
Definition ZFObjectCast.h:28
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
see ZFCorePointerT
Definition ZFObjectAutoPtr.h:19
base class of all objects
Definition ZFObjectCore.h:209
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
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:91
type restrict version of zfauto
Definition zfautoFwd.h:110
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:157
smart pointer for ZFObject