95 ~_ZFP_ZFIdMapHolder(
void);
130#define ZFIDMAP(YourIdName) \
131 ZFIDMAP_DETAIL(Id, YourIdName)
133#define ZFIDMAP_DETAIL(prefix, YourIdName) \
136 static zfidentity prefix##YourIdName(void);
144#define ZFIDMAP_INLINE(YourIdName) \
145 ZFIDMAP_DETAIL_INLINE(Id, YourIdName)
147#define ZFIDMAP_DETAIL_INLINE(prefix, YourIdName) \
149 zfclassNotPOD _ZFP_IdMapReg_##prefix##YourIdName { \
151 _ZFP_IdMapReg_##prefix##YourIdName(void) { \
152 zfself::prefix##YourIdName(); \
154 } _ZFP_IdMap_##prefix##YourIdName; \
156 static zfidentity prefix##YourIdName(void) { \
157 static _ZFP_ZFIdMapHolder d( \
158 zfstr("%s.%s", zfself::ClassData()->classNameFull(), ZFM_TOSTRING(prefix##YourIdName)) \
159 , zfself::ClassData() \
161 , zftext(ZFM_TOSTRING(prefix##YourIdName)) \
163 return *(d.idValue); \
184#define ZFIDMAP_GLOBAL(ZFLIB_, YourIdName) \
185 ZFIDMAP_GLOBAL_DETAIL(ZFLIB_, Id, YourIdName)
187#define ZFIDMAP_GLOBAL_DETAIL(ZFLIB_, prefix, YourIdName) \
189 extern ZFLIB_ zfidentity prefix##YourIdName(void);
192#define ZFIDMAP_REGISTER(Scope, YourIdName) \
193 ZFIDMAP_REGISTER_DETAIL(Scope, Id, YourIdName)
195#define ZFIDMAP_REGISTER_DETAIL(Scope, prefix, YourIdName) \
196 zfidentity Scope::prefix##YourIdName(void) { \
197 static _ZFP_ZFIdMapHolder d( \
198 zfstr("%s.%s", zfself::ClassData()->classNameFull(), ZFM_TOSTRING(prefix##YourIdName)) \
199 , zfself::ClassData() \
201 , zftext(ZFM_TOSTRING(prefix##YourIdName)) \
203 return *(d.idValue); \
205 ZF_STATIC_REGISTER_INIT(ZFIdMap_##Scope##_##YourIdName) { \
206 (void)Scope::prefix##YourIdName(); \
208 ZF_STATIC_REGISTER_END(ZFIdMap_##Scope##_##YourIdName)
211#define ZFIDMAP_GLOBAL_REGISTER(YourIdName) \
212 ZFIDMAP_GLOBAL_REGISTER_DETAIL(Id, YourIdName)
214#define ZFIDMAP_GLOBAL_REGISTER_DETAIL(prefix, YourIdName) \
215 zfidentity prefix##YourIdName(void) { \
216 static _ZFP_ZFIdMapHolder d( \
217 zfstr("%s.%s", ZF_NAMESPACE_CURRENT() ? ZF_NAMESPACE_CURRENT() : "", ZFM_TOSTRING(prefix##YourIdName)) \
219 , ZF_NAMESPACE_CURRENT() \
220 , zftext(ZFM_TOSTRING(prefix##YourIdName)) \
222 return *(d.idValue); \
224 ZF_STATIC_REGISTER_INIT(ZFIdMap_##YourIdName) { \
225 (void)prefix##YourIdName(); \
227 ZF_STATIC_REGISTER_END(ZFIdMap_##YourIdName) \
necessary header file for all types
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
#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:196
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:200
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:212
#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_zfidentity zfidentity
identity type, ensured at least 32 bit, ensured unsigned
Definition ZFCoreTypeDef_CoreType.h:225
#define zffalse
bool false type
Definition ZFCoreTypeDef_CoreType.h:111
#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
zfidentity ZFIdMapIdForName(const zfstring &idName)
get id value from id name, or zfidentityInvalid if no such id name, see ZFIDMAP
void ZFIdMapGetAllIdT(ZFCoreArray< zfidentity > &idValues, const zfstring &filter=zft_zfnull)
see ZFIdMapGetAll
ZFCoreArray< zfstring > ZFIdMapGetAllName(const zfstring &filter=zft_zfnull)
see ZFIdMapGetAll
Definition ZFIdMap.h:67
void ZFIdMapGetAllNameT(ZFCoreArray< zfstring > &idNames, const zfstring &filter=zft_zfnull)
see ZFIdMapGetAll
ZFCoreArray< zfidentity > ZFIdMapGetAllId(const zfstring &filter=zft_zfnull)
see ZFIdMapGetAll
Definition ZFIdMap.h:56
zfidentity ZFIdMapDynamicRegister(const zfstring &idName)
dynamically register your own id
void ZFIdMapDynamicUnregister(zfidentity idValue)
unregister id that was registered by ZFIdMapDynamicRegister
void ZFIdMapGetAll(ZFCoreArray< zfidentity > &idValues, ZFCoreArray< zfstring > &idNames, const zfstring &filter=zft_zfnull)
see ZFIDMAP
zfstring ZFIdMapNameForId(zfidentity idValue)
get id name from id value, or null if no such id, see ZFIdMapIdForName
#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:63
light weight array
Definition ZFCoreArray.h:297