ZFFramework
 
Loading...
Searching...
No Matches
ZFCoreUtilAutoPtr.h File Reference

utilities for ZFFramework More...

#include "ZFCoreTypeDef.h"

Go to the source code of this file.

Macros

#define zfscopeFree(obj)
 util macro to make a POD object automatically deleted after code block, using zffree
 
#define zfscopeDelete(obj)
 util macro to make a non-ZFObject object automatically deleted after code block, using zfdelete
 
#define zfscopeCleanup_1(action, P0, p0)
 util to perform custom cleanup action after code block
 
#define zfscopeCleanup_2(action, P0, p0, P1, p1)
 see zfscopeCleanup_1
 
#define zfscopeCleanup_3(action, P0, p0, P1, p1, P2, p2)
 see zfscopeCleanup_1
 
#define zfscopeCleanup_4(action, P0, p0, P1, p1, P2, p2, P3, p3)
 see zfscopeCleanup_1
 
#define zfscopeCleanup_5(action, P0, p0, P1, p1, P2, p2, P3, p3, P4, p4)
 see zfscopeCleanup_1
 
#define zfscopeCleanup_6(action, P0, p0, P1, p1, P2, p2, P3, p3, P4, p4, P5, p5)
 see zfscopeCleanup_1
 
#define zfscopeCleanup_7(action, P0, p0, P1, p1, P2, p2, P3, p3, P4, p4, P5, p5, P6, p6)
 see zfscopeCleanup_1
 
#define zfscopeCleanup_8(action, P0, p0, P1, p1, P2, p2, P3, p3, P4, p4, P5, p5, P6, p6, P7, p7)
 see zfscopeCleanup_1
 

Detailed Description

utilities for ZFFramework

Macro Definition Documentation

◆ zfscopeFree

#define zfscopeFree ( obj)

util macro to make a POD object automatically deleted after code block, using zffree

usage:

{ // code block
zfbyte *buf = (zfbyte *)zfmalloc(size);
zfscopeFree(buf); // must be placed in single line
} // buf would be released by #zffree after code block
#define zfmalloc(size)
same as malloc defined for future use
Definition ZFCoreTypeDef_ClassType.h:100
_ZFT_t_zfbyte zfbyte
8-bit unsigned value, see zfindex
Definition ZFCoreTypeDef_CoreType.h:194
#define zfscopeFree(obj)
util macro to make a POD object automatically deleted after code block, using zffree
Definition ZFCoreUtilAutoPtr.h:36

◆ zfscopeDelete

#define zfscopeDelete ( obj)

util macro to make a non-ZFObject object automatically deleted after code block, using zfdelete

usage:

{ // code block
NonePODObject *obj = zfnew(NonePODObject);
zfscopeDelete(obj); // must be placed in single line
} // buf would be released by #zfdelete after code block
#define zfnew(Type,...)
same as new defined for future use
Definition ZFCoreTypeDef_ClassType.h:89
#define zfscopeDelete(obj)
util macro to make a non-ZFObject object automatically deleted after code block, using zfdelete
Definition ZFCoreUtilAutoPtr.h:78