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

user registered ZFProperty More...

#include "ZFMethodUserRegister.h"
#include "ZFObjectAutoPtr.h"
#include "ZFNull.h"

Go to the source code of this file.

Classes

class  ZFPropertyUserRegisterDefaultImplRetain< T_Type >
 default impl for ZFPropertyUserRegisterRetain More...
 
class  ZFPropertyUserRegisterDefaultImplAssign< T_Type >
 default impl for ZFPropertyUserRegisterAssign More...
 

Macros

#define ZFPropertyUserRegisterRetain(resultProperty, ownerClass, Type, propertyNameString, InitValueOrEmpty, SetterAccessType, GetterAccessType)
 register a custom property to existing class, for advanced reflection use only
 
#define ZFPropertyUserRegisterRetainDetail(resultProperty, ownerClass, Type, propertyNameString, InitValueOrEmpty, SetterAccessType, GetterAccessType, Func_ZFPropertySetterInvoker, Func_ZFPropertyGetterInvoker, Func_ZFPropertyCallbackIsValueAccessed, Func_ZFPropertyCallbackIsInitValue, Func_ZFPropertyCallbackValueReset)
 see ZFPropertyUserRegisterRetain
 
#define ZFPROPERTY_USER_REGISTER_RETAIN(ownerClassSig, Type, propertyNameSig, InitValueOrEmpty, SetterAccessType, GetterAccessType)
 see ZFPropertyUserRegisterRetain
 
#define ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(ownerClassSig, Type, propertyNameSig, InitValueOrEmpty, SetterAccessType, GetterAccessType, Func_ZFPropertySetterInvoker, Func_ZFPropertyGetterInvoker, Func_ZFPropertyCallbackIsValueAccessed, Func_ZFPropertyCallbackIsInitValue, Func_ZFPropertyCallbackValueReset)
 see ZFPropertyUserRegisterRetain
 
#define ZFPropertyUserRegisterAssign(resultProperty, ownerClass, Type, propertyNameString, InitValueOrEmpty, SetterAccessType, GetterAccessType)
 see ZFPropertyUserRegisterRetain
 
#define ZFPropertyUserRegisterAssignDetail(resultProperty, ownerClass, Type, propertyNameString, InitValueOrEmpty, SetterAccessType, GetterAccessType, Func_ZFPropertySetterInvoker, Func_ZFPropertyGetterInvoker, Func_ZFPropertyCallbackIsValueAccessed, Func_ZFPropertyCallbackIsInitValue, Func_ZFPropertyCallbackValueReset)
 see ZFPropertyUserRegisterRetain
 
#define ZFPROPERTY_USER_REGISTER_ASSIGN(ownerClassSig, Type, propertyNameSig, InitValueOrEmpty, SetterAccessType, GetterAccessType)
 see ZFPropertyUserRegisterAssign
 
#define ZFPROPERTY_USER_REGISTER_ASSIGN_DETAIL(ownerClassSig, Type, propertyNameSig, InitValueOrEmpty, SetterAccessType, GetterAccessType, Func_ZFPropertySetterInvoker, Func_ZFPropertyGetterInvoker, Func_ZFPropertyCallbackIsValueAccessed, Func_ZFPropertyCallbackIsInitValue, Func_ZFPropertyCallbackValueReset)
 see ZFPropertyUserRegisterAssign
 

Functions

void ZFPropertyUserRegisterNotifyUpdate (ZFObject *ownerObject, const ZFProperty *property, const void *propertyValueOld)
 see ZFPropertyUserRegisterRetain, ZFObject::objectPropertyValueOnUpdate
 
void ZFPropertyUserRegisterNotifyReset (ZFObject *ownerObject, const ZFProperty *property)
 see ZFPropertyUserRegisterRetain
 
void ZFPropertyUserUnregister (const ZFProperty *zfproperty)
 see ZFPropertyUserRegisterRetain
 

Detailed Description

user registered ZFProperty

Macro Definition Documentation

◆ ZFPropertyUserRegisterRetain

#define ZFPropertyUserRegisterRetain ( resultProperty,
ownerClass,
Type,
propertyNameString,
InitValueOrEmpty,
SetterAccessType,
GetterAccessType )

register a custom property to existing class, for advanced reflection use only

example:

// declare each callback for ZFProperty
static void myCallbackSetterInvoker(
ZF_IN const ZFProperty *
, ZF_IN ZFObject *ownerObj
, ZF_IN MyPropType const &v
) {
...
}
static MyPropType const &myCallbackGetterInvoker(
ZF_IN const ZFProperty *property
, ZF_IN ZFObject *ownerObj
) {
...
}
static zfbool myCallbackIsValueAccessed(
ZF_IN const ZFProperty *
, ZF_IN zfany const &ownerObj
) {
...
}
static zfbool myCallbackIsInitValue(
ZF_IN const ZFProperty *property
, ZF_IN zfany const &ownerObj
, ZF_OUT_OPT zfauto *outInitValue
) {
...
}
static void myCallbackValueReset(
ZF_IN const ZFProperty *property
, ZF_IN zfany const &ownerObj
) {
...
}
// register it, using ZF_GLOBAL_INITIALIZER_INIT is recommended
ZF_GLOBAL_INITIALIZER_INIT(MyPropertyRegister) {
ZFPropertyUserRegisterRetainDetail(resultProperty, MyClassToAttachTheProperty::ClassData(),
Type, "propertyName", ZFPropertyNoInitValue,
public, public
, myCallbackSetterInvoker
, myCallbackGetterInvoker
, myCallbackIsValueAccessed
, myCallbackIsInitValue
, myCallbackValueReset
);
_property = resultProperty;
ZFLogTrim() << resultProperty;
}
ZF_GLOBAL_INITIALIZER_DESTROY(MyPropertyRegister) {
}
const ZFProperty *_property;
ZF_GLOBAL_INITIALIZER_END(MyPropertyRegister)
// or, you may use this macro for short, at cpp files only
ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(MyClassToAttachTheProperty, MyClassToAttachTheProperty::ClassData()
, Type, "propertyName", ZFPropertyNoInitValue
, public, public
, myCallbackSetterInvoker
, myCallbackGetterInvoker
, myCallbackIsValueAccessed
, myCallbackIsInitValue
, myCallbackValueReset
)
// or, if you simply want to register a raw value,
// you may use ZFPropertyUserRegisterDefaultImplRetain or ZFPropertyUserRegisterDefaultImplAssign as default impl
ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(MyClassToAttachTheProperty, MyClassToAttachTheProperty::ClassData()
, Type, "propertyName", ZFPropertyNoInitValue
, public, public
)
#define ZF_GLOBAL_INITIALIZER_INIT(Name)
see ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL
Definition ZFCoreGlobalInitializer.h:164
#define ZF_GLOBAL_INITIALIZER_DESTROY(Name)
see ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL
Definition ZFCoreGlobalInitializer.h:173
#define ZF_GLOBAL_INITIALIZER_END(Name)
see ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL
Definition ZFCoreGlobalInitializer.h:187
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:192
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
#define ZFLogTrim(...)
see ZFLog
Definition ZFLog.h:80
#define ZFPropertyNoInitValue
see ZFPROPERTY_RETAIN
Definition ZFPropertyDeclare.h:32
#define ZFPropertyUserRegisterRetainDetail(resultProperty, ownerClass, Type, propertyNameString, InitValueOrEmpty, SetterAccessType, GetterAccessType, Func_ZFPropertySetterInvoker, Func_ZFPropertyGetterInvoker, Func_ZFPropertyCallbackIsValueAccessed, Func_ZFPropertyCallbackIsInitValue, Func_ZFPropertyCallbackValueReset)
see ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:560
void ZFPropertyUserUnregister(const ZFProperty *zfproperty)
see ZFPropertyUserRegisterRetain
#define ZFPROPERTY_USER_REGISTER_RETAIN_DETAIL(ownerClassSig, Type, propertyNameSig, InitValueOrEmpty, SetterAccessType, GetterAccessType, Func_ZFPropertySetterInvoker, Func_ZFPropertyGetterInvoker, Func_ZFPropertyCallbackIsValueAccessed, Func_ZFPropertyCallbackIsInitValue, Func_ZFPropertyCallbackValueReset)
see ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:596
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
static void callbackValueReset(const ZFProperty *property, zfany const &ownerObj)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:152
static void setterInvoker(const ZFMethod *method, ZFObject *ownerObj, T_Type const &v)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:62
static T_Type const & getterInvoker(const ZFMethod *method, ZFObject *ownerObj)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:85
static zfbool callbackIsValueAccessed(const ZFProperty *property, zfany const &ownerObj)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:114
static zfbool callbackIsInitValue(const ZFProperty *property, zfany const &ownerObj, zfauto *outInitValue)
default impl for ZFPropertyUserRegisterRetain
Definition ZFPropertyUserRegister.h:123
util method to cast ZFObject types freely
Definition zfany.h:35
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34

note: