ZFFramework
|
util class to dynamic register class/method/property More...
#include <ZFDynamicRegisterUtil.h>
Public Member Functions | |
ZFDynamic (void) | |
main constructor | |
ZFDynamic (const zfchar *regTag) | |
construct with regTag | |
ZFDynamic (ZFObject *regTag) | |
construct with regTag (converted from ZFObject::objectInfo) | |
ZFDynamic & | regTag (const zfchar *regTag) |
util to make the registration able to be called more than once | |
const zfchar * | regTag (void) const |
see regTag | |
ZFDynamic & | regTag (ZFObject *regTag) |
see regTag | |
void | removeAll (void) |
see ZFDynamic | |
const ZFCoreArray< const ZFClass * > & | allClass (void) const |
see ZFDynamic | |
const ZFCoreArray< const ZFClass * > & | allEnum (void) const |
see ZFDynamic | |
const ZFCoreArray< const ZFMethod * > & | allMethod (void) const |
see ZFDynamic | |
const ZFCoreArray< const ZFProperty * > & | allProperty (void) const |
see ZFDynamic | |
const ZFCoreArray< zfidentity > & | allEvent (void) const |
see ZFDynamic | |
ZFDynamic & | classBegin (const zfchar *classNameFull, const ZFClass *classParent=ZFObject::ClassData(), ZFObject *classDynamicRegisterUserData=0) |
see ZFDynamic | |
ZFDynamic & | classBegin (const zfchar *classNameFull, const zfchar *parentClassNameFull, ZFObject *classDynamicRegisterUserData=0) |
see ZFDynamic | |
ZFDynamic & | classBegin (const ZFClass *cls) |
see ZFDynamic | |
ZFDynamic & | classEnd (void) |
see ZFDynamic | |
ZFDynamic & | classImplement (const ZFClass *clsToImplement) |
see ZFImplementDynamicRegister | |
ZFDynamic & | classCanAllocPublic (zfbool value) |
see ZFClass::classCanAllocPublic | |
ZFDynamic & | on (zfidentity eventId, const ZFListener &callback, ZFLevel level=ZFLevelAppNormal) |
see ZFDynamic | |
ZFDynamic & | onInit (const ZFListener &callback) |
see ZFDynamic | |
ZFDynamic & | onDealloc (const ZFListener &callback) |
see ZFDynamic | |
ZFDynamic & | NSBegin (const zfchar *methodNamespace="ZF") |
see ZFDynamic | |
ZFDynamic & | NSEnd (void) |
see ZFDynamic | |
ZFDynamic & | enumBegin (const zfchar *enumClassName) |
see ZFDynamic | |
ZFDynamic & | enumBeginFlags (const zfchar *enumClassName) |
see ZFDynamic | |
ZFDynamic & | enumValue (const zfchar *enumName, zfuint enumValue=((zfuint) -1)) |
see ZFDynamic | |
ZFDynamic & | enumEnd (zfuint enumDefault=((zfuint) -1)) |
see ZFDynamic | |
ZFDynamic & | event (const zfchar *eventName) |
register a event, see also ZFOBSERVER_EVENT ZFOBSERVER_EVENT_GLOBAL | |
ZFDynamic & | method (const zfchar *methodReturnTypeId, const zfchar *methodName, const ZFMP &methodParam, const ZFListener &methodImpl, ZFMethodType methodType=ZFMethodTypeVirtual, ZFMethodPrivilegeType methodPrivilegeType=ZFMethodPrivilegeTypePublic) |
see ZFDynamic | |
ZFDynamic & | method (const ZFMethodDynamicRegisterParam ¶m) |
see ZFDynamic | |
ZFDynamic & | property (const zfchar *propertyTypeId, const zfchar *propertyName, ZFObject *propertyInitValue=0, ZFMethodPrivilegeType setterPrivilegeType=ZFMethodPrivilegeTypePublic, ZFMethodPrivilegeType getterPrivilegeType=ZFMethodPrivilegeTypePublic) |
see ZFDynamic | |
ZFDynamic & | property (const ZFClass *propertyClassOfRetainProperty, const zfchar *propertyName, ZFObject *propertyInitValue=0, ZFMethodPrivilegeType setterPrivilegeType=ZFMethodPrivilegeTypePublic, ZFMethodPrivilegeType getterPrivilegeType=ZFMethodPrivilegeTypePublic) |
see ZFDynamic | |
ZFDynamic & | property (const ZFPropertyDynamicRegisterParam ¶m) |
see ZFDynamic | |
ZFDynamic & | propertyOnInit (const zfchar *propertyName, const ZFListener &callback) |
util to ZFPropertyDynamicRegisterLifeCycle | |
ZFDynamic & | propertyOnVerify (const zfchar *propertyName, const ZFListener &callback) |
util to ZFPropertyDynamicRegisterLifeCycle | |
ZFDynamic & | propertyOnAttach (const zfchar *propertyName, const ZFListener &callback) |
util to ZFPropertyDynamicRegisterLifeCycle | |
ZFDynamic & | propertyOnDetach (const zfchar *propertyName, const ZFListener &callback) |
util to ZFPropertyDynamicRegisterLifeCycle | |
ZFDynamic & | propertyLifeCycle (const zfchar *propertyName, ZFPropertyLifeCycle lifeCycle, const ZFListener &callback) |
util to ZFPropertyDynamicRegisterLifeCycle | |
void | objectInfoT (zfstring &ret) const |
see objectInfo | |
zfstring | objectInfo (void) const |
return object info | |
Static Public Member Functions | |
static void | exportTag (const ZFOutput &output, zfbool exportScope=_ZFT_t_zffalse, zfbool exportInternal=_ZFT_t_zffalse) |
util method to export all symbols to a tag file | |
static ZFCoreArray< ZFOutput > & | errorCallbacks (void) |
callbacks which would be called when error occurred | |
util class to dynamic register class/method/property
usage:
when any steps failed, errorCallbacks would be notified, and all further call would be ignored
you may store the returned ZFDynamic object, and use removeAll to remove all registered items at once
to make it more convenient for script language, you may also use regTag to make the registration looks like singleton registration
|
static |
util method to export all symbols to a tag file
the tag file contains all of these in plain text format, one line for each:
output ensured unique, while order are not ensured
anything that starts with "_ZFP_" would be ignored
this is useful to use ZFFramework in some script language which has no semantic completion, so that you can use keyword completion by using the tag file
util to make the registration able to be called more than once
by default, dynamic register would fail if contents already exists, that's not very convenient for script languages
to solve this, you may use this method to mark the registration, which would automatically unregister old ones if exists, identified by that regTag
register a event, see also ZFOBSERVER_EVENT ZFOBSERVER_EVENT_GLOBAL
if within class scope (classBegin), YourClassName::EventYourEvent
would be registered, otherwise, YourNamespace::EventYourEvent
would be registered
registered event would include:
ZFDynamic & ZFDynamic::method | ( | const zfchar * | methodReturnTypeId, |
const zfchar * | methodName, | ||
const ZFMP & | methodParam, | ||
const ZFListener & | methodImpl, | ||
ZFMethodType | methodType = ZFMethodTypeVirtual, | ||
ZFMethodPrivilegeType | methodPrivilegeType = ZFMethodPrivilegeTypePublic ) |
see ZFDynamic
util method to register method (global method or class member method), methodImpl's param0 is ZFMethodInvokeData
usage:
|
static |
callbacks which would be called when error occurred
by default, ZFOutputDefault would be attached during ZFFrameworkInit with ZFLevelZFFrameworkNormal