18typedef ZFObject *(*_ZFP_ZFObjectConstructor)(void);
20typedef void (*_ZFP_ZFObjectCheckInitImplementationListCallback)(
ZF_IN_OUT ZFClass *cls);
23typedef ZFObject *(*_ZFP_zfAllocCacheCallback)(void);
24typedef void (*_ZFP_zfAllocCacheReleaseCallback)(
ZF_IN ZFObject *obj);
47 && this->
observer() == ref.observer()
48 && this->owner() == ref.owner()
49 && this->observerLevel() == ref.observerLevel()
50 && this->observeAllChildType() == ref.observeAllChildType()
54 return !this->operator == (ref);
119 this->
instanceObserverAdd(param.observer(), param.owner(), param.observerLevel(), param.observeAllChildType());
134 void _ZFP_ZFClass_instanceObserverNotify(
ZF_IN ZFObject *obj)
const;
168 return this->_ZFP_ZFClass_classAliasTo;
175 return this->_ZFP_ZFClass_classNamespace;
181 return this->_ZFP_ZFClass_className;
187 return this->_ZFP_ZFClass_classNameFull;
194 return this->_ZFP_ZFClass_classParent;
211 return this->_ZFP_ZFClass_classIsAbstract;
217 return this->_ZFP_ZFClass_classIsInterface;
228 return this->_ZFP_ZFClass_classIsInternal;
239 return this->_ZFP_ZFClass_classIsInternalPrivate;
253 return this->_ZFP_ZFClass_classCanAllocPublic;
586 ,
ZF_IN const ZFClass *refClass
677 return _ZFP_ZFClass_classNameFull.sigId();
683 static ZFClass *_ZFP_ZFClassRegister(
689 ,
ZF_IN _ZFP_zfAllocCacheCallback objectAllocWithCacheCallback
690 ,
ZF_IN _ZFP_ZFObjectConstructor constructor
691 ,
ZF_IN _ZFP_ZFObjectDestructor destructor
692 ,
ZF_IN _ZFP_ZFObjectCheckInitImplementationListCallback checkInitImplListCallback
697 static void _ZFP_ZFClassUnregister(
ZF_IN const ZFClass *cls);
702 void _ZFP_ZFClass_autoRegister(
void)
const;
703 zfbool _ZFP_ZFClass_interfaceNeedRegister(
void);
704 void _ZFP_ZFClass_interfaceRegister(
707 ,
ZF_IN _ZFP_ZFObjectToInterfaceCastCallback callback
719 zfbool _ZFP_ZFClass_ZFImplementDynamicRegister(
ZF_IN const ZFClass *clsToImplement)
const;
720 void _ZFP_ZFClass_ZFImplementDynamicUnregister(
ZF_IN const ZFClass *clsToImplement)
const;
723 ZFClass *_ZFP_ZFClass_removeConst(
void)
const {
724 return const_cast<ZFClass *
>(
this);
727 void _ZFP_ZFClass_methodRegister(
ZF_IN const ZFMethod *method)
const;
728 void _ZFP_ZFClass_methodUnregister(
ZF_IN const ZFMethod *method)
const;
729 void _ZFP_ZFClass_propertyRegister(
ZF_IN const ZFProperty *zfproperty)
const;
730 void _ZFP_ZFClass_propertyUnregister(
ZF_IN const ZFProperty *zfproperty)
const;
731 void _ZFP_ZFClass_propertyAutoInitRegister(
ZF_IN const ZFProperty *property)
const;
732 void _ZFP_ZFClass_propertyAutoInitAction(
ZF_IN ZFObject *owner)
const;
733 void _ZFP_ZFClass_propertyInitStepRegister(
ZF_IN const ZFProperty *property)
const;
735 _ZFP_zfAllocCacheCallback _ZFP_objectAllocWithCacheCallback(
void)
const;
736 _ZFP_ZFObjectConstructor _ZFP_objectConstructor(
void)
const;
737 _ZFP_ZFObjectDestructor _ZFP_objectDestructor(
void)
const;
738 void _ZFP_classDynamicRegisterObjectInstanceDetach(
ZF_IN ZFObject *obj)
const;
741 _ZFP_ZFClassPrivate *d;
743 const ZFClass *_ZFP_ZFClass_classParent;
747 zfbool _ZFP_ZFClass_classIsAbstract;
748 zfbool _ZFP_ZFClass_classIsInterface;
749 zfbool _ZFP_ZFClass_classIsInternal;
750 zfbool _ZFP_ZFClass_classIsInternalPrivate;
751 zfbool _ZFP_ZFClass_methodAndPropertyCacheNeedUpdate;
753 zfbool _ZFP_ZFClass_implListNeedInit;
754 zfbool _ZFP_ZFClass_classCanAllocPublic;
767#define ZFObjectTagKeyword_newInstanceGenericFailed "_ZFP_NIGFail"
772 _ZFP_ZFClassRegisterHolder(
778 ,
ZF_IN _ZFP_zfAllocCacheCallback objectAllocWithCacheCallback
779 ,
ZF_IN _ZFP_ZFObjectConstructor constructor
780 ,
ZF_IN _ZFP_ZFObjectDestructor destructor
781 ,
ZF_IN _ZFP_ZFObjectCheckInitImplementationListCallback checkInitImplListCallback
786 ~_ZFP_ZFClassRegisterHolder(
void);
843#define ZFClassDataUpdateObserver() (_ZFP_ZFClassDataUpdateObserverRef())
850 return cls->classNameFull();
860#define ZFCoreCriticalClassNotTypeOf(cls, desired) \
861 ZFCoreCriticalMessage("class %s not type of %s", \
862 _ZFP_ZFCoreCriticalClassNotTypeOf::classInfo(cls), \
863 _ZFP_ZFCoreCriticalClassNotTypeOf::classInfo(desired))
867#define ZFCoreCriticalClassNotTypeOfDetail(callerInfo, cls, desired) \
868 ZFCoreCriticalMessageDetail(callerInfo, "class %s not type of %s", \
869 _ZFP_ZFCoreCriticalClassNotTypeOf::classInfo(cls), \
870 _ZFP_ZFCoreCriticalClassNotTypeOf::classInfo(desired))
940#define ZFCONV_REG(dstCls, srcCls) \
941 static zfbool _ZFP_zfconv_##dstCls##_##srcCls(ZF_OUT zfauto &ret, ZF_IN ZFObject *obj); \
942 ZF_STATIC_REGISTER_INIT(zfconv_##dstCls##_##srcCls) { \
943 srcCls::ClassData()->zfconvRegister(dstCls::ClassData(), _ZFP_zfconv_##dstCls##_##srcCls); \
945 ZF_STATIC_REGISTER_DESTROY(zfconv_##dstCls##_##srcCls) { \
946 srcCls::ClassData()->zfconvUnregister(dstCls::ClassData()); \
948 ZF_STATIC_REGISTER_END(zfconv_##dstCls##_##srcCls) \
949 static zfbool _ZFP_zfconv_##dstCls##_##srcCls(ZF_OUT zfauto &ret, ZF_IN ZFObject *obj)
zfbool(* zfconvImpl)(zfauto &ret, ZFObject *obj)
see zfconv
Definition ZFClass.h:15
zfauto zfconv(const zfstring &cls, ZFObject *obj)
object conversion
void ZFClassAliasRemove(const ZFClass *cls, const zfstring &aliasNameFull)
see ZFClassAlias
void ZFClassAlias(const ZFClass *cls, const zfstring &aliasNameFull)
alias class to a new name
zfbool zfconvT(zfauto &ret, const zfstring &cls, ZFObject *obj)
see zfconv
ZFCoreArray< const ZFClass * > ZFClassGetAll(void)
get all class currently registered, for debug use only
Definition ZFClass.h:797
void ZFClassGetAllT(ZFCoreArray< const ZFClass * > &ret)
see ZFClassGetAll
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:192
#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 ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:188
#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_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define zftrue
bool true type
Definition ZFCoreTypeDef_CoreType.h:107
_ZFT_t_zfint zfint
same as int, see zfindex
Definition ZFCoreTypeDef_CoreType.h:165
_zft_zfidentity zfidentity
identity type, ensured at least 32 bit, ensured unsigned
Definition ZFCoreTypeDef_CoreType.h:225
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
#define ZFTOKEN_zfnull
string tokens
Definition ZFCoreTypeDef_OtherType.h:16
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZFCORE_PARAM_DECLARE_SELF(T_self)
see ZFCORE_PARAM
Definition ZFCoreUtilMacro.h:495
#define ZFCORE_PARAM(T_ParamType, paramName,...)
a util macro to generate setter and getter for POD like object
Definition ZFCoreUtilMacro.h:523
ZFLevel
level for logic which depends on order
Definition ZFLevel.h:17
@ ZFLevelAppNormal
app
Definition ZFLevel.h:26
#define ZFMP_DEF()
mark the object as default param
Definition ZFMethodGenericInvoker.h:30
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_END(NameSpace)
end namespace
Definition ZFNamespace.h:60
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
#define ZF_NAMESPACE_BEGIN(NameSpace)
begin namespace
Definition ZFNamespace.h:40
observer types for ZFObject
#define ZFEVENT_GLOBAL(ZFLIB_, YourEvent)
declare a observer event in global scope, see ZFEVENT
Definition ZFObjectObserver.h:369
listener data used by ZFListener
Definition ZFArgs.h:20
ZFObject's class info.
Definition ZFClass.h:66
const ZFMethod * propertySetterForNameIgnoreParent(const zfstring &propertyName) const
try to get property setter method within this class only
void instanceObserverRemoveAll(void) const
see instanceObserverAdd
friend zfauto zfconv(const zfstring &cls, ZFObject *obj)
object conversion
void classTagGetAllKeyValue(ZFCoreArray< zfstring > &allKey, ZFCoreArray< zfauto > &allValue) const
see classTag
void instanceObserverRemove(const ZFListener &observer) const
see instanceObserverAdd
zfbool propertyInitStepExist(void) const
whether the property has ZFPROPERTY_ON_INIT_DECLARE
zfauto newInstanceGenericEnd(void *&token, zfbool objectOnInitMethodInvokeSuccess) const
see newInstance
zfany classDynamicRegisterUserData(void) const
see ZFClassDynamicRegister
zfbool propertyInitStepIsEqual(const ZFProperty *property, const ZFClass *refClass) const
whether two class has same property init step
zfbool dynamicImplementOf(const ZFClass *parent) const
true if this class dynamic implement specified parent by ZFImplementDynamicRegister
zfauto newInstance(void) const
make a new instance of ZFObject dynamically, which is described by ZFClass
const zfstring & classNamespace(void) const
class namespace, null or empty string for global scope class
Definition ZFClass.h:174
void classTagRemove(const zfstring &key) const
see classTag
Definition ZFClass.h:626
void methodGetAllIgnoreParentT(ZFCoreArray< const ZFMethod * > &ret) const
see methodGetAllIgnoreParent
ZFCoreArray< const ZFMethod * > methodForNameGetAll(const zfstring &methodName) const
get all method with name, ignoring method id
Definition ZFClass.h:479
const ZFProperty * propertyForNameIgnoreParent(const zfstring &propertyName) const
get the property by name within this class only, or zfnull if not exists
void propertyGetAllT(ZFCoreArray< const ZFProperty * > &ret) const
see propertyGetAll
const zfstring & classNameFull(void) const
class full name, e.g. "NS0.NS1.YourObject"
Definition ZFClass.h:186
zfindex propertyCount(void) const
get ZFProperty count registered to this class
const ZFMethod * methodForNameIgnoreParent(const zfstring &methodName) const
see methodForNameIgnoreParent
zfany dataCache(const zfstring &key) const
see dataCache
static const ZFClass * classForName(const zfstring &classNameOrFullName)
get class info by name
void methodForNameGetAllIgnoreParentT(ZFCoreArray< const ZFMethod * > &ret, const zfstring &methodName) const
see methodForNameIgnoreParent
ZFCoreArray< const ZFProperty * > propertyGetAll(void) const
get all property, including properties inherited from parent
Definition ZFClass.h:517
ZFCoreArray< const ZFClass * > parentGetAll(void) const
get all parent (parent/interface/dynamicInterface) excluding self, for debug use only
ZFCoreArray< const ZFClass * > childGetAll(void) const
get all child excluding self, for debug use only
zfconvImpl zfconvCheck(const zfstring &dstCls) const
see zfconv
void instanceObserverAdd(const ZFListener &observer, ZFObject *owner=zft_zfnull, ZFLevel observerLevel=ZFLevelAppNormal, zfbool observeAllChildType=_ZFT_t_zftrue) const
add an observer which would be called if any of this class's instance created
void * newInstanceGenericBegin(void) const
see newInstance
void dataCacheRemoveAll(void) const
see dataCache
zfbool classCanAllocPublic(void) const
whether the class can alloc directly, see ZFOBJECT_PRIVATE_ALLOC
Definition ZFClass.h:252
zfconvImpl zfconvCheck(const ZFClass *dstCls) const
see zfconv
void dataCacheRemove(const zfstring &key) const
see dataCache
Definition ZFClass.h:663
zfiter propertyIter(void) const
see zfiter
const ZFMethod * methodForName(const zfstring &methodName) const
see methodForName
const zfstring & className(void) const
class name, e.g. "ZFObject"
Definition ZFClass.h:180
zfauto newInstance(ZFObject *param0, ZFObject *param1=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param2=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param3=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param4=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param5=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param6=((ZFObject *const &) _ZFP_ZFMP_DEF), ZFObject *param7=((ZFObject *const &) _ZFP_ZFMP_DEF)) const
for advanced reflection use only
static const ZFClass * classForName(const zfstring &className, const zfstring &classNamespace)
find class with explicit namespace, see classForName
ZFCoreArray< const ZFProperty * > propertyGetAllIgnoreParent(void) const
get all property, including properties inherited from parent
Definition ZFClass.h:506
zfauto dataCacheRemoveAndGet(const zfstring &key) const
see dataCache
void instanceObserverAdd(const ZFClassInstanceObserverAddParam ¶m) const
see instanceObserverAdd
Definition ZFClass.h:118
zfbool classIsInternalPrivate(void) const
whether the class is internal private class
Definition ZFClass.h:238
ZFCoreArray< const ZFMethod * > methodGetAll(void) const
get all method, including methods inherited from parent
Definition ZFClass.h:408
friend zfauto zfconv(const ZFClass *cls, ZFObject *obj)
see zfconv
ZFCoreArray< const ZFMethod * > methodForNameGetAllIgnoreParent(const zfstring &methodName) const
see methodForNameIgnoreParent
Definition ZFClass.h:445
const ZFClass * implementedInterfaceAt(zfindex index) const
get implemented interface, see dynamicInterfaceAt
friend zfbool zfconvT(zfauto &ret, const zfstring &cls, ZFObject *obj)
see zfconv
void dataCache(const zfstring &key, ZFObject *tag) const
store class meta data cache, internal use only
zfauto newInstanceDetail(const ZFCoreArray< zfauto > ¶ms, zfbool *success=zft_zfnull, zfstring *errorHint=zft_zfnull) const
see newInstance
zfstring objectInfo(void) const
return object info
Definition ZFClass.h:142
const ZFMethod * propertyGetterForName(const zfstring &propertyName) const
try to get property getter method
const ZFMethod * methodIterValue(const zfiter &it) const
see zfiter
const ZFMethod * methodForNameIgnoreParent(const zfstring &methodName, const zfchar *paramTypeId0, const zfchar *paramTypeId1=zft_zfnull, const zfchar *paramTypeId2=zft_zfnull, const zfchar *paramTypeId3=zft_zfnull, const zfchar *paramTypeId4=zft_zfnull, const zfchar *paramTypeId5=zft_zfnull, const zfchar *paramTypeId6=zft_zfnull, const zfchar *paramTypeId7=zft_zfnull) const
get the method by name within this class only, or zfnull if not exists
void zfconvRegister(const ZFClass *dstCls, zfconvImpl impl) const
see zfconv
zfbool classIsTypeOf(const ZFClass *cls) const
true if class is subclass of cls, or implement cls
zfany classTag(const zfstring &key) const
see classTag
void instanceObserverRemoveByOwner(ZFObject *owner) const
see instanceObserverAdd
void objectInfoOfInheritTreeT(zfstring &ret) const
see objectInfoOfInheritTree
zfiter methodIter(void) const
see zfiter
const ZFCoreArray< zfstring > & classAliasTo(void) const
see ZFClassAlias
Definition ZFClass.h:167
void classTag(const zfstring &key, ZFObject *tag) const
set a classTag for the class, internal use only
zfbool newInstanceGenericCheck(void *&token, const ZFMethod *objectOnInitMethod, const ZFArgs &zfargs) const
see newInstance
const ZFMethod * propertySetterForName(const zfstring &propertyName) const
try to get property setter method
void zfconvUnregister(const ZFClass *dstCls) const
see zfconv
zfindex dynamicInterfaceCount(void) const
get dynamic interface registered by ZFImplementDynamicRegister, see implementedInterfaceAt
zfbool propertyInitStepExist(const ZFProperty *property) const
whether the property has ZFPROPERTY_ON_INIT_DECLARE
zfstring objectInfoOfInheritTree(void) const
return a string describe the class inherit tree, debug use only
Definition ZFClass.h:153
const ZFClass * classParent(void) const
class's parent, zfnull if none
Definition ZFClass.h:193
void classTagRemoveAll(void) const
see classTag
zfbool classIsAbstract(void) const
true if the class is abstract class
Definition ZFClass.h:210
void dataCacheGetAllKeyValue(ZFCoreArray< zfstring > &allKey, ZFCoreArray< zfauto > &allValue) const
see dataCache
void propertyGetAllIgnoreParentT(ZFCoreArray< const ZFProperty * > &ret) const
see propertyGetAllIgnoreParent
const ZFProperty * propertyIterValue(const zfiter &it) const
see zfiter
const ZFMethod * methodForName(const zfstring &methodName, const zfchar *paramTypeId0, const zfchar *paramTypeId1=zft_zfnull, const zfchar *paramTypeId2=zft_zfnull, const zfchar *paramTypeId3=zft_zfnull, const zfchar *paramTypeId4=zft_zfnull, const zfchar *paramTypeId5=zft_zfnull, const zfchar *paramTypeId6=zft_zfnull, const zfchar *paramTypeId7=zft_zfnull) const
get the method by name hierarchically from class inherit tree, or zfnull if not exists
zfidentity classId(void) const
a unique id that represents the class
Definition ZFClass.h:676
const ZFProperty * propertyForName(const zfstring &propertyName) const
get the property by name hierarchically from class inherit tree, or zfnull if not exists
const ZFClass * dynamicInterfaceAt(zfindex index) const
get dynamic interface registered by ZFImplementDynamicRegister, see implementedInterfaceAt
zfauto classTagRemoveAndGet(const zfstring &key) const
see classTag
zfbool classIsDynamicRegister(void) const
true if class is registered by ZFClassDynamicRegister
zfbool classIsInternal(void) const
whether the class is internal class
Definition ZFClass.h:227
zfindex implementedInterfaceCount(void) const
get implemented interface count, see dynamicInterfaceAt
void methodGetAllT(ZFCoreArray< const ZFMethod * > &ret) const
see methodGetAll
zfbool classIsInterface(void) const
true if the class is an interface
Definition ZFClass.h:216
const ZFMethod * propertyGetterForNameIgnoreParent(const zfstring &propertyName) const
try to get property getter method within this class only
zfindex methodCount(void) const
get the count of method registered to this ZFClass
void objectInfoT(zfstring &ret) const
see objectInfo
ZFCoreArray< const ZFMethod * > methodGetAllIgnoreParent(void) const
get all method, excluding methods inherited from parent
Definition ZFClass.h:397
void methodForNameGetAllT(ZFCoreArray< const ZFMethod * > &ret, const zfstring &methodName) const
see methodForNameGetAll
friend zfbool zfconvT(zfauto &ret, const ZFClass *cls, ZFObject *obj)
see zfconv
see ZFClass::instanceObserverAdd
Definition ZFClass.h:28
ZFLevel & observerLevel(void)
see ZFClass::instanceObserverAdd
Definition ZFClass.h:38
zfbool & observeAllChildType(void)
see ZFClass::instanceObserverAdd
Definition ZFClass.h:41
ZFListener & observer(void)
see ZFClass::instanceObserverAdd
Definition ZFClass.h:32
zfany & owner(void)
see ZFClass::instanceObserverAdd
Definition ZFClass.h:35
light weight array
Definition ZFCoreArray.h:331
dummy base of interface types
Definition ZFObjectInterface.h:250
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
reflectable method for ZFObject
Definition ZFMethod.h:252
base class of all objects
Definition ZFObjectCore.h:209
holder object for observer logic, see ZFObject::observerNotify
Definition ZFObjectObserver.h:147
info for a property for ZFObject, see ZFPROPERTY_RETAIN for more info
Definition ZFProperty.h:28
readonly string container for internal use only
Definition ZFSigName.h:17
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
iterator for ZFFramework
Definition zfiter.h:40
smart pointer for ZFObject