6#ifndef _ZFI_ZFProperty_h_
7#define _ZFI_ZFProperty_h_
16typedef void (*_ZFP_ZFPropertyCallbackEnsureInit)(
20typedef void (*_ZFP_ZFPropertyCallbackDealloc)(
24typedef void (*_ZFP_ZFPropertyMethodCleanup)(
ZF_IN const ZFMethod *method);
48 return this->_ZFP_ZFProperty_propertyId.sigId();
54 return this->_ZFP_ZFProperty_isUserRegister;
60 return this->_ZFP_ZFProperty_isDynamicRegister;
66 return this->_ZFP_ZFProperty_dynamicRegisterUserData;
84 return this->_ZFP_ZFProperty_ownerClass;
90 return this->_ZFP_ZFProperty_name;
101 return this->_ZFP_ZFProperty_typeName ? this->_ZFP_ZFProperty_typeName : this->_ZFP_ZFProperty_typeId;
112 return this->_ZFP_ZFProperty_typeId;
118 return this->_ZFP_ZFProperty_setterMethod;
124 return this->_ZFP_ZFProperty_getterMethod;
134 return (this->_ZFP_ZFProperty_propertyClassOfRetainProperty !=
zfnull);
142 return this->_ZFP_ZFProperty_propertyClassOfRetainProperty;
186 void _ZFP_ZFPropertyInit(
196 ,
ZF_IN _ZFP_ZFPropertyMethodCleanup setterMethodCleanup
197 ,
ZF_IN _ZFP_ZFPropertyMethodCleanup getterMethodCleanup
200 ZFProperty *_ZFP_ZFProperty_removeConst(
void)
const {
201 return const_cast<ZFProperty *
>(
this);
204 zfuint _ZFP_ZFProperty_refCount;
205 zfbool _ZFP_ZFProperty_isInternal;
206 zfbool _ZFP_ZFProperty_isInternalPrivate;
207 zfbool _ZFP_ZFProperty_isUserRegister;
208 zfbool _ZFP_ZFProperty_isDynamicRegister;
210 ZFObject *_ZFP_ZFProperty_dynamicRegisterUserData;
211 ZFObject *_ZFP_ZFProperty_dynamicRegisterUserDataWrapper;
212 const ZFClass *_ZFP_ZFProperty_ownerClass;
216 const ZFMethod *_ZFP_ZFProperty_setterMethod;
217 const ZFMethod *_ZFP_ZFProperty_getterMethod;
218 _ZFP_ZFPropertyMethodCleanup _ZFP_ZFProperty_setterMethodCleanup;
219 _ZFP_ZFPropertyMethodCleanup _ZFP_ZFProperty_getterMethodCleanup;
220 const ZFClass *_ZFP_ZFProperty_propertyClassOfRetainProperty;
221 _ZFP_ZFPropertyCallbackEnsureInit _ZFP_ZFProperty_callbackEnsureInit;
222 _ZFP_ZFPropertyCallbackDealloc _ZFP_ZFProperty_callbackDealloc;
252 ,
ZF_IN _ZFP_ZFPropertyMethodCleanup setterMethodCleanup
253 ,
ZF_IN _ZFP_ZFPropertyMethodCleanup getterMethodCleanup
260 ,
ZF_IN _ZFP_ZFPropertyCallbackEnsureInit callbackEnsureInit
261 ,
ZF_IN _ZFP_ZFPropertyCallbackDealloc callbackDealloc
267 _ZFP_ZFPropertyRegisterHolder(
277 ,
ZF_IN _ZFP_ZFPropertyMethodCleanup setterMethodCleanup
278 ,
ZF_IN _ZFP_ZFPropertyMethodCleanup getterMethodCleanup
285 ,
ZF_IN _ZFP_ZFPropertyCallbackEnsureInit callbackEnsureInit
286 ,
ZF_IN _ZFP_ZFPropertyCallbackDealloc callbackDealloc
288 : propertyInfo(_ZFP_ZFPropertyRegister(
291 , dynamicRegisterUserData
298 , setterMethodCleanup
299 , getterMethodCleanup
300 , propertyClassOfRetainProperty
301 , callbackIsValueAccessed
302 , callbackIsInitValue
304 , callbackUserRegisterInitValueSetup
305 , callbackDynamicRegisterInitValueGetter
310 ~_ZFP_ZFPropertyRegisterHolder(
void) {
311 _ZFP_ZFPropertyUnregister(this->propertyInfo);
#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 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: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 ZFCLASS_DISALLOW_COPY_CONSTRUCTOR(ClassName)
a macro to show that a class doesn't allow copy constructor
Definition ZFCoreTypeDef_ClassType.h:81
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_zft_zfidentity zfidentity
identity type, ensured at least 32 bit, ensured unsigned
Definition ZFCoreTypeDef_CoreType.h:225
#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
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
reflectable method definination for ZFFramework
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
ZFCoreArray< const ZFProperty * > ZFPropertyGetAll(void)
get all property currently registered, for debug use only
Definition ZFProperty.h:235
void ZFPropertyGetAllT(ZFCoreArray< const ZFProperty * > &ret)
see ZFPropertyGetAll
property for ZFObject type
zfauto(* ZFPropertyCallbackDynamicRegisterInitValueGetter)(const ZFProperty *property)
callback to setup init value for ZFPropertyDynamicRegister
Definition ZFPropertyFwd.h:86
zfbool(* ZFPropertyCallbackIsValueAccessed)(const ZFProperty *property, zfany const &ownerObj)
used to check whether the property has been accessed
Definition ZFPropertyFwd.h:27
void(* ZFPropertyCallbackValueReset)(const ZFProperty *property, zfany const &ownerObj)
used to reset the property to its init state
Definition ZFPropertyFwd.h:63
zfbool(* ZFPropertyCallbackIsInitValue)(const ZFProperty *property, zfany const &ownerObj, zfauto *outInitValue)
used to check whether the property is in init value state
Definition ZFPropertyFwd.h:48
void(* ZFPropertyCallbackUserRegisterInitValueSetup)(const ZFProperty *property, void *v)
for user registered property only, used to setup a property's init value
Definition ZFPropertyFwd.h:77
ZFObject's class info.
Definition ZFClass.h:67
light weight array
Definition ZFCoreArray.h:331
reflectable method for ZFObject
Definition ZFMethod.h:252
base class of all objects
Definition ZFObjectCore.h:209
info for a property for ZFObject, see ZFPROPERTY_RETAIN for more info
Definition ZFProperty.h:28
const ZFMethod * getterMethod(void) const
get the getter method
Definition ZFProperty.h:123
void objectInfoT(zfstring &ret) const
see objectInfo
const ZFMethod * setterMethod(void) const
get the getter method
Definition ZFProperty.h:117
zfstring objectInfo(void) const
get info about this property
Definition ZFProperty.h:37
ZFPropertyCallbackValueReset callbackValueReset
see ZFPropertyCallbackValueReset
Definition ZFProperty.h:175
const zfstring & propertyTypeId(void) const
type id string declared in ZFPROPERTY_XXX
Definition ZFProperty.h:111
ZFPropertyCallbackIsValueAccessed callbackIsValueAccessed
see ZFPropertyCallbackIsValueAccessed
Definition ZFProperty.h:171
zfbool isUserRegister(void) const
true if this property is registered by ZFPropertyUserRegisterRetain
Definition ZFProperty.h:53
zfbool isInternalPrivate(void) const
whether the property is internal private property
Definition ZFProperty.h:167
ZFPropertyCallbackDynamicRegisterInitValueGetter callbackDynamicRegisterInitValueGetter
see ZFPropertyDynamicRegister
Definition ZFProperty.h:179
zfbool isRetainProperty(void) const
true if the property is retain property
Definition ZFProperty.h:133
ZFPropertyCallbackUserRegisterInitValueSetup callbackUserRegisterInitValueSetup
see ZFPropertyUserRegisterAssign
Definition ZFProperty.h:177
const zfstring & propertyTypeName(void) const
type string for the property
Definition ZFProperty.h:100
const ZFClass * ownerClass(void) const
get the property's owner class
Definition ZFProperty.h:83
ZFPropertyCallbackIsInitValue callbackIsInitValue
see ZFPropertyCallbackIsInitValue
Definition ZFProperty.h:173
zfbool propertySerializable(void) const
true if the property is serializable
zfany dynamicRegisterUserData(void) const
see ZFPropertyDynamicRegister
Definition ZFProperty.h:65
const ZFClass * propertyClassOfRetainProperty(void) const
for retain property only, get the retain property's declared class
Definition ZFProperty.h:141
zfbool isInternal(void) const
whether the property is internal property
Definition ZFProperty.h:156
const zfstring & propertyName(void) const
name for the property
Definition ZFProperty.h:89
zfbool isDynamicRegister(void) const
true if this property is registered by ZFPropertyDynamicRegister
Definition ZFProperty.h:59
zfidentity propertyId(void) const
internal property id, for debug use only
Definition ZFProperty.h:47
readonly string container for internal use only
Definition ZFSigName.h:17
util method to cast ZFObject types freely
Definition zfany.h:35
util class to cast ZFObject types freely