ZFFramework
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
ZFMethod.h File Reference

reflectable method definination for ZFFramework More...

#include "ZFObjectClassTypeFwd.h"
#include "ZFMethodGenericInvoker.h"

Go to the source code of this file.

Classes

class  ZFMethod
 reflectable method for ZFObject More...
 

Macros

#define ZFTOKEN_ZFMethodPrivilegeTypePublic
 string tokens
 
#define ZFTOKEN_ZFMethodPrivilegeTypeProtected
 string tokens
 
#define ZFTOKEN_ZFMethodPrivilegeTypePrivate
 string tokens
 
#define ZFTOKEN_ZFMethodTypeNormal
 string tokens
 
#define ZFTOKEN_ZFMethodTypeStatic
 string tokens
 
#define ZFTOKEN_ZFMethodTypeVirtual
 string tokens
 
#define ZFMP_IN(ParamType, paramName)
 macro to wrap param types for ZFMETHOD_INLINE_0 series
 
#define ZFMP_IN_OPT(ParamType, paramName, DefaultValue)
 see ZFMP_IN
 
#define ZFMP_OUT(ParamType, paramName)
 see ZFMP_IN
 
#define ZFMP_OUT_OPT(ParamType, paramName, DefaultValue)
 see ZFMP_IN
 
#define ZFMP_IN_OUT(ParamType, paramName)
 see ZFMP_IN
 
#define ZFMP_IN_OUT_OPT(ParamType, paramName, DefaultValue)
 see ZFMP_IN
 

Typedefs

typedef zfauto(* ZFMethodParamDefaultValueCallback) (const ZFMethod *invokerMethod, zfindex paramIndex)
 callback to access method param's default value, for method generic invoker
 

Enumerations

enum  ZFMethodPrivilegeType { ZFMethodPrivilegeTypePublic , ZFMethodPrivilegeTypeProtected , ZFMethodPrivilegeTypePrivate }
 access type for ZFMethod More...
 
enum  ZFMethodType { ZFMethodTypeNormal , ZFMethodTypeStatic , ZFMethodTypeVirtual }
 the method type More...
 

Functions

void ZFMethodGetAllT (ZFCoreArray< const ZFMethod * > &ret, const ZFFilterForZFMethod *methodFilter=0)
 see ZFMethodGetAll
 
ZFCoreArray< const ZFMethod * > ZFMethodGetAll (const ZFFilterForZFMethod *methodFilter=0)
 get all method currently registered
 
const ZFMethodZFMethodForName (const zfchar *classNameOrNamespace, const zfchar *methodName)
 util method to find method
 
const ZFMethodZFMethodForName (const zfchar *classNameOrNamespace, const zfchar *methodName, const zfchar *methodParamTypeId0, const zfchar *methodParamTypeId1=0, const zfchar *methodParamTypeId2=0, const zfchar *methodParamTypeId3=0, const zfchar *methodParamTypeId4=0, const zfchar *methodParamTypeId5=0, const zfchar *methodParamTypeId6=0, const zfchar *methodParamTypeId7=0)
 see ZFMethodForName
 
void ZFMethodForNameGetAllT (ZFCoreArray< const ZFMethod * > &ret, const zfchar *classNameOrNamespace, const zfchar *methodName)
 util method to find method, see ZFMethodForName
 
ZFCoreArray< const ZFMethod * > ZFMethodForNameGetAll (const zfchar *classNameOrNamespace, const zfchar *methodName)
 see ZFMethodForNameGetAllT
 
const ZFMethodZFMethodAlias (const ZFMethod *method, const zfchar *aliasName)
 create new ZFMethod and alias to existing method
 
void ZFMethodAliasRemove (const ZFMethod *aliasMethod)
 see ZFMethodAlias
 

Detailed Description

reflectable method definination for ZFFramework

Macro Definition Documentation

◆ ZFMP_IN

#define ZFMP_IN ( ParamType,
paramName )

macro to wrap param types for ZFMETHOD_INLINE_0 series

similar to ZF_IN for normal methods, here's a list of these macros used for ZFMETHOD_INLINE_0 series:

Enumeration Type Documentation

◆ ZFMethodPrivilegeType

access type for ZFMethod

Enumerator
ZFMethodPrivilegeTypePublic 

public

ZFMethodPrivilegeTypeProtected 

protected

ZFMethodPrivilegeTypePrivate 

private

◆ ZFMethodType

the method type

Enumerator
ZFMethodTypeNormal 

normal method

ZFMethodTypeStatic 

static method

ZFMethodTypeVirtual 

virtual method

Function Documentation

◆ ZFMethodGetAll()

ZFCoreArray< const ZFMethod * > ZFMethodGetAll ( const ZFFilterForZFMethod * methodFilter = 0)
inline

get all method currently registered

note, this method may cause performance issue if you have many method registered, use with caution
use ZFClass::methodForName or ZFMethodFuncForName if necessary

◆ ZFMethodForName()

const ZFMethod * ZFMethodForName ( const zfchar * classNameOrNamespace,
const zfchar * methodName )
extern

util method to find method

method can be class member or function type method, return first registered one if more than one method found, use ZFMethodForNameGetAll to check if you have overloaded method, use ZFMethodFuncForName to explicitly find function type method

◆ ZFMethodAlias()

const ZFMethod * ZFMethodAlias ( const ZFMethod * method,
const zfchar * aliasName )
extern

create new ZFMethod and alias to existing method

ZFMETHOD_DECLARE_0(void, foo)
};
ZFMETHOD_DEFINE_0(MyClass, void, foo) {
zfLogTrim() << "foo()";
}
ZFMethodAlias(ZFMethodAccess(MyClass, foo), "bar");
zfLogTrim() << MyClass::ClassData()->methodForName("foo");
zfLogTrim() << MyClass::ClassData()->methodForName("bar");
obj->invoke("foo");
obj->invoke("bar");
#define zfextend
dummy macro shows class inherit from another
Definition ZFCoreTypeDef_ClassType.h:53
#define zfLogTrim(...)
see zfLog
Definition ZFLog.h:67
const ZFMethod * ZFMethodAlias(const ZFMethod *method, const zfchar *aliasName)
create new ZFMethod and alias to existing method
#define ZFMETHOD_DECLARE_0(ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:693
#define ZFMethodAccess(OwnerClass, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:16
#define ZFMETHOD_DEFINE_0(OwnerClass, ReturnType, MethodName)
see ZFMethod
Definition ZFMethodDeclare.h:821
#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 ZFOBJECT_REGISTER(T_ZFObject,...)
register ZFObject to ZFClass map
Definition ZFObjectDeclare.h:204
base class of all objects
Definition ZFObjectCore.h:209
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:164
See also
ZFClassAlias