ZFFramework
 
Loading...
Searching...
No Matches
ZFInterface Class Referenceabstract

dummy base of interface types More...

#include <ZFObjectInterface.h>

Inheritance diagram for ZFInterface:
ZFCopyable ZFIterable ZFIterableKeyValue ZFOutputFormat ZFProgressable ZFSerializable ZFStyleable ZFTaskId ZFUICellAdapter ZFUICellUpdater ZFUIScrollThumb ZFUIScroller ZFUISysWindowEmbedImpl ZFUIText

Public Member Functions

virtual const ZFClassclassData (void)=0
 get instance's class info
 
virtual ZFObjecttoObject (void)=0
 convert to ZFObject type
 

Static Public Member Functions

static const ZFClassClassData (void)
 get class info
 

Protected Types

typedef _ZFP_ObjI_Base zfsuper
 typedef for super (always ZFInterface for an interface type)
 
typedef ZFInterface zfself
 typedef for self
 

Detailed Description

dummy base of interface types

usage:

// declare an interface
zfinterface YourInterface : zfextend ZFInterface {
ZFINTERFACE_DECLARE(YourInterface, ZFInterface)
};
// implement an interface
, zfimplement YourInterface
, zfimplement ParentInterface1
, zfimplement ParentInterface2
...
{
ZFIMPLEMENT_DECLARE(YourInterface, ParentInterface1, ParentInterface2, ...)
};
#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
#define ZFIMPLEMENT_DECLARE(ImplementedInterfaces,...)
see ZFINTERFACE_DECLARE
Definition ZFObjectInterface.h:169
#define zfimplement
shows class implement from interface, see ZFInterface
Definition ZFObjectInterface.h:24
#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
base class of all objects
Definition ZFObjectCore.h:209

(ZFTAG_LIMITATION) due to some limitations of C++ (basically the limitations of diamond inheritance), you should remember these while using interface:

  • an interface must inherit from ZFInterface or other interface (at most one), it can only be "implemented" by a "ZFObject type"
  • you must have ZFINTERFACE_DECLARE declared in your interface, and must have ZFIMPLEMENT_DECLARE declared in your child type that implement the interface


ADVANCED:
to simulate a interface that inherit from multiple interfaces, you should do it like this:
Java code:

public interface IParent0 {}
public interface IParent1 {}
public interface IChild extends IParent0, IParent1 {}
public class ObjParent implements IParent0 {}
public class ObjChild extends ObjParent implements IChild {}

equivalent code for ZFInterface:

zfinterface IParent0 : zfextend ZFInterface {
ZFINTERFACE_DECLARE(IParent0, ZFInterface)
};
};
zfinterface IChild : zfextend IParent0 { // note: can only inherit at most one parent interface
ZFINTERFACE_DECLARE(IChild, IParent0)
};
zfclass ObjParent : zfextend ZFObject, zfimplement IParent0 {
ZFOBJECT_DECLARE(ObjParent, ZFObject)
};
zfclass ObjChild : zfextend ObjParent, zfimplement IChild
, zfimplement IParent1 // note: here is required
{
ZFOBJECT_DECLARE(ObjChild, ObjParent)
, IParent1 // note: here is required
)
};
dummy base of interface types
Definition ZFObjectInterface.h:250

it's strongly recommend not to make interface inherit multiple interfaces

Member Function Documentation

◆ classData()

virtual const ZFClass * ZFInterface::classData ( void )
pure virtual

get instance's class info

Implemented 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, ZFAudioPlayTask, ZFBase64, ZFContainer, ZFCurve, ZFCurveBackIn, ZFCurveBackInOut, ZFCurveBackOut, ZFCurveBounceIn, ZFCurveBounceInOut, ZFCurveBounceOut, ZFCurveEaseIn, ZFCurveEaseInOut, ZFCurveEaseOut, ZFCurveLinear, ZFCurveLoop, ZFCurveLoopBackIn, ZFCurveLoopBackInOut, ZFCurveLoopBackOut, ZFCurveLoopBounceIn, ZFCurveLoopBounceInOut, ZFCurveLoopBounceOut, ZFCurveLoopEaseIn, ZFCurveLoopEaseInOut, ZFCurveLoopEaseOut, ZFCurveLoopLinear, ZFEnum, ZFHashMap, ZFHashSet, ZFHttpRequest, ZFHttpServer, ZFIOCacheLoadTask, ZFKeyValueContainer, ZFLogFormat, ZFMap, ZFOutputFormatBasic, ZFPostTask, ZFRegExp, ZFSet, ZFStyle, ZFStyleList, ZFTask, ZFTaskGroup, ZFTaskIdBasic, ZFTaskQueue, ZFTestCase, ZFTime, ZFTimer, ZFTypeIdWrapper, ZFUIAutoLayout, ZFUIAutoLayoutParam, ZFUIButton, ZFUIButtonBasic, ZFUIButtonGroup, ZFUICell, ZFUICellAdapterBasic, ZFUICellArray, ZFUICellView, ZFUICellViewBasic, ZFUIDialog, ZFUIDrawableView, ZFUIFlowLayout, ZFUIFlowLayoutParam, ZFUIGlobalStyle, ZFUIGridLayout, ZFUIGridLayoutParam, ZFUIHintContentBasic, ZFUIImage, ZFUIImageLoadTask, ZFUIImageView, ZFUILayoutParam, ZFUILinearLayout, ZFUILinearLayoutParam, ZFUIListView, ZFUIListViewCellUpdater, ZFUINativeViewWrapper, ZFUIOnScreenKeyboardAutoFitLayout, ZFUIRootView, ZFUIScrollerDefault, ZFUIScrollLayout, ZFUIScrollThumbDefault, ZFUIScrollView, ZFUITextConfig, ZFUITextEdit, ZFUITextEditWidget, ZFUITextView, ZFUIView, ZFUIViewLayout, ZFUIWebView, ZFUIWindow, and ZFWaitTask.


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