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

base class of all protocol of ZFFramework More...

#include <ZFProtocol.h>

Inheritance diagram for ZFProtocol:
ZFPInterface_ZFAniForNative ZFPInterface_ZFApp ZFPInterface_ZFAudio ZFPInterface_ZFCompress ZFPInterface_ZFEncrypt ZFPInterface_ZFEnvInfo_deviceUIInfo ZFPInterface_ZFEnvInfo_frameworkInfo ZFPInterface_ZFEnvInfo_systemInfo ZFPInterface_ZFFile ZFPInterface_ZFFileCwd ZFPInterface_ZFHttpRequest ZFPInterface_ZFHttpServer ZFPInterface_ZFImplOutput ZFPInterface_ZFJson ZFPInterface_ZFLogStackTrace ZFPInterface_ZFLua ZFPInterface_ZFPath ZFPInterface_ZFRegExp ZFPInterface_ZFRes ZFPInterface_ZFSemaphore ZFPInterface_ZFString ZFPInterface_ZFTcp ZFPInterface_ZFThread ZFPInterface_ZFTime ZFPInterface_ZFTimer ZFPInterface_ZFUIDraw ZFPInterface_ZFUIDrawForImage ZFPInterface_ZFUIDrawForView ZFPInterface_ZFUIImage ZFPInterface_ZFUIImageIO ZFPInterface_ZFUIImageView ZFPInterface_ZFUIKeyboardState ZFPInterface_ZFUIOnScreenKeyboardState ZFPInterface_ZFUIScrollView ZFPInterface_ZFUISysWindow ZFPInterface_ZFUISysWindowEmbedNativeView ZFPInterface_ZFUITextEdit ZFPInterface_ZFUITextView ZFPInterface_ZFUIView ZFPInterface_ZFUIViewCapture ZFPInterface_ZFUIViewFocus ZFPInterface_ZFUIViewPositionOnScreen ZFPInterface_ZFUIViewTransform ZFPInterface_ZFUIViewTreeNative ZFPInterface_ZFUIWebJSBridge ZFPInterface_ZFUIWebView ZFPInterface_ZFUdp ZFPInterface_ZFWebSocket ZFPInterface_ZFXml

Public Member Functions

virtual void protocolOnInit (void)
 called to init the protocol
 
virtual void protocolOnInitFinish (void)
 see protocolOnInit
 
virtual void protocolOnDeallocPrepare (void)
 see protocolOnInit
 
virtual void protocolOnDealloc (void)
 see protocolOnInit
 
virtual ZFProtocolInstanceState protocolInstanceState (void)
 protocol instance's state
 
virtual const zfcharprotocolName (void) const
 get the name of the protocol module, e.g. "ZFObject"
 
virtual const zfcharprotocolImplName (void) const
 get the name of the protocol implementation, e.g. "ZFObject_default"
 
virtual ZFProtocolLevel protocolImplLevel (void) const
 get the level of the protocol implementation
 
virtual const zfcharprotocolImplPlatformHint (void) const
 get type hint of the implementation or empty string if not defined, e.g. "iOS:NSString" for iOS's string impl, use ZFPROTOCOL_IMPLEMENTATION_PLATFORM_HINT to register
 
virtual void objectInfoT (zfstring &ret) const
 see objectInfo
 
virtual zfstring objectInfo (void) const
 get a short info about this object
 

Detailed Description

base class of all protocol of ZFFramework

Member Function Documentation

◆ protocolOnInit()

virtual void ZFProtocol::protocolOnInit ( void )
inlinevirtual

called to init the protocol

similar to ZFObject::objectOnInit, we have these functions for protocol to do custom init steps (ordered by life cycle):

  1. normal object constructor
  2. protocolOnInit : called when first time accessed
  3. protocolOnInitFinish : called when first time accessed
  4. protocolOnDeallocPrepare : called during ZFFrameworkCleanup as level ZFLevelZFFrameworkEssential, or called when changing impl manually
  5. protocolOnDealloc : called during ZFFrameworkCleanup as level ZFLevelZFFrameworkStatic, or called when changing impl manually
  6. normal object destructor

◆ protocolName()

◆ protocolImplPlatformHint()

virtual const zfchar * ZFProtocol::protocolImplPlatformHint ( void ) const
inlinevirtual

get type hint of the implementation or empty string if not defined, e.g. "iOS:NSString" for iOS's string impl, use ZFPROTOCOL_IMPLEMENTATION_PLATFORM_HINT to register

Note
usually for debug use only, do not abuse it
for some implementation that depends on other packaged implementations, you may check this value to be your expected value and assert false if not (for example, view's impl usually depends on string's impl)

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