ZFFramework
 
Loading...
Searching...
No Matches
ZFMethodDynamicRegister.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFMethodDynamicRegister_h_
7#define _ZFI_ZFMethodDynamicRegister_h_
8
9#include "ZFMethod.h"
11
12// ============================================================
52 , ZF_OUT_OPT zfstring *errorHint = zfnull
53 );
58 ZF_IN const ZFClass *ownerClass
59 , ZF_IN const zfstring &returnTypeId
60 , ZF_IN const zfstring &methodName
61 , ZF_IN const ZFMP &methodParam
62 , ZF_IN const ZFListener &methodImpl
65 , ZF_OUT_OPT zfstring *errorHint = zfnull
66 );
71 ZF_IN const zfstring &methodNamespace
72 , ZF_IN const zfstring &returnTypeId
73 , ZF_IN const zfstring &methodName
74 , ZF_IN const ZFMP &methodParam
75 , ZF_IN const ZFListener &methodImpl
78 , ZF_OUT_OPT zfstring *errorHint = zfnull
79 );
84
85// ============================================================
86/* ZFMETHOD_MAX_PARAM */
87zfclassFwd _ZFP_ZFMethodDynamicRegisterParamPrivate;
103public:
108
112 const ZFClass *ownerClass(void) const;
113
117 const zfstring &methodNamespace(void) const;
118
123
127 const ZFListener &methodImpl(void) const;
128
133
138
142 const zfstring &methodName(void) const;
143
147 const zfstring &returnTypeId(void) const;
148
151 ZF_IN const zfstring &paramTypeId
152 , ZF_IN_OPT const zfstring &paramName = zfnull
153 , ZF_IN_OPT const ZFListener &paramDefaultValueCallback = _ZFP_ZFMethod_paramDefaultValueCallbackDummy()
154 );
156 zfindex paramCount(void) const;
158 const zfstring &paramTypeIdAt(ZF_IN zfindex index) const;
160 const zfstring &paramNameAt(ZF_IN zfindex index) const;
163
164public:
169
170public:
175 zfstring ret;
176 this->objectInfoT(ret);
177 return ret;
178 }
179
180public:
186 zfbool operator == (ZF_IN ZFMethodDynamicRegisterParam const &ref) const;
187 zfbool operator != (ZF_IN ZFMethodDynamicRegisterParam const &ref) const {return !this->operator == (ref);}
189
190private:
191 _ZFP_ZFMethodDynamicRegisterParamPrivate *d;
192};
193
194// ============================================================
195zfclassFwd _ZFP_ZFMPPrivate;
198public:
201 ZF_IN const zfstring &paramTypeId
202 , ZF_IN_OPT const zfstring &paramName = zfnull
203 );
206 ZF_IN const zfstring &paramTypeId
207 , ZF_IN const zfstring &paramName
208 , ZF_IN ZFObject *paramDefaultValue
209 );
212 ZF_IN const zfstring &paramTypeId
213 , ZF_IN const zfstring &paramName
214 , ZF_IN const ZFListener &paramDefaultValueCallback
215 );
216
217public:
219 zfindex paramCount(void) const;
221 const zfstring &paramTypeIdAt(ZF_IN zfindex index) const;
223 const zfstring &paramNameAt(ZF_IN zfindex index) const;
226
227
228public:
233 zfstring ret;
234 this->methodParamListInfoT(ret);
235 return ret;
236 }
237
238public:
243 zfstring ret;
244 this->objectInfoT(ret);
245 return ret;
246 }
247
248public:
250 ZFMP(void);
251 ZFMP(ZF_IN const ZFMP &ref);
252 ~ZFMP(void);
253 ZFMP &operator = (ZF_IN const ZFMP &ref);
254 zfbool operator == (ZF_IN const ZFMP &ref) const {return d == ref.d;}
255 zfbool operator != (ZF_IN const ZFMP &ref) const {return d != ref.d;}
257
258private:
259 _ZFP_ZFMPPrivate *d;
260};
261
263#endif // #ifndef _ZFI_ZFMethodDynamicRegister_h_
264
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#define ZF_OUT_OPT
dummy macro that shows the param used as optional output
Definition ZFCoreTypeDef_ClassType.h:192
#define zffinal
dummy macro shows that a method or class is designed must not to be overrided
Definition ZFCoreTypeDef_ClassType.h:63
#define zfclassLikePOD
shows the class is not a POD type, but you may use it like a POD except memset it to 0
Definition ZFCoreTypeDef_ClassType.h:41
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
#define zfclassFwd
forward declaration of a class type
Definition ZFCoreTypeDef_ClassType.h:31
_ZFT_t_zfbool zfbool
bool type
Definition ZFCoreTypeDef_CoreType.h:103
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:88
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
reflectable method definination for ZFFramework
ZFMethodType
the method type
Definition ZFMethod.h:43
@ ZFMethodTypeVirtual
virtual method
Definition ZFMethod.h:46
ZFMethodAccessType
access type for ZFMethod
Definition ZFMethod.h:17
@ ZFMethodAccessTypePublic
public
Definition ZFMethod.h:18
const ZFMethod * ZFMethodDynamicRegister(const ZFMethodDynamicRegisterParam &param, zfstring *errorHint=zft_zfnull)
dynamic register a method, return null if fail
void ZFMethodDynamicUnregister(const ZFMethod *method)
see ZFMethodDynamicRegister
void(* ZFMethodGenericInvoker)(const ZFArgs &zfargs)
generic invoker for advanced reflection, see ZFMethod::methodGenericInvoker
Definition ZFMethodGenericInvoker.h:24
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
ZFObject's class info.
Definition ZFClass.h:67
listener as ZFCallback, mostly used by ZFObject::observerNotify
Definition ZFObjectObserver.h:30
util for ZFDynamic::method
Definition ZFMethodDynamicRegister.h:197
zfstring methodParamListInfo(void) const
return method param info, like: P0 p0, P1 p1=def1
Definition ZFMethodDynamicRegister.h:232
ZFMP & mp(const zfstring &paramTypeId, const zfstring &paramName, ZFObject *paramDefaultValue)
util for ZFDynamic::method
ZFMP & mpWithInit(const zfstring &paramTypeId, const zfstring &paramName, const ZFListener &paramDefaultValueCallback)
util for ZFDynamic::method
const ZFListener & paramDefaultValueCallbackAt(zfindex index) const
util for ZFDynamic::method
const zfstring & paramTypeIdAt(zfindex index) const
util for ZFDynamic::method
ZFMP & mp(const zfstring &paramTypeId, const zfstring &paramName=zft_zfnull)
util for ZFDynamic::method
void methodParamListInfoT(zfstring &ret) const
see methodParamListInfo
void objectInfoT(zfstring &ret) const
see objectInfo
zfindex paramCount(void) const
util for ZFDynamic::method
const zfstring & paramNameAt(zfindex index) const
util for ZFDynamic::method
zfstring objectInfo(void) const
return object info
Definition ZFMethodDynamicRegister.h:242
param for ZFMethodDynamicRegister
Definition ZFMethodDynamicRegister.h:102
ZFMethodDynamicRegisterParam & methodAccessType(ZFMethodAccessType methodAccessType)
see ZFMethodDynamicRegister
const ZFListener & paramDefaultValueCallbackAt(zfindex index) const
see ZFMethodDynamicRegister
ZFMethodDynamicRegisterParam & methodType(ZFMethodType methodType)
see ZFMethodDynamicRegister
const zfstring & paramNameAt(zfindex index) const
see ZFMethodDynamicRegister
ZFMethodDynamicRegisterParam & methodParam(const zfstring &paramTypeId, const zfstring &paramName=zft_zfnull, const ZFListener &paramDefaultValueCallback=_ZFP_ZFMethod_paramDefaultValueCallbackDummy())
see ZFMethodDynamicRegister
const ZFListener & methodImpl(void) const
see ZFMethodDynamicRegister
zfany dynamicRegisterUserData(void) const
see ZFMethodDynamicRegister
ZFMethodDynamicRegisterParam & zfunsafe_disableChecker(zfbool disableChecker)
see ZFMethodDynamicRegister
void objectInfoT(zfstring &ret) const
see objectInfo
ZFMethodDynamicRegisterParam & methodGenericInvoker(ZFMethodGenericInvoker methodGenericInvoker)
see ZFMethodDynamicRegister, ZFMethodGenericInvokerParamsCheck
zfstring objectInfo(void) const
return object info
Definition ZFMethodDynamicRegister.h:174
ZFMethodDynamicRegisterParam & methodImpl(const ZFListener &methodImpl)
see ZFMethodDynamicRegister
const zfstring & methodNamespace(void) const
see ZFMethodDynamicRegister
ZFMethodAccessType methodAccessType(void) const
see ZFMethodDynamicRegister
ZFMethodDynamicRegisterParam & dynamicRegisterUserData(ZFObject *dynamicRegisterUserData)
see ZFMethodDynamicRegister
zfindex paramCount(void) const
see ZFMethodDynamicRegister
zfbool zfunsafe_disableChecker(void) const
see ZFMethodDynamicRegister
ZFMethodType methodType(void) const
see ZFMethodDynamicRegister
const zfstring & paramTypeIdAt(zfindex index) const
see ZFMethodDynamicRegister
ZFMethodDynamicRegisterParam & returnTypeId(const zfstring &returnTypeId)
see ZFMethodDynamicRegister
const ZFClass * ownerClass(void) const
see ZFMethodDynamicRegister
ZFMethodDynamicRegisterParam & ownerClass(const ZFClass *ownerClass)
see ZFMethodDynamicRegister
const zfstring & returnTypeId(void) const
see ZFMethodDynamicRegister
const zfstring & methodName(void) const
see ZFMethodDynamicRegister
ZFMethodGenericInvoker methodGenericInvoker(void) const
see ZFMethodDynamicRegister
ZFMethodDynamicRegisterParam & methodNamespace(const zfstring &methodNamespace)
see ZFMethodDynamicRegister
ZFMethodDynamicRegisterParam & methodName(const zfstring &methodName)
see ZFMethodDynamicRegister
reflectable method for ZFObject
Definition ZFMethod.h:252
base class of all objects
Definition ZFObjectCore.h:209
util method to cast ZFObject types freely
Definition zfany.h:35