similar to category of Object-C, it's possible to extend existing cpp class in ZFFramework:
ZFLogTrim(
"funcInExistClass: %s, cast to AttachClass: %s",
this,
zfcast(AttachClass *,
this));
}
};
ZFLogTrim(
"funcInAttachClass: %s, cast to ExistClass: %s",
this,
zfcast(ExistClass *,
this));
}
};
}
}
obj->funcInExistClass();
obj->
to<AttachClass *>()->funcInAttachClass();
"ZFImplementDynamicRegister(ExistClass.ClassData(), AttachClass.ClassData())\n"
"\n"
"local obj = ExistClass()\n"
"obj:funcInExistClass()\n"
"obj:funcInAttachClass()\n"
);
void ZFImplementDynamicUnregister(const ZFClass *cls, const ZFClass *clsToImplement)
see ZFCLASS_EXTEND
#define ZFCLASS_EXTEND(ExistClass, AttachClass)
advanced dynamic implement
Definition ZFClassDynamicRegister.h:74
zfbool ZFImplementDynamicRegister(const ZFClass *cls, const ZFClass *clsToImplement)
see ZFCLASS_EXTEND
#define ZF_GLOBAL_INITIALIZER_INIT(Name)
see ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL
Definition ZFCoreGlobalInitializer.h:164
#define ZF_GLOBAL_INITIALIZER_DESTROY(Name)
see ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL
Definition ZFCoreGlobalInitializer.h:173
#define ZF_GLOBAL_INITIALIZER_END(Name)
see ZF_GLOBAL_INITIALIZER_INIT_WITH_LEVEL
Definition ZFCoreGlobalInitializer.h:187
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define ZFLogTrim(...)
see ZFLog
Definition ZFLog.h:80
zfauto ZFLuaExecute(const ZFInput &input)
main entry for lua module, execute lua code
#define ZFMETHOD_INLINE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:755
#define zfcast(T_To, obj)
safely cast ZFObject types, return null if not desired type
Definition ZFObjectCast.h:28
#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
base class of all objects
Definition ZFObjectCore.h:209
T_ZFObject to(void) const
cast by zfcast
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:157