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

light weight smart pointer More...

#include "ZFCoreTypeDef.h"
#include "ZFCoreUtilMacro.h"
#include "zfstr.h"

Go to the source code of this file.

Classes

class  ZFCorePointer
 abstract base class for ZFCorePointerT More...
 
class  ZFCorePointerT< T_Pointer, T_ZFCorePointerType >
 pointer container with reference count logic More...
 
class  ZFCorePointerForPointerRef< T_Pointer >
 see ZFCorePointerT More...
 
class  ZFCorePointerForPOD< T_Pointer >
 see ZFCorePointerT More...
 
class  ZFCorePointerForObject< T_Pointer >
 see ZFCorePointerT More...
 
class  ZFCorePointerForPoolObject< T_Pointer >
 see ZFCorePointerT More...
 

Macros

#define ZFCOREPOINTER_DECLARE(T_ZFCorePointer, pointerRetainAction, pointerDeleteAction)
 declare your custom ZFCorePointerT type
 

Detailed Description

light weight smart pointer

Macro Definition Documentation

◆ ZFCOREPOINTER_DECLARE

#define ZFCOREPOINTER_DECLARE ( T_ZFCorePointer,
pointerRetainAction,
pointerDeleteAction )

declare your custom ZFCorePointerT type

usage

ZFCOREPOINTER_DECLARE(YourCorePointer, {
logRetained(p); // define your own retain action here
}, {
delete p; // define your own delete action here
})
#define ZFCOREPOINTER_DECLARE(T_ZFCorePointer, pointerRetainAction, pointerDeleteAction)
declare your custom ZFCorePointerT type
Definition ZFCorePointer.h:347

once declared, you can use as normal ZFCorePointerT

YourCorePointer sp(zfnew(YourType));
#define zfnew(Type,...)
same as new defined for future use
Definition ZFCoreTypeDef_ClassType.h:89