ZFFramework
Loading...
Searching...
No Matches
Classes | Macros
ZFObjectInterface.h File Reference

interface declare More...

#include "zfany.h"
#include "ZFClass.h"

Go to the source code of this file.

Classes

class  ZFInterface
 dummy base of interface types More...
 

Macros

#define zfinterface
 shows the type is an interface, see ZFInterface
 
#define zfimplement
 shows class implement from interface, see ZFInterface
 
#define ZFINTERFACE_DECLARE_WITH_CUSTOM_CTOR(InterfaceName, ParentInterface, ...)
 see ZFINTERFACE_DECLARE
 
#define ZFINTERFACE_DECLARE(InterfaceName, ParentInterface, ...)
 see ZFInterface
 
#define ZFIMPLEMENT_DECLARE(ImplementedInterfaces, ...)
 see ZFINTERFACE_DECLARE
 
#define ZFINTERFACE_ON_INIT_DECLARE()
 declare custom init step for the interface
 
#define ZFINTERFACE_ON_INIT_DEFINE(YourInterface)
 see ZFINTERFACE_ON_INIT_DECLARE
 
#define ZFINTERFACE_ON_DEALLOC_DECLARE()
 see ZFINTERFACE_ON_INIT_DECLARE
 
#define ZFINTERFACE_ON_DEALLOC_DEFINE(YourInterface)
 see ZFINTERFACE_ON_INIT_DECLARE
 

Detailed Description

interface declare

Macro Definition Documentation

◆ ZFINTERFACE_DECLARE_WITH_CUSTOM_CTOR

#define ZFINTERFACE_DECLARE_WITH_CUSTOM_CTOR ( InterfaceName,
ParentInterface,
... )

see ZFINTERFACE_DECLARE

you may have custom constructor with this macro, but must be declared as protected with no params, and must also declare an virtual protected destructor

◆ ZFINTERFACE_ON_INIT_DECLARE

#define ZFINTERFACE_ON_INIT_DECLARE ( )

declare custom init step for the interface

although ZFInterface is designed as interface type, it is normal class in C++ in fact, you can supply your own custom init step
once declared, the init step would be called after ZFObject::objectOnInit and before ZFObject::objectOnInitFinish, ordered from parent interface to child interface, and the paired ZFINTERFACE_ON_DEALLOC_DECLARE would be called after ZFObject::objectOnDeallocPrepare and before ZFObject::objectOnDealloc

note: use only if necessary, and at your own risk
overrided init step would be called for each instance of this class and all of subclasses, take care of performance