6#ifndef _ZFI_ZFValueHolder_h_
7#define _ZFI_ZFValueHolder_h_
42 if(this->holdedData && this->holderType) {
43 void *holdedData = this->holdedData;
47 holderType(holdedData);
91 template<
typename T_RawType>
93 return (T_RawType)this->holdedData;
96 template<
typename T_RawType>
99 return *(T_RawTypePointer)this->holdedData;
111 static void TypePointerRef(
ZF_IN void *holdedData) {
113 static void TypePOD(
ZF_IN void *holdedData) {
116 template<
typename T_Object>
117 static void TypeObject(
ZF_IN void *holdedData) {
120 template<
typename T_Object>
121 static void TypePoolObject(
ZF_IN void *holdedData) {
126#define ZFValueHolderTypePointerRef() _ZFP_ZFValueHolderType::TypePointerRef
128#define ZFValueHolderTypePOD() _ZFP_ZFValueHolderType::TypePOD
130#define ZFValueHolderTypeObject(T_Object) _ZFP_ZFValueHolderType::TypeObject<T_Object>
132#define ZFValueHolderTypePoolObject(T_Object) _ZFP_ZFValueHolderType::TypePoolObject<T_Object>
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfdelete(instance)
same as delete defined for future use
Definition ZFCoreTypeDef_ClassType.h:91
#define zfoverride
dummy macro shows that method override parent's method
Definition ZFCoreTypeDef_ClassType.h:58
#define zffree(ptr)
same as free defined for future use, do nothing if ptr is NULL
Definition ZFCoreTypeDef_ClassType.h:112
#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
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
ZFCompareResult
compare result of two ZFObjects
Definition ZFCoreTypeDef_OtherType.h:28
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define zfpoolDelete(obj)
see zfpoolNew
Definition ZFMemPool.h:38
#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 zfclass
same as class, shows that this class is a ZFObject type
Definition ZFObjectClassTypeFwd.h:38
base class of all objects
#define ZFOBJECT_DECLARE_WITH_CUSTOM_CTOR(ChildClass, SuperClass,...)
declare object which allow custom constructor
Definition ZFObjectDeclare.h:142
retain count logic for ZFFramework
#define ZFALLOC_CACHE_RELEASE(action)
mark class that it should apply cache logic when alloc
Definition ZFObjectRetain.h:186
void(* ZFValueHolderType)(void *holdedData)
type for ZFValueHolder
Definition ZFValueHolder.h:25
virtual void objectOnInit(void)
override this to init your object
virtual void objectOnDeallocPrepare(void)
called before objectOnDealloc, safe to call virtual functions here
Definition ZFObjectCore.h:758
used to hold a non ZFObject type for performance
Definition ZFValueHolder.h:29
virtual void objectOnInit(void)
override this to init your object
Definition ZFValueHolder.h:67
virtual void objectOnInit(void *holdedData, ZFValueHolderType holderType)
init with object
Definition ZFValueHolder.h:59
virtual void objectInfoImplAppend(zfstring &ret)
see objectInfo
ZFValueHolderType holderType
delete callback to clear the holdedData
Definition ZFValueHolder.h:87
void * holdedData
used to hold the raw pointer
Definition ZFValueHolder.h:83
T_RawType holdedDataRef(void)
util method to cast holdedData
Definition ZFValueHolder.h:97
virtual void objectOnDeallocPrepare(void)
called before objectOnDealloc, safe to call virtual functions here
Definition ZFValueHolder.h:71
T_RawType holdedDataPointer(void)
util method to cast holdedData
Definition ZFValueHolder.h:92
virtual ZFCompareResult objectCompareValueImpl(ZFObject *anotherObj)
see objectCompareValue
T_Type * TrPtr
pointer type
Definition ZFCoreUtilTemplate.h:108