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

strong reference to ZFObject More...

#include <zfwrap.h>

Inheritance diagram for zfwrap:
zfauto

Public Member Functions

zfbool valid (void) const
 true if the holded object is not null
 
zfany get (void) const
 get the holded object
 
template<typename T_ZFObject>
void set (T_ZFObject const &obj)
 set the holded object
 
ZFObjecttoObject (void) const
 get the holded object
 
template<typename T_ZFObject>
T_ZFObject to (void) const
 cast by zfcast
 
const zfanyasAny (void) const
 access as zfany
 
- Public Member Functions inherited from zfauto
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

strong reference to ZFObject

compared to zfweak, this class is designed for holding ZFObject types that can be modified, typically output params that can be modified:

// in cpp:
ZFMETHOD_FUNC_DEFINE_1(void, func1, ZFMP_IN_OUT(zfwrap &, ret)) {...}
ZFMETHOD_FUNC_DEFINE_1(void, func2, ZFMP_IN_OUT(zfauto &, ret)) {...}
// in lua:
local ret = zfwrap();
func1(ret);
ZFLog('after func1: %s', ret:get())
func2(ret);
ZFLog('after func2: %s', ret:get())
#define ZFLog(...)
thread-safe log utility
Definition ZFLog.h:77
#define ZFMP_IN_OUT(ParamType, paramName)
see ZFMP_IN
Definition ZFMethod.h:117
#define ZFMETHOD_FUNC_DEFINE_1(ReturnType, MethodName, ZFMP_0)
see ZFMETHOD_FUNC_DECLARE_0
Definition ZFMethodFuncDeclare.h:658
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
strong reference to ZFObject
Definition zfwrap.h:34
zfany get(void) const
get the holded object
Definition zfwrap.h:90

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