5#ifndef _ZFI_ZFCoreValue_h_
6#define _ZFI_ZFCoreValue_h_
16template<
typename T_Value>
36 if(--(dTmp->refCount) == 0) {
60 T_Value
const &
value(
void)
const {
89 if(d && --(d->refCount) == 0) {
102 if(dTmp && --(dTmp->refCount) == 0) {
121 D(
ZF_IN T_Value
const &v)
#define zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:184
#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
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
_ZFT_t_zfuint zfuint
same as unsigned int, see zfindex
Definition ZFCoreTypeDef_CoreType.h:169
#define zfpoolDelete(obj)
see zfpoolNew
Definition ZFMemPool.h:38
#define zfpoolNew(T_Type,...)
internal use only, for allocating internal types for performance
Definition ZFMemPool.h:37
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
light weight value holder with ref count logic
Definition ZFCoreValue.h:17
void refPrepare(void)
prepare instance to make it able to be shared between each copy
Definition ZFCoreValue.h:28
ZFCoreValue< T_Value > & value(T_Value const &v)
change the value, all reference would also be changed
Definition ZFCoreValue.h:70
void refDelete(void)
delete reference
Definition ZFCoreValue.h:32
T_Value const & value(void) const
access the value
Definition ZFCoreValue.h:60
zfbool valid(void) const
whether the value has been initialized
Definition ZFCoreValue.h:45
T_Value & value(void)
access the value
Definition ZFCoreValue.h:50
T_Value ValueType
value type
Definition ZFCoreValue.h:22