ZFFramework
 
Loading...
Searching...
No Matches
zfauto Class Reference

a ZFObject holder which would release content object automatically when destroyed More...

#include <zfautoFwd.h>

Inheritance diagram for zfauto:
zfautoT< ZFTaskId > zfautoT< ZFAudio > zfautoT< ZFObject > zfautoT< T_ZFObjectBase > zfobj< ZFObject > zfobj< T_ZFObjectBase >

Public Member Functions

const zfanyasAny (void) const
 access as zfany
 
void zfunsafe_assign (ZFObject *obj)
 no lock version of object assign, for low level impl only
 
zfindex objectRetainCount (void) const
 get current retain count
 
ZFObjecttoObject (void) const
 get the holded object
 
template<typename T_ZFObject>
T_ZFObject to (void) const
 cast by zfcast
 

Detailed Description

a ZFObject holder which would release content object automatically when destroyed

useful to hold a ZFObject as temp return value:

zfauto yourFunc(void) {
// alloc an object for return
// use zfauto to wrap the returned object
return zfauto(obj);
}
{
zfauto value = yourFunc();
ZFObject *obj = value;
} // content obj would be released when zfauto destroyed
base class of all objects
Definition ZFObjectCore.h:209
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:157

The documentation for this class was generated from the following file: