ZFFramework
 
Loading...
Searching...
No Matches
ZFObject Class Reference

base class of all objects More...

#include <ZFObjectCore.h>

Inheritance diagram for ZFObject:
ZFAudio ZFAutoReleasePool ZFBase64 ZFCache ZFCompress ZFContainer ZFCurve ZFDI_WrapperBase ZFDecompress ZFHttpRequest ZFHttpResponse ZFHttpServer ZFHttpServerTask ZFIOBuffer ZFImpl_ZFLuaValue ZFKeyValueContainer ZFLogFormat ZFMutex ZFObjectHolder ZFRegExp ZFSemaphore ZFState ZFStyle ZFTask ZFTaskIdBasic ZFTcp ZFTestCase ZFThread ZFThreadPool ZFTime ZFTimer ZFUICellAdapterBasicParam ZFUIEvent ZFUIHint ZFUIImageViewExt ZFUIKeyboardState ZFUIOnScreenKeyboardState ZFUIPage ZFUIPageManager ZFUIScrollerDefault ZFUISysWindow ZFUIViewMeasureResult ZFUIWebJSBridge ZFUdp ZFValueHolder ZFWebSocket

Public Types

enum  
 

Public Member Functions

virtual const ZFClassclassData (void)
 get instance's class info
 
zfindex objectRetainCount (void)
 return the object's retain count
 
void objectInfoOfInstanceT (zfstring &ret)
 see objectInfoOfInstance
 
zfstring objectInfoOfInstance (void)
 return a short string describe the object instance
 
void objectInfoT (zfstring &ret)
 see objectInfo
 
zfstring objectInfo (void)
 return object info
 
zfidentity objectHash (void)
 get hash of this object
 
ZFCompareResult objectCompare (ZFObject *anotherObj)
 compare with anotherObj
 
ZFCompareResult objectCompareValue (ZFObject *anotherObj)
 explicitly compare object by logical value, see objectCompare
 
virtual zfauto invoke (const zfstring &methodName)
 util method to perform ZFDI_invoke, do nothing if fail
 
virtual zfauto invoke (const zfstring &methodName, 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))
 util method to perform ZFDI_invoke, do nothing if fail
 
virtual zfbool invokeT (zfauto &ret, zfstring *errorHint, const zfstring &methodName, ZFObject *param0=((ZFObject *const &) _ZFP_ZFMP_DEF), 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))
 util method to perform ZFDI_invoke, do nothing if fail
 
virtual zfauto invokeDetail (const zfstring &methodName, const ZFCoreArray< zfauto > &params, zfbool *success=zft_zfnull, zfstring *errorHint=zft_zfnull)
 util method to perform ZFDI_invoke, do nothing if fail
 
zfbool objectTagExist (void)
 see objectTag, true if this object has tag, and tag can be checked by objectTagGetAllKeyValue
 
void objectTag (const zfstring &key, ZFObject *tag)
 used to hold a object for app's use, auto retained
 
zfany objectTag (const zfstring &key)
 see objectTag
 
void objectTagGetAllKeyValue (ZFCoreArray< zfstring > &allKey, ZFCoreArray< zfauto > &allValue)
 get all key value
 
void objectTagRemove (const zfstring &key)
 remove tag, same as set tag to null
 
zfauto objectTagRemoveAndGet (const zfstring &key)
 remove tag, return removed tag or null if not exist
 
void objectTagRemoveAll (void)
 remove all tag
 
void observerAdd (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 see observerNotify
 
void observerAddForOnce (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 see observerNotify
 
void observerRemove (zfidentity eventId, const ZFListener &callback)
 see observerNotify
 
void observerRemoveAll (zfidentity eventId)
 see observerNotify
 
void observerRemoveAll (void)
 see observerNotify
 
zfbool observerHasAdd (void)
 true if any observer has been added
 
zfbool observerHasAdd (zfidentity eventId)
 true if any observer with eventId has been added
 
void observerNotify (zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
 notify the observer with eventId
 
void observerNotifyWithSender (ZFObject *customSender, zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
 see observerNotify
 
void observerNotifyReversely (zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
 see observerNotify
 
void observerNotifyReverselyWithSender (ZFObject *customSender, zfidentity eventId, ZFObject *param0=zft_zfnull, ZFObject *param1=zft_zfnull)
 see observerNotify
 
ZFObserverobserverHolder (void)
 access the internal observer holder
 
void on (const zfstring &eventName, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 util to observerAdd
 
void on (zfidentity eventId, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
 util to observerAdd
 
void onInit (const ZFListener &impl)
 util for script to achieve chained call
 
void onDealloc (const ZFListener &impl)
 util for script to achieve chained call
 
zfbool objectInstanceStateCheck (ZFObjectInstanceState state)
 object instance's state
 
zfbool objectInitRunning (void)
 util method to check whether ZFObjectInstanceStateOnInit or ZFObjectInstanceStateOnInitFinish running
 
zfbool objectDeallocRunning (void)
 util method to check whether ZFObjectInstanceStateOnDeallocPrepare or ZFObjectInstanceStateOnDealloc running
 
virtual zfbool objectIsInternal (void)
 whether this object is internal object or its class is ZFClass::classIsInternal
 
virtual zfbool objectIsInternalPrivate (void)
 whether this object is internal private object or its class is ZFClass::classIsInternalPrivate
 

Static Public Member Functions

static const ZFClassClassData (void)
 get class info
 
static zfidentity E_ObjectBeforeAlloc (void)
 see ZFObject::observerNotify
 
static zfidentity E_ObjectAfterAlloc (void)
 see ZFObject::observerNotify
 
static zfidentity E_ObjectBeforeDealloc (void)
 see ZFObject::observerNotify
 
static zfidentity E_ObjectPropertyValueOnUpdate (void)
 see ZFObject::observerNotify
 
static zfidentity E_ObjectPropertyValueOnReset (void)
 see ZFObject::observerNotify
 

Protected Types

typedef _ZFP_Obj_Base zfsuper
 class ref to super
 
typedef ZFObject zfself
 class ref to self
 

Protected Member Functions

virtual void objectInfoImpl (zfstring &ret)
 see objectInfo
 
virtual void objectInfoImplAppend (zfstring &ret)
 see objectInfo
 
virtual zfidentity objectHashImpl (void)
 see objectHash
 
virtual ZFCompareResult objectCompareImpl (ZFObject *anotherObj)
 see objectCompare
 
virtual ZFCompareResult objectCompareValueImpl (ZFObject *anotherObj)
 see objectCompareValue
 
virtual void observerOnAdd (zfidentity eventId)
 called when add first observer
 
virtual void observerOnRemove (zfidentity eventId)
 called when remove last observer
 
virtual void observerOnEvent (const ZFArgs &zfargs)
 notified when observerNotify
 
virtual void objectOnInit (void)
 override this to init your object
 
virtual void objectOnInitFinish (void)
 called after objectOnInit, safe to call virtual functions here
 
virtual void objectOnDeallocPrepare (void)
 called before objectOnDealloc, safe to call virtual functions here
 
virtual void objectOnDealloc (void)
 override this to destroy your object
 
virtual void objectOnRetain (void)
 called to retain object
 
virtual void objectOnRelease (void)
 called to release object
 
virtual void objectPropertyValueOnUpdate (const ZFProperty *property, const void *oldValue)
 see E_ObjectPropertyValueOnUpdate
 
virtual void objectPropertyValueOnReset (const ZFProperty *property)
 see E_ObjectPropertyValueOnReset
 

Friends

class ZFClass
 
class ZFObserver
 

Detailed Description

base class of all objects

  • ZFObject is a Object-C-like class, using objectRetainCount to manage memory:
    ZFObject *myObj = zfAlloc(ZFObject); // objectRetainCount = 1
    anotherObj = zfRetain(myObj); // objectRetainCount = 2
    zfRelease(myObj); // objectRetainCount = 1
    zfRelease(anotherObject); // objectRetainCount = 0, delete
    #define zfRelease(obj)
    release an object, see ZFObject
    Definition ZFObjectRetain.h:148
    #define zfAlloc(T_ZFObject,...)
    alloc an object, see ZFObject
    Definition ZFObjectRetain.h:104
    #define zfRetain(obj)
    retain an object, see ZFObject
    Definition ZFObjectRetain.h:128
    you should always use zfAlloc to create a ZFObject or its subclass, and use zfRetain and zfRelease to manage memory
    See also
    zfRetain, zfRelease, ZFAutoReleasePool
    ADVANCED:
    we are trying hard to simulate the autorelease in Object-C world:
    • zfautoRelease: the most powerful and most similar one to autorelease in Object-C, however it depends on ZFThread, so most of functions won't use this to return a autoreleased object, see zfautoRelease for more info
    • ZFAutoReleasePool: similar to NSAutoReleasePool, release after pool release, zfautoRelease depends on it, and all ZFThread has a pool internally
    • zflineRelease: release after code line end, usually used for temporary object
    • zflineAlloc: same as zflineRelease(zfAlloc(...)) defined for short
    • zfblockedRelease: release after nearest code block
    • zfobj: declare a ZFObject which looks like allocated in stack, would be released after nearest code block
    • zfauto: declare a holder object which would release its content ZFObject when destroyed, much like the auto_ptr in C++ world
  • when inherit from ZFObject, you must add ZFOBJECT_DECLARE or ZFOBJECT_DECLARE_ABSTRACT to your subclass, and use zfextend:
    zfclass YourClassChild : zfextend YourClassBase {
    ZFOBJECT_DECLARE(YourClassChild, YourClassBase)
    // or ZFOBJECT_DECLARE_ABSTRACT if YourClassChild is abstract class
    };
    #define zfextend
    dummy macro shows class inherit from another
    Definition ZFCoreTypeDef_ClassType.h:53
    #define zfclass
    same as class, shows that this class is a ZFObject type
    Definition ZFObjectClassTypeFwd.h:38
    #define ZFOBJECT_DECLARE(ChildClass, SuperClass,...)
    necessary for every class inherit from ZFObject
    Definition ZFObjectDeclare.h:126
    and, no multiple inheritance is allowed while using ZFObject
    additionally, you should add ZFOBJECT_REGISTER if you want the ZFClass map function
    See also
    ZFOBJECT_DECLARE, zfextend
  • nested inner class or interface can be declared, however, (ZFTAG_LIMITATION) you must make sure outer class is declared
    zfclass YourOuterClass : zfextend ZFObject {
    ZFOBJECT_DECLARE(YourOuterClass, ZFObject)
    zfclass YourInnerClass : zfextend ZFObject {
    ZFOBJECT_DECLARE(YourInnerClass, ZFObject, YourOuterClass) // <= note for the outer class
    };
    zfinterface YourInnerInterface : zfextend ZFInterface {
    ZFINTERFACE_DECLARE(YourInnerClass, ZFInterface, YourOuterClass) // <= note for the outer class
    };
    };
    #define zfinterface
    shows the type is an interface, see ZFInterface
    Definition ZFObjectInterface.h:20
    #define ZFINTERFACE_DECLARE(InterfaceName, ParentInterface,...)
    see ZFInterface
    Definition ZFObjectInterface.h:100
    dummy base of interface types
    Definition ZFObjectInterface.h:250
  • when inherit from ZFObject, member method is recommended declared as virtual method, unless you do want to prevent subclass to override, at this case, use zffinal to mark the method is final and subclass should not try to override or shadow it
  • ZFObject use objectOnInit and objectOnDealloc to init and destory object, instead of constructors and destructors, for how to use it in subclass, see objectOnInit
  • while override member method of ZFObject type, you should use zfsuper to call super's method:
    zfclass YourClass : zfextend Parent {
    ZFOBJECT_DECLARE(YourClass, Parent)
    public:
    virtual void funcInParent(void) {
    // override and call super's method by zfsuper
    zfsuper::funcInParent();
    }
    };
    #define zfoverride
    dummy macro shows that method override parent's method
    Definition ZFCoreTypeDef_ClassType.h:58
    if overrided method is declared in super interface, you should use zfsuperI:
    zfclass Parent : zfextend ZFObject, zfimplement ParentInterface0 {
    ZFOBJECT_DECLARE(Parent, ZFObject)
    ZFIMPLEMENT_DECLARE(ParentInterface0)
    public:
    virtual void funcInParentInterface0(void) {
    // would call ParentInterface0::funcInParentInterface0
    zfsuperI(ParentInterface0)::funcInParentInterface0();
    }
    };
    zfclass YourClass : zfextend Parent, zfimplement ParentInterface1 {
    ZFOBJECT_DECLARE(YourClass, Parent)
    ZFIMPLEMENT_DECLARE(ParentInterface1)
    public:
    virtual void funcInParentInterface0(void) {
    // would call Parent::funcInParentInterface0
    zfsuperI(ParentInterface0)::funcInParentInterface0();
    }
    virtual void funcInParentInterface1(void) {
    // would call ParentInterface1::funcInParentInterface1
    zfsuperI(ParentInterface1)::funcInParentInterface1();
    }
    };
    #define zfsuperI(T_SuperType)
    class ref to proper super type, see ZFObject for more info
    Definition ZFObjectDeclare.h:26
    #define ZFIMPLEMENT_DECLARE(ImplementedInterfaces,...)
    see ZFINTERFACE_DECLARE
    Definition ZFObjectInterface.h:169
    #define zfimplement
    shows class implement from interface, see ZFInterface
    Definition ZFObjectInterface.h:24
  • (ZFTAG_LIMITATION) due to some limitation, you should always use ZFObject as a pointer but without const qualifier
  • you can access class info by:
    YourClass::ClassData();
    yourClassInstance->classData();
    static const ZFClass * classForName(const zfstring &classNameOrFullName)
    get class info by name
  • ZFObject is synchronizable object, you can make it mutable by:
    {
    // mutable operation
    }
    #define zfsynchronize(obj)
    similar to synchronized in Java
    Definition zfsynchronize.h:37
    for advanced mutable operation, use ZFMutex instead
    for global mutable operation, use ZFCoreMutexLock instead


ADVANCED:
we use macros everywhere to achieve goals, there are many types and functions and whatever-it-is, which are generated by macros and are private, you should never ever access it in your code
here's a list or them:

  • "_ZFP_*": shows it's private (maybe types or functions or anything)
  • "_ZFI_*": conditional code wrappers
  • "_ZFT_*": conditional type defines, must not be accessed by codes, but can be modified by adding precompile flags (usually have no need, and modify at your own risk)

Member Function Documentation

◆ classData()

virtual const ZFClass * ZFObject::classData ( void )
inlinevirtual

get instance's class info

Reimplemented in v_ZFAniForNativeCurve, v_ZFArgs, v_ZFBezier, v_zfbool, v_zfboolHolder, v_zfbyte, v_ZFCallback, v_ZFCallbackType, v_ZFCallerInfo, v_zfchar, v_ZFClass, v_ZFClassDataUpdateData, v_ZFClassDataUpdateType, v_ZFClassInstanceObserverAddParam, v_ZFComparer_ZFObject, v_ZFCompareResult, v_ZFCompressLevel, v_ZFCoreArray, v_zfdouble, v_ZFDynamic, v_ZFEnvDeviceUIType, v_ZFFileFindData, v_ZFFileOpenOption, v_ZFFilterForIdentity, v_ZFFilterForIndex, v_ZFFilterForNumber, v_ZFFilterForString, v_ZFFilterForZFClass, v_ZFFilterForZFClassType, v_ZFFilterForZFMethod, v_ZFFilterForZFObject, v_ZFFilterForZFProperty, v_ZFFilterResult, v_ZFFilterType, v_zfflags, v_zffloat, v_ZFFrameworkState, v_ZFFuncAddrType, v_ZFHttpMethod, v_zfidentity, v_ZFIdentityGenerator, v_zfindex, v_ZFIndexRange, v_zfint, v_zfiter, v_ZFJson, v_ZFJsonOutputToken, v_ZFJsonType, v_ZFLevel, v_ZFLogLevel, v_zflong, v_ZFMethod, v_ZFMethodAccessType, v_ZFMethodDynamicRegisterParam, v_ZFMethodGenericInvoker, v_ZFMethodType, v_ZFMP, v_ZFObjectInstanceState, v_ZFObserver, v_ZFObserverGroup, v_ZFOutputFormatStep, v_ZFPathInfo, v_ZFPathInfoImpl, v_ZFProperty, v_ZFPropertyCallbackDynamicRegisterInitValueGetter, v_ZFPropertyDynamicRegisterParam, v_ZFProtocol, v_ZFProtocolImplInfo, v_ZFProtocolInstanceState, v_ZFProtocolLevel, v_zfptr, v_ZFRegExpOption, v_ZFRegExpResult, v_ZFResultType, v_ZFSDOutputToken, v_ZFSeekPos, v_ZFSerializableData, v_ZFSerializablePropertyType, v_zfstring, v_ZFStringEncoding, v_ZFTcpType, v_ZFTextTemplateIndexData, v_ZFTextTemplateIndexFlag, v_ZFTextTemplateParam, v_ZFTextTemplateRunParam, v_ZFTimeInfo, v_zftimet, v_ZFTimeValue, v_ZFTokenForContainer, v_ZFTokenForKeyValueContainer, v_ZFUdpAddr, v_ZFUIAlign, v_ZFUIAutoLayoutPos, v_ZFUIAutoLayoutRule, v_ZFUIButtonGroupType, v_ZFUIButtonState, v_ZFUICellUpdaterParam, v_ZFUIColor, v_ZFUIImageImplNinePatchPos, v_ZFUIImageStateImplAction, v_ZFUIKeyAction, v_ZFUIKeyCode, v_ZFUIMargin, v_ZFUIMouseAction, v_ZFUIMouseButton, v_zfuint, v_ZFUIOrientation, v_ZFUIPagePauseReason, v_ZFUIPageResumeReason, v_ZFUIPoint, v_ZFUIRect, v_ZFUIScaleType, v_ZFUIScrollViewState, v_ZFUISize, v_ZFUISizeParam, v_ZFUISizeType, v_ZFUITextAppearance, v_ZFUITextEditKeyboardReturnAction, v_ZFUITextEditKeyboardReturnType, v_ZFUITextEditKeyboardType, v_ZFUITextTruncateMode, v_ZFUITransform, v_ZFUIViewBlinkParam, v_ZFUIViewChildLayer, v_ZFUIViewFocusNextParam, v_ZFUIWindowLevel, v_zfulong, v_zfweak, v_ZFXml, v_ZFXmlOutputToken, v_ZFXmlType, ZFAniForFrame, ZFAniForGeneric, ZFAniForImpl, ZFAniForNative, ZFAniForTimer, ZFAniGroup, ZFAnimation, ZFAniQueue, ZFAniTask, ZFArray, ZFAsyncIOCustomTask, ZFAsyncIOTask, ZFAsyncTask, ZFAudio, ZFAudioCache, ZFAudioPlayTask, ZFAutoReleasePool, ZFBase64, ZFCache, ZFCompress, ZFContainer, ZFCurve, ZFCurveBackIn, ZFCurveBackInOut, ZFCurveBackOut, ZFCurveBounceIn, ZFCurveBounceInOut, ZFCurveBounceOut, ZFCurveEaseIn, ZFCurveEaseInOut, ZFCurveEaseOut, ZFCurveLinear, ZFCurveLoop, ZFCurveLoopBackIn, ZFCurveLoopBackInOut, ZFCurveLoopBackOut, ZFCurveLoopBounceIn, ZFCurveLoopBounceInOut, ZFCurveLoopBounceOut, ZFCurveLoopEaseIn, ZFCurveLoopEaseInOut, ZFCurveLoopEaseOut, ZFCurveLoopLinear, ZFDecompress, ZFDI_Wrapper, ZFDI_WrapperBase, ZFDI_WrapperRaw, ZFEnum, ZFHashMap, ZFHashSet, ZFHttpRequest, ZFHttpResponse, ZFHttpServer, ZFHttpServerTask, ZFHttpServerThreadPool, ZFImpl_ZFLuaValue, ZFIOBuffer, ZFIOBufferByCacheFile, ZFIOBufferByMemory, ZFIOCache, ZFIOCacheLoadTask, ZFKeyValueContainer, ZFLogFormat, ZFMap, ZFMutex, ZFObjectHolder, ZFOutputFormatBasic, ZFPostTask, ZFRegExp, ZFResCache, ZFSemaphore, ZFSet, ZFState, ZFStyle, ZFStyleList, ZFTask, ZFTaskGroup, ZFTaskIdBasic, ZFTaskQueue, ZFTcp, ZFTestCase, ZFThread, ZFThreadMainThread, ZFThreadPool, ZFThreadPoolForIO, ZFTime, ZFTimer, ZFTypeIdWrapper, ZFUdp, ZFUIAutoLayout, ZFUIAutoLayoutParam, ZFUIButton, ZFUIButtonBasic, ZFUIButtonGroup, ZFUICell, ZFUICellAdapterBasic, ZFUICellAdapterBasicParam, ZFUICellArray, ZFUICellView, ZFUICellViewBasic, ZFUIDialog, ZFUIDrawableView, ZFUIEvent, ZFUIFlowLayout, ZFUIFlowLayoutParam, ZFUIGlobalStyle, ZFUIGridLayout, ZFUIGridLayoutParam, ZFUIHint, ZFUIHintContentBasic, ZFUIImage, ZFUIImageLoadTask, ZFUIImageView, ZFUIImageViewExt, ZFUIKeyboardState, ZFUIKeyEvent, ZFUILayoutParam, ZFUILinearLayout, ZFUILinearLayoutParam, ZFUIListView, ZFUIListViewCellUpdater, ZFUIMouseEvent, ZFUINativeViewWrapper, ZFUIOnScreenKeyboardAutoFitLayout, ZFUIOnScreenKeyboardState, ZFUIPage, ZFUIPageManager, ZFUIRootView, ZFUIScrollerDefault, ZFUIScrollLayout, ZFUIScrollThumbDefault, ZFUIScrollView, ZFUISysWindow, ZFUITextConfig, ZFUITextEdit, ZFUITextEditWidget, ZFUITextView, ZFUIView, ZFUIViewLayout, ZFUIViewMeasureResult, ZFUIWebJSBridge, ZFUIWebView, ZFUIWheelEvent, ZFUIWindow, ZFValueHolder, ZFWaitTask, and ZFWebSocket.

◆ E_ObjectBeforeAlloc()

static zfidentity ZFObject::E_ObjectBeforeAlloc ( void )
static

see ZFObject::observerNotify

notified when object allocated (before objectOnInitFinish
this event is only designed for convenient and for debug use only, usually you should use ZFClass::instanceObserverAdd

◆ E_ObjectAfterAlloc()

static zfidentity ZFObject::E_ObjectAfterAlloc ( void )
static

see ZFObject::observerNotify

notified when object allocated (after objectOnInitFinish
this event is only designed for convenient and for debug use only, usually you should use ZFClass::instanceObserverAdd

◆ E_ObjectBeforeDealloc()

static zfidentity ZFObject::E_ObjectBeforeDealloc ( void )
static

see ZFObject::observerNotify

notified before object dealloc
note: the object's retain count should be 1 when this event is notified, it's safe to retain the object during this event, but it's your responsibility to ensure logic valid, after notified this event, all observer of this event would be removed, so that it's safe to release the object again to finally destroy the object

◆ E_ObjectPropertyValueOnUpdate()

static zfidentity ZFObject::E_ObjectPropertyValueOnUpdate ( void )
static

see ZFObject::observerNotify

param0 is v_ZFProperty that value changes
param1 is the old property value depends on these conditions:

  • holds ZFNull when first time accessed (by setter or getter)
  • holds the value itself, for retain property
  • holds a ZFTypeIdWrapper to the value, for assign property

called when first time accessed, and each time setter is called

◆ E_ObjectPropertyValueOnReset()

static zfidentity ZFObject::E_ObjectPropertyValueOnReset ( void )
static

see ZFObject::observerNotify

param0 is v_ZFProperty
called when ZFPropertyValueReset (before value actually reset)
note, won't be called when object dealloc

◆ objectRetainCount()

zfindex ZFObject::objectRetainCount ( void )
inline

return the object's retain count

See also
zfRetain, zfRelease

◆ objectInfoOfInstance()

zfstring ZFObject::objectInfoOfInstance ( void )
inline

return a short string describe the object instance

may looks like this: ClassName(0x123456)

See also
objectInfo

◆ objectInfo()

zfstring ZFObject::objectInfo ( void )
inline

return object info

subclass or impl may override or supply dynamic registered method with void objectInfoImpl(zfstring &ret) to achieve custom logic, or override objectInfoImplAppend for chained impl

◆ objectInfoImpl()

virtual void ZFObject::objectInfoImpl ( zfstring & ret)
inlineprotectedvirtual

see objectInfo

Reimplemented in v_ZFArgs, v_ZFBezier, v_zfbool, v_zfbyte, v_ZFCallback, v_ZFCallbackType, v_ZFCallerInfo, v_zfchar, v_ZFClass, v_ZFClassDataUpdateData, v_ZFClassDataUpdateType, v_ZFClassInstanceObserverAddParam, v_ZFComparer_ZFObject, v_ZFCompareResult, v_ZFCoreArray, v_zfdouble, v_ZFDynamic, v_ZFFileFindData, v_ZFFilterForIdentity, v_ZFFilterForIndex, v_ZFFilterForNumber, v_ZFFilterForString, v_ZFFilterForZFClass, v_ZFFilterForZFClassType, v_ZFFilterForZFMethod, v_ZFFilterForZFObject, v_ZFFilterForZFProperty, v_ZFFilterResult, v_ZFFilterType, v_zfflags, v_zffloat, v_ZFFrameworkState, v_ZFFuncAddrType, v_zfidentity, v_ZFIdentityGenerator, v_zfindex, v_ZFIndexRange, v_zfint, v_zfiter, v_ZFJson, v_ZFJsonOutputToken, v_ZFLevel, v_zflong, v_ZFMethod, v_ZFMethodAccessType, v_ZFMethodDynamicRegisterParam, v_ZFMethodGenericInvoker, v_ZFMethodType, v_ZFMP, v_ZFObjectInstanceState, v_ZFObserver, v_ZFObserverGroup, v_ZFPathInfo, v_ZFPathInfoImpl, v_ZFProperty, v_ZFPropertyCallbackDynamicRegisterInitValueGetter, v_ZFPropertyDynamicRegisterParam, v_ZFProtocol, v_ZFProtocolImplInfo, v_zfptr, v_ZFRegExpResult, v_ZFSDOutputToken, v_ZFSeekPos, v_ZFSerializableData, v_ZFSerializablePropertyType, v_zfstring, v_ZFTextTemplateIndexData, v_ZFTextTemplateParam, v_ZFTextTemplateRunParam, v_ZFTimeInfo, v_zftimet, v_ZFTimeValue, v_ZFTokenForContainer, v_ZFTokenForKeyValueContainer, v_ZFUdpAddr, v_ZFUIAutoLayoutRule, v_ZFUICellUpdaterParam, v_ZFUIColor, v_ZFUIMargin, v_zfuint, v_ZFUIPoint, v_ZFUIRect, v_ZFUISize, v_ZFUISizeParam, v_ZFUIViewBlinkParam, v_ZFUIViewFocusNextParam, v_zfulong, v_zfweak, v_ZFXml, v_ZFXmlOutputToken, ZFAniTask, ZFContainer, ZFCurveBackIn, ZFCurveBackInOut, ZFCurveBackOut, ZFCurveBounceIn, ZFCurveBounceInOut, ZFCurveBounceOut, ZFCurveEaseIn, ZFCurveEaseInOut, ZFCurveEaseOut, ZFCurveLinear, ZFCurveLoop, ZFCurveLoopBackIn, ZFCurveLoopBackInOut, ZFCurveLoopBackOut, ZFCurveLoopBounceIn, ZFCurveLoopBounceInOut, ZFCurveLoopBounceOut, ZFCurveLoopEaseIn, ZFCurveLoopEaseInOut, ZFCurveLoopEaseOut, ZFCurveLoopLinear, ZFDI_WrapperBase, ZFEnum, ZFHttpServer, ZFHttpServerTask, ZFKeyValueContainer, ZFTask, ZFTaskGroup, ZFTaskQueue, ZFTcp, ZFUdp, and ZFUIViewMeasureResult.

◆ objectInfoImplAppend()

◆ objectHash()

zfidentity ZFObject::objectHash ( void )

get hash of this object

by default, return a hash value of the instance pointer

Warning
if you override this method, you must ensure two objects have same hash if they are regarded as same (i.e. objectCompare return ZFCompareEqual)
Note
this method may or may not be called frequently, (for example, store as key of ZFHashMap may cause frequently call), you should always try to make the implementation have good performance
for dynamic registered class (ZFClassDynamicRegister), you may supply a reflectable method with zfidentity objectHashImpl(void), to achieve custom logic

◆ objectCompare()

ZFCompareResult ZFObject::objectCompare ( ZFObject * anotherObj)

compare with anotherObj

by default, compare by instance pointer
it's recommended to override this method only for objects that only contains value types, for example, v_zfstring, v_zfindex, etc, for other complex type, it's recommended to override objectCompareValue instead

Warning
if your override objectCompare, you must also override objectCompareValue, if two objects are objectCompare as same, then objectCompareValue must also result to same
Note
for dynamic registered class (ZFClassDynamicRegister), you may supply a reflectable method with ZFCompareResult objectCompare(ZFObject *), to achieve custom logic

◆ objectCompareValue()

ZFCompareResult ZFObject::objectCompareValue ( ZFObject * anotherObj)

explicitly compare object by logical value, see objectCompare

Note
for dynamic registered class (ZFClassDynamicRegister), you may supply a reflectable method with ZFCompareResult objectCompareValue(ZFObject *), to achieve custom logic

◆ objectHashImpl()

virtual zfidentity ZFObject::objectHashImpl ( void )
inlineprotectedvirtual

see objectHash

Reimplemented in v_ZFArgs, v_ZFBezier, v_zfbool, v_zfbyte, v_ZFCallback, v_ZFCallbackType, v_ZFCallerInfo, v_zfchar, v_ZFClass, v_ZFClassDataUpdateData, v_ZFClassDataUpdateType, v_ZFClassInstanceObserverAddParam, v_ZFComparer_ZFObject, v_ZFCompareResult, v_ZFCoreArray, v_zfdouble, v_ZFDynamic, v_ZFFileFindData, v_ZFFilterForIdentity, v_ZFFilterForIndex, v_ZFFilterForNumber, v_ZFFilterForString, v_ZFFilterForZFClass, v_ZFFilterForZFClassType, v_ZFFilterForZFMethod, v_ZFFilterForZFObject, v_ZFFilterForZFProperty, v_ZFFilterResult, v_ZFFilterType, v_zfflags, v_zffloat, v_ZFFrameworkState, v_ZFFuncAddrType, v_zfidentity, v_ZFIdentityGenerator, v_zfindex, v_ZFIndexRange, v_zfint, v_zfiter, v_ZFJson, v_ZFJsonOutputToken, v_ZFLevel, v_zflong, v_ZFMethod, v_ZFMethodAccessType, v_ZFMethodDynamicRegisterParam, v_ZFMethodGenericInvoker, v_ZFMethodType, v_ZFMP, v_ZFObjectInstanceState, v_ZFObserver, v_ZFObserverGroup, v_ZFPathInfo, v_ZFPathInfoImpl, v_ZFProperty, v_ZFPropertyCallbackDynamicRegisterInitValueGetter, v_ZFPropertyDynamicRegisterParam, v_ZFProtocol, v_ZFProtocolImplInfo, v_zfptr, v_ZFRegExpResult, v_ZFSDOutputToken, v_ZFSeekPos, v_ZFSerializableData, v_ZFSerializablePropertyType, v_zfstring, v_ZFTextTemplateIndexData, v_ZFTextTemplateParam, v_ZFTextTemplateRunParam, v_ZFTimeInfo, v_zftimet, v_ZFTimeValue, v_ZFTokenForContainer, v_ZFTokenForKeyValueContainer, v_ZFUdpAddr, v_ZFUIAutoLayoutRule, v_ZFUICellUpdaterParam, v_ZFUIColor, v_ZFUIMargin, v_zfuint, v_ZFUIPoint, v_ZFUIRect, v_ZFUISize, v_ZFUISizeParam, v_ZFUIViewBlinkParam, v_ZFUIViewFocusNextParam, v_zfulong, v_zfweak, v_ZFXml, v_ZFXmlOutputToken, ZFDI_WrapperBase, ZFEnum, ZFRegExp, and ZFTime.

◆ objectCompareImpl()

virtual ZFCompareResult ZFObject::objectCompareImpl ( ZFObject * anotherObj)
inlineprotectedvirtual

see objectCompare

Reimplemented in v_ZFArgs, v_ZFBezier, v_zfbool, v_zfbyte, v_ZFCallback, v_ZFCallbackType, v_ZFCallerInfo, v_zfchar, v_ZFClass, v_ZFClassDataUpdateData, v_ZFClassDataUpdateType, v_ZFClassInstanceObserverAddParam, v_ZFComparer_ZFObject, v_ZFCompareResult, v_ZFCoreArray, v_zfdouble, v_ZFDynamic, v_ZFFileFindData, v_ZFFilterForIdentity, v_ZFFilterForIndex, v_ZFFilterForNumber, v_ZFFilterForString, v_ZFFilterForZFClass, v_ZFFilterForZFClassType, v_ZFFilterForZFMethod, v_ZFFilterForZFObject, v_ZFFilterForZFProperty, v_ZFFilterResult, v_ZFFilterType, v_zfflags, v_zffloat, v_ZFFrameworkState, v_ZFFuncAddrType, v_zfidentity, v_ZFIdentityGenerator, v_zfindex, v_ZFIndexRange, v_zfint, v_zfiter, v_ZFJson, v_ZFJsonOutputToken, v_ZFLevel, v_zflong, v_ZFMethod, v_ZFMethodAccessType, v_ZFMethodDynamicRegisterParam, v_ZFMethodGenericInvoker, v_ZFMethodType, v_ZFMP, v_ZFObjectInstanceState, v_ZFObserver, v_ZFObserverGroup, v_ZFPathInfo, v_ZFPathInfoImpl, v_ZFProperty, v_ZFPropertyCallbackDynamicRegisterInitValueGetter, v_ZFPropertyDynamicRegisterParam, v_ZFProtocol, v_ZFProtocolImplInfo, v_zfptr, v_ZFRegExpResult, v_ZFSDOutputToken, v_ZFSeekPos, v_ZFSerializableData, v_ZFSerializablePropertyType, v_zfstring, v_ZFTextTemplateIndexData, v_ZFTextTemplateParam, v_ZFTextTemplateRunParam, v_ZFTimeInfo, v_zftimet, v_ZFTimeValue, v_ZFTokenForContainer, v_ZFTokenForKeyValueContainer, v_ZFUdpAddr, v_ZFUIAutoLayoutRule, v_ZFUICellUpdaterParam, v_ZFUIColor, v_ZFUIMargin, v_zfuint, v_ZFUIPoint, v_ZFUIRect, v_ZFUISize, v_ZFUISizeParam, v_ZFUIViewBlinkParam, v_ZFUIViewFocusNextParam, v_zfulong, v_zfweak, v_ZFXml, v_ZFXmlOutputToken, ZFCurveBackIn, ZFCurveBackInOut, ZFCurveBackOut, ZFCurveBounceIn, ZFCurveBounceInOut, ZFCurveBounceOut, ZFCurveEaseIn, ZFCurveEaseInOut, ZFCurveEaseOut, ZFCurveLinear, ZFCurveLoop, ZFCurveLoopBackIn, ZFCurveLoopBackInOut, ZFCurveLoopBackOut, ZFCurveLoopBounceIn, ZFCurveLoopBounceInOut, ZFCurveLoopBounceOut, ZFCurveLoopEaseIn, ZFCurveLoopEaseInOut, ZFCurveLoopEaseOut, ZFCurveLoopLinear, ZFDI_WrapperBase, ZFEnum, ZFRegExp, and ZFTime.

◆ objectCompareValueImpl()

virtual ZFCompareResult ZFObject::objectCompareValueImpl ( ZFObject * anotherObj)
inlineprotectedvirtual

◆ objectTag()

void ZFObject::objectTag ( const zfstring & key,
ZFObject * tag )

used to hold a object for app's use, auto retained

replace if existing, remove if tag is null

◆ objectTagRemoveAll()

void ZFObject::objectTagRemoveAll ( void )

remove all tag

Note
it's unsafe to remove all tag manually, which may break unrelated modules' additional logic, remove only if necessary
typically, you should remove exactly the one you have added
this method would be called during E_ObjectBeforeDealloc and objectOnDeallocPrepare

◆ observerRemoveAll() [1/2]

void ZFObject::observerRemoveAll ( zfidentity eventId)

see observerNotify

Note
it's unsafe to remove all observer manually, which may break unrelated modules' observer logic, remove only if necessary
typically, you should remove exactly the one you have added

◆ observerRemoveAll() [2/2]

void ZFObject::observerRemoveAll ( void )

see observerNotify

Note
it's unsafe to remove all observer manually, which may break unrelated modules' observer logic, remove only if necessary
typically, you should remove exactly the one you have added

◆ observerNotify()

void ZFObject::observerNotify ( zfidentity eventId,
ZFObject * param0 = zft_zfnull,
ZFObject * param1 = zft_zfnull )

notify the observer with eventId

the ZFListener would be executed
it's ensured the first added observer would be executed first
use ZFGlobalObserver for global observer
for instance observer:

zfclass YourClass {
// declare your event here,
// which would generate a method:
// static zfidentity E_YourEvent(void)
ZFEVENT(YourEvent)
};
// notify using declared event
yourClass->observerNotify(YourClass::E_YourEvent(), params...);
#define ZFEVENT(YourEvent)
see ZFObject::observerNotify
Definition ZFObjectObserver.h:328
Note
observers would be compared by ZFCallback::objectCompareByInstance when add or remove


to pass extra params to the callback, see ZFLISTENER for more info

◆ observerHolder()

ZFObserver & ZFObject::observerHolder ( void )

access the internal observer holder

usually for internal use only
calling owner object's observerAdd series is ensured same with calling the observerHolder's proper method

◆ on()

void ZFObject::on ( const zfstring & eventName,
const ZFListener & observer,
ZFLevel observerLevel = ZFLevelAppNormal )

util to observerAdd

note, this method would recursively search event name by ZFIdMapIdForName from entire inherit tree, used for convenient only (in script for example), take care of performance
example:

ZFUIButtonBasic *obj = xxx;
obj->on("ButtonOnClick", xxx);
// these event would be searched, until proper event found:
// 1. ZFUIButtonBasic.E_ButtonOnClick : not found
// 2. ZFUIButton.E_ButtonOnClick : found
// or, use exact event name
obj->on("ZFUIButton.E_ButtonOnClick", xxx);
void on(const zfstring &eventName, const ZFListener &observer, ZFLevel observerLevel=ZFLevelAppNormal)
util to observerAdd
basic button, see ZFUIButton
Definition ZFUIButtonBasic.h:33

◆ observerOnAdd()

virtual void ZFObject::observerOnAdd ( zfidentity eventId)
protectedvirtual

called when add first observer

Reimplemented in ZFUIView.

◆ observerOnRemove()

virtual void ZFObject::observerOnRemove ( zfidentity eventId)
protectedvirtual

called when remove last observer

Reimplemented in ZFUIView.

◆ observerOnEvent()

virtual void ZFObject::observerOnEvent ( const ZFArgs & zfargs)
inlineprotectedvirtual

notified when observerNotify

ensured called before any other registered observer

◆ objectOnInit()

virtual void ZFObject::objectOnInit ( void )
protectedvirtual

override this to init your object

subclass must call superclass's objectOnInit before any other code if override
you may also declare objectOnInit with params like this:

zfclass Parent : ... {
...
protected:
virtual void objectOnInit(void) {...};
};
zfclass Child : Parent {
protected:
// override all parent's objectOnInit is also required,
// because of function hiding of C++
virtual void objectOnInit(void) {
zfsuper::objectOnInit();
}
// custom init entry
virtual void objectOnInit(Params...) {
// your extra init steps
...
}
};
virtual void objectOnInit(void)
override this to init your object
Warning
objectOnInit and objectOnDealloc is called as a virtual function, take good care of other virtual function call, use zfself::func() instead of this->func() if necessary, or use objectOnInitFinish/objectOnDeallocPrepare, or declare your own constructor with ZFOBJECT_DECLARE_WITH_CUSTOM_CTOR
Note
(ZFTAG_LIMITATION) due to limitations of C++, if your parent type declared objectOnInit with different params, and your child type want to override part of those objectOnInit, then your child type must also override all objectOnInit that parent declared, otherwise, some may be hidden
for objects that designed not to be allocated by user, you should use ZFOBJECT_PRIVATE_ALLOC, typically usage:
zfclass MyObject : zfextend ZFObject {
ZFOBJECT_DECLARE(MyObject, ZFObject)
ZFOBJECT_PRIVATE_ALLOC("should be created by MyObject::instanceForXxx only")
public:
static zfauto instanceForXxx(xxx) {
// can only be allocated by reflection
}
};
static void func(void) {
// MyObject *obj = zfAlloc(MyObject); // would compile error
zfauto obj = MyObject::instanceForXxx(xxx); // OK
}
#define ZFOBJECT_PRIVATE_ALLOC(...)
mark this object can not be allocated directly
Definition ZFObjectDeclare.h:245
zfauto newInstance(void) const
make a new instance of ZFObject dynamically, which is described by ZFClass
static const ZFClass * ClassData(void)
get class info
Definition ZFObjectCore.h:211
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34

Reimplemented in v_ZFArgs, v_ZFBezier, v_zfbool, v_zfbyte, v_ZFCallback, v_ZFCallbackType, v_ZFCallerInfo, v_zfchar, v_ZFClass, v_ZFClassDataUpdateData, v_ZFClassDataUpdateType, v_ZFClassInstanceObserverAddParam, v_ZFComparer_ZFObject, v_ZFCompareResult, v_ZFCoreArray, v_zfdouble, v_ZFDynamic, v_ZFFileFindData, v_ZFFilterForIdentity, v_ZFFilterForIndex, v_ZFFilterForNumber, v_ZFFilterForString, v_ZFFilterForZFClass, v_ZFFilterForZFClassType, v_ZFFilterForZFMethod, v_ZFFilterForZFObject, v_ZFFilterForZFProperty, v_ZFFilterResult, v_ZFFilterType, v_zfflags, v_zffloat, v_ZFFrameworkState, v_ZFFuncAddrType, v_zfidentity, v_ZFIdentityGenerator, v_zfindex, v_ZFIndexRange, v_zfint, v_zfiter, v_ZFJson, v_ZFJsonOutputToken, v_ZFLevel, v_zflong, v_ZFMethod, v_ZFMethodAccessType, v_ZFMethodDynamicRegisterParam, v_ZFMethodGenericInvoker, v_ZFMethodType, v_ZFMP, v_ZFObjectInstanceState, v_ZFObserver, v_ZFObserverGroup, v_ZFPathInfo, v_ZFPathInfoImpl, v_ZFProperty, v_ZFPropertyCallbackDynamicRegisterInitValueGetter, v_ZFPropertyDynamicRegisterParam, v_ZFProtocol, v_ZFProtocolImplInfo, v_zfptr, v_ZFRegExpResult, v_ZFSDOutputToken, v_ZFSeekPos, v_ZFSerializableData, v_ZFSerializablePropertyType, v_zfstring, v_ZFTextTemplateIndexData, v_ZFTextTemplateParam, v_ZFTextTemplateRunParam, v_ZFTimeInfo, v_zftimet, v_ZFTimeValue, v_ZFTokenForContainer, v_ZFTokenForKeyValueContainer, v_ZFUdpAddr, v_ZFUIAutoLayoutRule, v_ZFUICellUpdaterParam, v_ZFUIColor, v_ZFUIMargin, v_zfuint, v_ZFUIPoint, v_ZFUIRect, v_ZFUISize, v_ZFUISizeParam, v_ZFUIViewBlinkParam, v_ZFUIViewFocusNextParam, v_zfulong, v_zfweak, v_ZFXml, v_ZFXmlOutputToken, ZFAniForFrame, ZFAniForGeneric, ZFAniForImpl, ZFAniForNative, ZFAniForTimer, ZFAniGroup, ZFAnimation, ZFAniTask, ZFArray, ZFAsyncIOCustomTask, ZFAsyncIOTask, ZFAsyncTask, ZFAudio, ZFAudioPlayTask, ZFAutoReleasePool, ZFCache, ZFCompress, ZFDecompress, ZFDI_WrapperBase, ZFEnum, ZFHashMap, ZFHashSet, ZFHttpRequest, ZFHttpResponse, ZFHttpServer, ZFImpl_ZFLuaValue, ZFIOBufferByCacheFile, ZFIOBufferByMemory, ZFIOCacheLoadTask, ZFMap, ZFObjectHolder, ZFOutputFormatBasic, ZFPostTask, ZFRegExp, ZFSemaphore, ZFSet, ZFState, ZFStyleList, ZFTask, ZFTaskIdBasic, ZFTcp, ZFThread, ZFThreadPool, ZFTime, ZFTimer, ZFUdp, ZFUIAutoLayout, ZFUIButton, ZFUIButtonBasic, ZFUIButtonGroup, ZFUICellArray, ZFUICellViewBasic, ZFUIDialog, ZFUIDrawableView, ZFUIHint, ZFUIImage, ZFUIImageLoadTask, ZFUIImageView, ZFUIListView, ZFUINativeViewWrapper, ZFUIOnScreenKeyboardAutoFitLayout, ZFUIPageManager, ZFUIScrollerDefault, ZFUIScrollThumbDefault, ZFUIScrollView, ZFUISysWindow, ZFUITextEdit, ZFUITextEditWidget, ZFUITextView, ZFUIView, ZFUIWebJSBridge, ZFUIWebView, ZFUIWindow, ZFValueHolder, ZFWaitTask, and ZFWebSocket.

◆ objectOnInitFinish()

virtual void ZFObject::objectOnInitFinish ( void )
inlineprotectedvirtual

called after objectOnInit, safe to call virtual functions here

usually used to initialize independent resources other than self's internal resources

Reimplemented in ZFUIButton, ZFUICellView, ZFUIHint, ZFUIImage, ZFUIOnScreenKeyboardAutoFitLayout, ZFUIScrollThumbDefault, ZFUISysWindow, ZFUITextEdit, and ZFUITextView.

◆ objectOnDeallocPrepare()

virtual void ZFObject::objectOnDeallocPrepare ( void )
inlineprotectedvirtual

called before objectOnDealloc, safe to call virtual functions here

usually used to cleanup resources attached to this object other than self's internal resources

Note
it's ensured safe to retain the object while deallocating, but it's not ensured objectOnDeallocPrepare would only called once for each instance

Reimplemented in ZFAniGroup, ZFAnimation, ZFAutoReleasePool, ZFCache, ZFCompress, ZFContainer, ZFDecompress, ZFHttpServer, ZFImpl_ZFLuaValue, ZFKeyValueContainer, ZFTask, ZFTcp, ZFTestCase, ZFThread, ZFThreadPool, ZFTimer, ZFUICellArray, ZFUIHint, ZFUIImage, ZFUIImageView, ZFUIListView, ZFUIScrollThumbDefault, ZFUIScrollView, ZFUISysWindow, ZFUIView, ZFUIWebView, ZFValueHolder, and ZFWebSocket.

◆ objectOnDealloc()

◆ objectOnRetain()

virtual void ZFObject::objectOnRetain ( void )
inlineprotectedvirtual

called to retain object

subclass must call superclass's objectOnRetain before any other code if override
usually you should not override this method

◆ objectOnRelease()

virtual void ZFObject::objectOnRelease ( void )
inlineprotectedvirtual

called to release object

subclass must call superclass's onRelase after any other code if override
usually you should not override this method

◆ objectIsInternal()

virtual zfbool ZFObject::objectIsInternal ( void )
virtual

whether this object is internal object or its class is ZFClass::classIsInternal

if objectIsInternalPrivate, then it is also objectIsInternal

Reimplemented in ZFDI_WrapperBase, ZFEnum, ZFImpl_ZFLuaValue, and ZFTypeIdWrapper.

◆ objectIsInternalPrivate()

virtual zfbool ZFObject::objectIsInternalPrivate ( void )
virtual

whether this object is internal private object or its class is ZFClass::classIsInternalPrivate

if objectIsInternalPrivate, then it is also objectIsInternal

Reimplemented in ZFDI_WrapperBase, ZFEnum, and ZFImpl_ZFLuaValue.

◆ objectPropertyValueOnUpdate()

virtual void ZFObject::objectPropertyValueOnUpdate ( const ZFProperty * property,
const void * oldValue )
protectedvirtual

see E_ObjectPropertyValueOnUpdate

oldValue should be:

  • zfnull, if property first time accessed (by getter or setter)
  • addr of zfauto, for retain property
  • addr of raw value, for assign property

Reimplemented in ZFUIImage, and ZFUILayoutParam.


The documentation for this class was generated from the following file: