19typedef ZFObject *(*_ZFP_ZFObjectConstructor)(void);
21typedef void (*_ZFP_ZFObjectCheckInitImplementationListCallback)(
ZF_IN_OUT ZFClass *cls);
24typedef ZFObject *(*_ZFP_zfAllocCacheCallback)(void);
25typedef void (*_ZFP_zfAllocCacheReleaseCallback)(
ZF_IN ZFObject *obj);
48 && this->
observer() == ref.observer()
49 && this->owner() == ref.owner()
50 && this->observerLevel() == ref.observerLevel()
51 && this->observeAllChildType() == ref.observeAllChildType()
55 return !this->operator == (ref);
120 this->
instanceObserverAdd(param.observer(), param.owner(), param.observerLevel(), param.observeAllChildType());
135 void _ZFP_ZFClass_instanceObserverNotify(
ZF_IN ZFObject *obj)
const;
169 return this->_ZFP_ZFClass_classAliasTo;
176 return this->_ZFP_ZFClass_classNamespace;
182 return this->_ZFP_ZFClass_className;
188 return this->_ZFP_ZFClass_classNameFull;
195 return this->_ZFP_ZFClass_classParent;
212 return this->_ZFP_ZFClass_classIsAbstract;
218 return this->_ZFP_ZFClass_classIsInterface;
229 return this->_ZFP_ZFClass_classIsInternal;
240 return this->_ZFP_ZFClass_classIsInternalPrivate;
254 return this->_ZFP_ZFClass_classCanAllocPublic;
587 ,
ZF_IN const ZFClass *refClass
663 return _ZFP_ZFClass_classNameFull.sigId();
669 static ZFClass *_ZFP_ZFClassRegister(
675 ,
ZF_IN _ZFP_zfAllocCacheCallback objectAllocWithCacheCallback
676 ,
ZF_IN _ZFP_ZFObjectConstructor constructor
677 ,
ZF_IN _ZFP_ZFObjectDestructor destructor
678 ,
ZF_IN _ZFP_ZFObjectCheckInitImplementationListCallback checkInitImplListCallback
683 static void _ZFP_ZFClassUnregister(
ZF_IN const ZFClass *cls);
688 void _ZFP_ZFClass_autoRegister(
void)
const;
689 zfbool _ZFP_ZFClass_interfaceNeedRegister(
void);
690 void _ZFP_ZFClass_interfaceRegister(
693 ,
ZF_IN _ZFP_ZFObjectToInterfaceCastCallback callback
705 zfbool _ZFP_ZFClass_ZFImplementDynamicRegister(
ZF_IN const ZFClass *clsToImplement)
const;
706 void _ZFP_ZFClass_ZFImplementDynamicUnregister(
ZF_IN const ZFClass *clsToImplement)
const;
709 ZFClass *_ZFP_ZFClass_removeConst(
void)
const {
710 return const_cast<ZFClass *
>(
this);
713 void _ZFP_ZFClass_methodRegister(
ZF_IN const ZFMethod *method)
const;
714 void _ZFP_ZFClass_methodUnregister(
ZF_IN const ZFMethod *method)
const;
715 void _ZFP_ZFClass_propertyRegister(
ZF_IN const ZFProperty *zfproperty)
const;
716 void _ZFP_ZFClass_propertyUnregister(
ZF_IN const ZFProperty *zfproperty)
const;
717 void _ZFP_ZFClass_propertyAutoInitRegister(
ZF_IN const ZFProperty *property)
const;
718 void _ZFP_ZFClass_propertyAutoInitAction(
ZF_IN ZFObject *owner)
const;
719 void _ZFP_ZFClass_propertyInitStepRegister(
ZF_IN const ZFProperty *property)
const;
721 _ZFP_zfAllocCacheCallback _ZFP_objectAllocWithCacheCallback(
void)
const;
722 _ZFP_ZFObjectConstructor _ZFP_objectConstructor(
void)
const;
723 _ZFP_ZFObjectDestructor _ZFP_objectDestructor(
void)
const;
724 void _ZFP_classDynamicRegisterObjectInstanceDetach(
ZF_IN ZFObject *obj)
const;
727 _ZFP_ZFClassPrivate *d;
729 const ZFClass *_ZFP_ZFClass_classParent;
733 zfbool _ZFP_ZFClass_classIsAbstract;
734 zfbool _ZFP_ZFClass_classIsInterface;
735 zfbool _ZFP_ZFClass_classIsInternal;
736 zfbool _ZFP_ZFClass_classIsInternalPrivate;
737 zfbool _ZFP_ZFClass_methodAndPropertyCacheNeedUpdate;
739 zfbool _ZFP_ZFClass_implListNeedInit;
740 zfbool _ZFP_ZFClass_classCanAllocPublic;
753#define ZFObjectTagKeyword_newInstanceGenericFailed "_ZFP_NIGFail"
758 _ZFP_ZFClassRegisterHolder(
764 ,
ZF_IN _ZFP_zfAllocCacheCallback objectAllocWithCacheCallback
765 ,
ZF_IN _ZFP_ZFObjectConstructor constructor
766 ,
ZF_IN _ZFP_ZFObjectDestructor destructor
767 ,
ZF_IN _ZFP_ZFObjectCheckInitImplementationListCallback checkInitImplListCallback
772 ~_ZFP_ZFClassRegisterHolder(
void);
829#define ZFClassDataUpdateObserver() (_ZFP_ZFClassDataUpdateObserverRef())
836 return cls->classNameFull();
846#define ZFCoreCriticalClassNotTypeOf(cls, desired) \
847 ZFCoreCriticalMessage("class %s not type of %s", \
848 _ZFP_ZFCoreCriticalClassNotTypeOf::classInfo(cls), \
849 _ZFP_ZFCoreCriticalClassNotTypeOf::classInfo(desired))
853#define ZFCoreCriticalClassNotTypeOfDetail(callerInfo, cls, desired) \
854 ZFCoreCriticalMessageDetail(callerInfo, "class %s not type of %s", \
855 _ZFP_ZFCoreCriticalClassNotTypeOf::classInfo(cls), \
856 _ZFP_ZFCoreCriticalClassNotTypeOf::classInfo(desired))
void ZFClassAliasRemove(const ZFClass *cls, const zfstring &aliasNameFull)
see ZFClassAlias
void ZFClassAlias(const ZFClass *cls, const zfstring &aliasNameFull)
alias class to a new name
ZFCoreArray< const ZFClass * > ZFClassGetAll(void)
get all class currently registered, for debug use only
Definition ZFClass.h:783
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 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:67
const ZFMethod * propertySetterForNameIgnoreParent(const zfstring &propertyName) const
try to get property setter method within this class only
void instanceObserverRemoveAll(void) const
see instanceObserverAdd
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:175
void classTagRemove(const zfstring &key) const
see classTag
Definition ZFClass.h:612
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:480
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:187
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:518
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
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:253
void dataCacheRemove(const zfstring &key) const
see dataCache
Definition ZFClass.h:649
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:181
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:507
zfauto dataCacheRemoveAndGet(const zfstring &key) const
see dataCache
void instanceObserverAdd(const ZFClassInstanceObserverAddParam ¶m) const
see instanceObserverAdd
Definition ZFClass.h:119
zfbool classIsInternalPrivate(void) const
whether the class is internal private class
Definition ZFClass.h:239
ZFCoreArray< const ZFMethod * > methodGetAll(void) const
get all method, including methods inherited from parent
Definition ZFClass.h:409
ZFCoreArray< const ZFMethod * > methodForNameGetAllIgnoreParent(const zfstring &methodName) const
see methodForNameIgnoreParent
Definition ZFClass.h:446
const ZFClass * implementedInterfaceAt(zfindex index) const
get implemented interface, see dynamicInterfaceAt
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:143
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
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:168
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
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:154
const ZFClass * classParent(void) const
class's parent, zfnull if none
Definition ZFClass.h:194
void classTagRemoveAll(void) const
see classTag
zfbool classIsAbstract(void) const
true if the class is abstract class
Definition ZFClass.h:211
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:662
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:228
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:217
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:398
void methodForNameGetAllT(ZFCoreArray< const ZFMethod * > &ret, const zfstring &methodName) const
see methodForNameGetAll
see ZFClass::instanceObserverAdd
Definition ZFClass.h:29
ZFLevel & observerLevel(void)
see ZFClass::instanceObserverAdd
Definition ZFClass.h:39
zfbool & observeAllChildType(void)
see ZFClass::instanceObserverAdd
Definition ZFClass.h:42
ZFListener & observer(void)
see ZFClass::instanceObserverAdd
Definition ZFClass.h:33
zfany & owner(void)
see ZFClass::instanceObserverAdd
Definition ZFClass.h:36
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