ZFFramework
 
Loading...
Searching...
No Matches
ZFCoreUtilMacro.h
Go to the documentation of this file.
1
5#ifndef _ZFI_ZFCoreUtilMacro_h_
6#define _ZFI_ZFCoreUtilMacro_h_
7
8#include "ZFCoreTypeDef.h"
9
11
12// ============================================================
16#define ZFBitTest(var, bit) (((var) & (bit)) != 0)
20#define ZFBitTestAll(var, bit) (((var) & (bit)) == (bit))
24#define ZFBitGet(var, bit) ((var) & (bit))
28#define ZFBitSet(var, bit) ((var) |= (bit))
32#define ZFBitUnset(var, bit) ((var) &= (~(bit)))
33
34// ============================================================
48#define ZF_HINT(...)
49
50// ============================================================
51#define _ZFP_ZFM_REPEAT_0(Type, LeftCommaFix, CenterCommaFix)
52#define _ZFP_ZFM_REPEAT_1(Type, LeftCommaFix, CenterCommaFix) LeftCommaFix() Type(0)
53#define _ZFP_ZFM_REPEAT_2(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_1(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(1)
54#define _ZFP_ZFM_REPEAT_3(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_2(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(2)
55#define _ZFP_ZFM_REPEAT_4(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_3(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(3)
56#define _ZFP_ZFM_REPEAT_5(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_4(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(4)
57#define _ZFP_ZFM_REPEAT_6(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_5(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(5)
58#define _ZFP_ZFM_REPEAT_7(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_6(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(6)
59#define _ZFP_ZFM_REPEAT_8(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_7(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(7)
60#define _ZFP_ZFM_REPEAT_9(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_8(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(8)
61#define _ZFP_ZFM_REPEAT_10(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_9(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(9)
62#define _ZFP_ZFM_REPEAT_11(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_10(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(10)
63#define _ZFP_ZFM_REPEAT_12(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_11(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(11)
64#define _ZFP_ZFM_REPEAT_13(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_12(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(12)
65#define _ZFP_ZFM_REPEAT_14(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_13(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(13)
66#define _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_14(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(14)
67#define _ZFP_ZFM_REPEAT_16(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(15)
68#define _ZFP_ZFM_REPEAT_17(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(16)
69#define _ZFP_ZFM_REPEAT_18(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(17)
70#define _ZFP_ZFM_REPEAT_19(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(18)
71#define _ZFP_ZFM_REPEAT_20(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(19)
72#define _ZFP_ZFM_REPEAT_21(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(20)
73#define _ZFP_ZFM_REPEAT_22(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(21)
74#define _ZFP_ZFM_REPEAT_23(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(22)
75#define _ZFP_ZFM_REPEAT_24(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(23)
76#define _ZFP_ZFM_REPEAT_25(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(24)
77#define _ZFP_ZFM_REPEAT_26(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(25)
78#define _ZFP_ZFM_REPEAT_27(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(26)
79#define _ZFP_ZFM_REPEAT_28(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(27)
80#define _ZFP_ZFM_REPEAT_29(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(28)
81#define _ZFP_ZFM_REPEAT_30(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(29)
82#define _ZFP_ZFM_REPEAT_31(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(30)
83#define _ZFP_ZFM_REPEAT_32(Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_15(Type, LeftCommaFix, CenterCommaFix) CenterCommaFix() Type(31)
84#define _ZFP_ZFM_REPEAT(N, Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT_##N(Type, LeftCommaFix, CenterCommaFix)
97#define ZFM_REPEAT(N, Type, LeftCommaFix, CenterCommaFix) _ZFP_ZFM_REPEAT(N, Type, LeftCommaFix, CenterCommaFix)
98
99#define _ZFP_ZFM_REPEAT_TEMPLATE(N) typename Type##N
100#define _ZFP_ZFM_REPEAT_TYPE(N) Type##N
101#define _ZFP_ZFM_REPEAT_TYPE_CONST(N) Type##N const &
102#define _ZFP_ZFM_REPEAT_NAME(N) param##N
103#define _ZFP_ZFM_REPEAT_PARAM(N) Type##N param##N
104
108#define ZFM_REPEAT_TEMPLATE(N) _ZFP_ZFM_REPEAT_TEMPLATE(N)
112#define ZFM_REPEAT_TYPE(N) _ZFP_ZFM_REPEAT_TYPE(N)
116#define ZFM_REPEAT_TYPE_CONST(N) _ZFP_ZFM_REPEAT_TYPE_CONST(N)
120#define ZFM_REPEAT_NAME(N) _ZFP_ZFM_REPEAT_NAME(N)
124#define ZFM_REPEAT_PARAM(N) _ZFP_ZFM_REPEAT_PARAM(N)
125
126// ============================================================
130#define ZFM_BRACKET_L() (
134#define ZFM_BRACKET_R() )
135
139#define ZFM_EMPTY(...)
143#define ZFM_COMMA() ,
144
148#define ZFM_EXPAND(...) __VA_ARGS__
149
153#define ZFM_CAT(a, b) _ZFP_ZFM_CAT(a, b)
154#define _ZFP_ZFM_CAT(a, b) a##b
155
159#define ZFM_TOSTRING(a) _ZFP_ZFM_TOSTRING(a)
160#define _ZFP_ZFM_TOSTRING(a) #a
161
162// ============================================================
163#define _ZFP_ZFM_N_INC_T(n) _ZFP_ZFM_N_INC_##n
164#define _ZFP_ZFM_N_INC_0 1
165#define _ZFP_ZFM_N_INC_1 2
166#define _ZFP_ZFM_N_INC_2 3
167#define _ZFP_ZFM_N_INC_3 4
168#define _ZFP_ZFM_N_INC_4 5
169#define _ZFP_ZFM_N_INC_5 6
170#define _ZFP_ZFM_N_INC_6 7
171#define _ZFP_ZFM_N_INC_7 8
172#define _ZFP_ZFM_N_INC_8 9
173#define _ZFP_ZFM_N_INC_9 10
174#define _ZFP_ZFM_N_INC_10 11
175#define _ZFP_ZFM_N_INC_11 12
176#define _ZFP_ZFM_N_INC_12 13
177#define _ZFP_ZFM_N_INC_13 14
178#define _ZFP_ZFM_N_INC_14 15
179#define _ZFP_ZFM_N_INC_15 16
180#define _ZFP_ZFM_N_INC_16 17
181#define _ZFP_ZFM_N_INC_17 18
182#define _ZFP_ZFM_N_INC_18 19
183#define _ZFP_ZFM_N_INC_19 20
184#define _ZFP_ZFM_N_INC_20 21
185#define _ZFP_ZFM_N_INC_21 22
186#define _ZFP_ZFM_N_INC_22 23
187#define _ZFP_ZFM_N_INC_23 24
188#define _ZFP_ZFM_N_INC_24 25
189#define _ZFP_ZFM_N_INC_25 26
190#define _ZFP_ZFM_N_INC_26 27
191#define _ZFP_ZFM_N_INC_27 28
192#define _ZFP_ZFM_N_INC_28 29
193#define _ZFP_ZFM_N_INC_29 30
194#define _ZFP_ZFM_N_INC_30 31
195#define _ZFP_ZFM_N_INC_31 32
199#define ZFM_N_INC(n) _ZFP_ZFM_N_INC_T(n)
200
201#define _ZFP_ZFM_N_DEC_T(n) _ZFP_ZFM_N_DEC_##n
202#define _ZFP_ZFM_N_DEC_0 -1
203#define _ZFP_ZFM_N_DEC_1 0
204#define _ZFP_ZFM_N_DEC_2 1
205#define _ZFP_ZFM_N_DEC_3 2
206#define _ZFP_ZFM_N_DEC_4 3
207#define _ZFP_ZFM_N_DEC_5 4
208#define _ZFP_ZFM_N_DEC_6 5
209#define _ZFP_ZFM_N_DEC_7 6
210#define _ZFP_ZFM_N_DEC_8 7
211#define _ZFP_ZFM_N_DEC_9 8
212#define _ZFP_ZFM_N_DEC_10 9
213#define _ZFP_ZFM_N_DEC_11 10
214#define _ZFP_ZFM_N_DEC_12 11
215#define _ZFP_ZFM_N_DEC_13 12
216#define _ZFP_ZFM_N_DEC_14 13
217#define _ZFP_ZFM_N_DEC_15 14
218#define _ZFP_ZFM_N_DEC_16 15
219#define _ZFP_ZFM_N_DEC_17 16
220#define _ZFP_ZFM_N_DEC_18 17
221#define _ZFP_ZFM_N_DEC_19 18
222#define _ZFP_ZFM_N_DEC_20 19
223#define _ZFP_ZFM_N_DEC_21 20
224#define _ZFP_ZFM_N_DEC_22 21
225#define _ZFP_ZFM_N_DEC_23 22
226#define _ZFP_ZFM_N_DEC_24 23
227#define _ZFP_ZFM_N_DEC_25 24
228#define _ZFP_ZFM_N_DEC_26 25
229#define _ZFP_ZFM_N_DEC_27 26
230#define _ZFP_ZFM_N_DEC_28 27
231#define _ZFP_ZFM_N_DEC_29 28
232#define _ZFP_ZFM_N_DEC_30 29
233#define _ZFP_ZFM_N_DEC_31 30
234#define _ZFP_ZFM_N_DEC_32 31
238#define ZFM_N_DEC(n) _ZFP_ZFM_N_DEC_T(n)
239
240#define _ZFP_ZFM_PARAM_EXPAND(...) __VA_ARGS__
254#define ZFM_PARAM_NUM(...) \
255 _ZFP_ZFM_PARAM_EXPAND(_ZFP_ZFM_PARAM_NUM_TMP0(__VA_ARGS__, _ZFP_ZFM_PARAM_NUM_TMP2()))
256#define _ZFP_ZFM_PARAM_NUM_TMP0(...) \
257 _ZFP_ZFM_PARAM_EXPAND(_ZFP_ZFM_PARAM_NUM_TMP1(__VA_ARGS__))
258#define _ZFP_ZFM_PARAM_NUM_TMP1(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, N, ...) \
259 N
260#define _ZFP_ZFM_PARAM_NUM_TMP2() \
261 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
262
278#define ZFM_FIX_PARAM(ParamFix, commaFix, ...) \
279 _ZFP_ZFM_FIX_PARAM_CALL_01(_ZFP_ZFM_FIX_PARAM_N(_0, ##__VA_ARGS__ \
280 , _ZFP_ZFM_FIX_PARAM_E_33, _ZFP_ZFM_FIX_PARAM_E_32, _ZFP_ZFM_FIX_PARAM_E_31, _ZFP_ZFM_FIX_PARAM_E_30 \
281 , _ZFP_ZFM_FIX_PARAM_E_29, _ZFP_ZFM_FIX_PARAM_E_28, _ZFP_ZFM_FIX_PARAM_E_27, _ZFP_ZFM_FIX_PARAM_E_26, _ZFP_ZFM_FIX_PARAM_E_25 \
282 , _ZFP_ZFM_FIX_PARAM_E_24, _ZFP_ZFM_FIX_PARAM_E_23, _ZFP_ZFM_FIX_PARAM_E_22, _ZFP_ZFM_FIX_PARAM_E_21, _ZFP_ZFM_FIX_PARAM_E_20 \
283 , _ZFP_ZFM_FIX_PARAM_E_19, _ZFP_ZFM_FIX_PARAM_E_18, _ZFP_ZFM_FIX_PARAM_E_17, _ZFP_ZFM_FIX_PARAM_E_16, _ZFP_ZFM_FIX_PARAM_E_15 \
284 , _ZFP_ZFM_FIX_PARAM_E_14, _ZFP_ZFM_FIX_PARAM_E_13, _ZFP_ZFM_FIX_PARAM_E_12, _ZFP_ZFM_FIX_PARAM_E_11, _ZFP_ZFM_FIX_PARAM_E_10 \
285 , _ZFP_ZFM_FIX_PARAM_E_09, _ZFP_ZFM_FIX_PARAM_E_08, _ZFP_ZFM_FIX_PARAM_E_07, _ZFP_ZFM_FIX_PARAM_E_06, _ZFP_ZFM_FIX_PARAM_E_05 \
286 , _ZFP_ZFM_FIX_PARAM_E_04, _ZFP_ZFM_FIX_PARAM_E_03, _ZFP_ZFM_FIX_PARAM_E_02, _ZFP_ZFM_FIX_PARAM_E_01, _ZFP_ZFM_FIX_PARAM_E_00 \
287 ), (ParamFix, commaFix, ##__VA_ARGS__))
288
289#define _ZFP_ZFM_FIX_PARAM_CALL_01(C, v) C v
290#define _ZFP_ZFM_FIX_PARAM_CALL_02(C, v) C v
291#define _ZFP_ZFM_FIX_PARAM_CALL_03(C, v) C v
292#define _ZFP_ZFM_FIX_PARAM_CALL_04(C, v) C v
293#define _ZFP_ZFM_FIX_PARAM_CALL_04(C, v) C v
294#define _ZFP_ZFM_FIX_PARAM_CALL_05(C, v) C v
295#define _ZFP_ZFM_FIX_PARAM_CALL_06(C, v) C v
296#define _ZFP_ZFM_FIX_PARAM_CALL_07(C, v) C v
297#define _ZFP_ZFM_FIX_PARAM_CALL_08(C, v) C v
298#define _ZFP_ZFM_FIX_PARAM_CALL_09(C, v) C v
299#define _ZFP_ZFM_FIX_PARAM_CALL_10(C, v) C v
300#define _ZFP_ZFM_FIX_PARAM_CALL_11(C, v) C v
301#define _ZFP_ZFM_FIX_PARAM_CALL_12(C, v) C v
302#define _ZFP_ZFM_FIX_PARAM_CALL_13(C, v) C v
303#define _ZFP_ZFM_FIX_PARAM_CALL_14(C, v) C v
304#define _ZFP_ZFM_FIX_PARAM_CALL_15(C, v) C v
305#define _ZFP_ZFM_FIX_PARAM_CALL_16(C, v) C v
306#define _ZFP_ZFM_FIX_PARAM_CALL_17(C, v) C v
307#define _ZFP_ZFM_FIX_PARAM_CALL_18(C, v) C v
308#define _ZFP_ZFM_FIX_PARAM_CALL_19(C, v) C v
309#define _ZFP_ZFM_FIX_PARAM_CALL_20(C, v) C v
310#define _ZFP_ZFM_FIX_PARAM_CALL_21(C, v) C v
311#define _ZFP_ZFM_FIX_PARAM_CALL_22(C, v) C v
312#define _ZFP_ZFM_FIX_PARAM_CALL_23(C, v) C v
313#define _ZFP_ZFM_FIX_PARAM_CALL_24(C, v) C v
314#define _ZFP_ZFM_FIX_PARAM_CALL_25(C, v) C v
315#define _ZFP_ZFM_FIX_PARAM_CALL_26(C, v) C v
316#define _ZFP_ZFM_FIX_PARAM_CALL_27(C, v) C v
317#define _ZFP_ZFM_FIX_PARAM_CALL_28(C, v) C v
318#define _ZFP_ZFM_FIX_PARAM_CALL_29(C, v) C v
319#define _ZFP_ZFM_FIX_PARAM_CALL_30(C, v) C v
320#define _ZFP_ZFM_FIX_PARAM_CALL_31(C, v) C v
321#define _ZFP_ZFM_FIX_PARAM_CALL_32(C, v) C v
322
323#define _ZFP_ZFM_FIX_PARAM_E_00()
324#define _ZFP_ZFM_FIX_PARAM_E_01(ParamFix, commaFix, a, ...) ParamFix(a)
325#define _ZFP_ZFM_FIX_PARAM_E_02(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_02(_ZFP_ZFM_FIX_PARAM_E_01, (ParamFix, commaFix, ##__VA_ARGS__))
326#define _ZFP_ZFM_FIX_PARAM_E_03(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_03(_ZFP_ZFM_FIX_PARAM_E_02, (ParamFix, commaFix, ##__VA_ARGS__))
327#define _ZFP_ZFM_FIX_PARAM_E_04(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_04(_ZFP_ZFM_FIX_PARAM_E_03, (ParamFix, commaFix, ##__VA_ARGS__))
328#define _ZFP_ZFM_FIX_PARAM_E_05(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_05(_ZFP_ZFM_FIX_PARAM_E_04, (ParamFix, commaFix, ##__VA_ARGS__))
329#define _ZFP_ZFM_FIX_PARAM_E_06(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_06(_ZFP_ZFM_FIX_PARAM_E_05, (ParamFix, commaFix, ##__VA_ARGS__))
330#define _ZFP_ZFM_FIX_PARAM_E_07(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_07(_ZFP_ZFM_FIX_PARAM_E_06, (ParamFix, commaFix, ##__VA_ARGS__))
331#define _ZFP_ZFM_FIX_PARAM_E_08(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_08(_ZFP_ZFM_FIX_PARAM_E_07, (ParamFix, commaFix, ##__VA_ARGS__))
332#define _ZFP_ZFM_FIX_PARAM_E_09(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_09(_ZFP_ZFM_FIX_PARAM_E_08, (ParamFix, commaFix, ##__VA_ARGS__))
333#define _ZFP_ZFM_FIX_PARAM_E_10(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_10(_ZFP_ZFM_FIX_PARAM_E_09, (ParamFix, commaFix, ##__VA_ARGS__))
334#define _ZFP_ZFM_FIX_PARAM_E_11(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_11(_ZFP_ZFM_FIX_PARAM_E_10, (ParamFix, commaFix, ##__VA_ARGS__))
335#define _ZFP_ZFM_FIX_PARAM_E_12(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_12(_ZFP_ZFM_FIX_PARAM_E_11, (ParamFix, commaFix, ##__VA_ARGS__))
336#define _ZFP_ZFM_FIX_PARAM_E_13(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_13(_ZFP_ZFM_FIX_PARAM_E_12, (ParamFix, commaFix, ##__VA_ARGS__))
337#define _ZFP_ZFM_FIX_PARAM_E_14(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_14(_ZFP_ZFM_FIX_PARAM_E_13, (ParamFix, commaFix, ##__VA_ARGS__))
338#define _ZFP_ZFM_FIX_PARAM_E_15(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_15(_ZFP_ZFM_FIX_PARAM_E_14, (ParamFix, commaFix, ##__VA_ARGS__))
339#define _ZFP_ZFM_FIX_PARAM_E_16(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_16(_ZFP_ZFM_FIX_PARAM_E_15, (ParamFix, commaFix, ##__VA_ARGS__))
340#define _ZFP_ZFM_FIX_PARAM_E_17(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_17(_ZFP_ZFM_FIX_PARAM_E_16, (ParamFix, commaFix, ##__VA_ARGS__))
341#define _ZFP_ZFM_FIX_PARAM_E_18(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_18(_ZFP_ZFM_FIX_PARAM_E_17, (ParamFix, commaFix, ##__VA_ARGS__))
342#define _ZFP_ZFM_FIX_PARAM_E_19(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_19(_ZFP_ZFM_FIX_PARAM_E_18, (ParamFix, commaFix, ##__VA_ARGS__))
343#define _ZFP_ZFM_FIX_PARAM_E_20(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_20(_ZFP_ZFM_FIX_PARAM_E_19, (ParamFix, commaFix, ##__VA_ARGS__))
344#define _ZFP_ZFM_FIX_PARAM_E_21(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_21(_ZFP_ZFM_FIX_PARAM_E_20, (ParamFix, commaFix, ##__VA_ARGS__))
345#define _ZFP_ZFM_FIX_PARAM_E_22(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_22(_ZFP_ZFM_FIX_PARAM_E_21, (ParamFix, commaFix, ##__VA_ARGS__))
346#define _ZFP_ZFM_FIX_PARAM_E_23(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_23(_ZFP_ZFM_FIX_PARAM_E_22, (ParamFix, commaFix, ##__VA_ARGS__))
347#define _ZFP_ZFM_FIX_PARAM_E_24(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_24(_ZFP_ZFM_FIX_PARAM_E_23, (ParamFix, commaFix, ##__VA_ARGS__))
348#define _ZFP_ZFM_FIX_PARAM_E_25(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_25(_ZFP_ZFM_FIX_PARAM_E_24, (ParamFix, commaFix, ##__VA_ARGS__))
349#define _ZFP_ZFM_FIX_PARAM_E_26(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_26(_ZFP_ZFM_FIX_PARAM_E_25, (ParamFix, commaFix, ##__VA_ARGS__))
350#define _ZFP_ZFM_FIX_PARAM_E_27(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_27(_ZFP_ZFM_FIX_PARAM_E_26, (ParamFix, commaFix, ##__VA_ARGS__))
351#define _ZFP_ZFM_FIX_PARAM_E_28(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_28(_ZFP_ZFM_FIX_PARAM_E_27, (ParamFix, commaFix, ##__VA_ARGS__))
352#define _ZFP_ZFM_FIX_PARAM_E_29(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_29(_ZFP_ZFM_FIX_PARAM_E_28, (ParamFix, commaFix, ##__VA_ARGS__))
353#define _ZFP_ZFM_FIX_PARAM_E_30(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_30(_ZFP_ZFM_FIX_PARAM_E_29, (ParamFix, commaFix, ##__VA_ARGS__))
354#define _ZFP_ZFM_FIX_PARAM_E_31(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_31(_ZFP_ZFM_FIX_PARAM_E_30, (ParamFix, commaFix, ##__VA_ARGS__))
355#define _ZFP_ZFM_FIX_PARAM_E_32(ParamFix, commaFix, a, ...) ParamFix(a) commaFix() _ZFP_ZFM_FIX_PARAM_CALL_32(_ZFP_ZFM_FIX_PARAM_E_31, (ParamFix, commaFix, ##__VA_ARGS__))
356#define _ZFP_ZFM_FIX_PARAM_E_33(...) ERROR: supports up to 32 arguments
357
358#define _ZFP_ZFM_FIX_PARAM_N( \
359 _00,_01,_02,_03,_04,_05,_06,_07,_08,_09 \
360 ,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19 \
361 ,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29 \
362 ,_30,_31,_32,_33 \
363 , NAME, ...) NAME
364
365// ============================================================
369#define ZFM_VA_APPEND(ToExpand, ToAppend, ...) \
370 _ZFP_ZFM_VA_APPEND(ToExpand, _ZFP_ZFM_VA_APPEND_RM_FIRST(dummy, ##__VA_ARGS__, ToAppend))
371#define _ZFP_ZFM_VA_APPEND_CALL(M, P) M P
372#define _ZFP_ZFM_VA_APPEND_RM_FIRST(first, ...) __VA_ARGS__
373#define _ZFP_ZFM_VA_APPEND(ToExpand, ...) _ZFP_ZFM_VA_APPEND_CALL(ToExpand, (__VA_ARGS__))
374
375// ============================================================
376#define _ZFP_zfidentityHash_EXPAND(v) (zfidentity)(v)
377#define _ZFP_zfidentityHash_COMMA() ^
381#define zfidentityHash(hash, ...) \
382 (zfidentity)(ZFM_FIX_PARAM(_ZFP_zfidentityHash_EXPAND, _ZFP_zfidentityHash_COMMA, hash, ##__VA_ARGS__))
383
384// ============================================================
388#define ZFUNUSED(v) ((void)(v))
389
390// ============================================================
394#define ZFM_ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
395
396// ============================================================
435#define ZFUniqueName(name) _ZFP_ZFUniqueName2(name, __LINE__)
436#define _ZFP_ZFUniqueName2(name, line) _ZFP_ZFUniqueName3(name, line)
437#define _ZFP_ZFUniqueName3(name, line) _ZFP_uniq_##name##_##line
438
439// ============================================================
473#define ZFM_CLASS_HAS_MEMBER_DECLARE(NameSpace, memberName, memberSig) \
474 \
475 template<typename T_Owner> \
476 zfclassNotPOD _ZFP_ClsHM_##NameSpace##_##memberName { \
477 private: \
478 template <typename T, memberSig> struct _Fix {}; \
479 template<typename T> static char _has(_Fix<T, &T::memberName> *); \
480 template<typename T> static int _has(...); \
481 public: \
482 enum { value = (sizeof(_has<T_Owner>(0)) == sizeof(char) ? 1 : 0) }; \
483 }; \
484
485
488#define ZFM_CLASS_HAS_MEMBER(NameSpace, memberName, ClassToCheck) \
489 (_ZFP_ClsHM_##NameSpace##_##memberName<ClassToCheck>::value ? 1 : 0)
490
491// ============================================================
495#define ZFCORE_PARAM_DECLARE_SELF(T_self) \
496 public: \
497 \
498 typedef T_self zfself; \
499 public:
500
523#define ZFCORE_PARAM(T_ParamType, paramName, ...) \
524 _ZFP_ZFCORE_PARAM(T_ParamType, paramName, _ZFP_ZFCORE_PARAM_INIT(__VA_ARGS__))
525#define _ZFP_ZFCORE_PARAM_INIT(...) __VA_ARGS__
526#define _ZFP_ZFCORE_PARAM(T_ParamType, paramName, initValue) \
527 public: \
528 inline T_ParamType &paramName(void) { \
529 return this->paramName##_PropV.value; \
530 } \
531 \
532 inline T_ParamType const &paramName(void) const { \
533 return this->paramName##_PropV.value; \
534 } \
535 private: \
536 zfclassLikePOD paramName##_PropT { \
537 public: \
538 paramName##_PropT(void) \
539 : value(initValue) \
540 { \
541 } \
542 paramName##_PropT(ZF_IN const paramName##_PropT &ref) \
543 : value(ref.value) \
544 { \
545 } \
546 paramName##_PropT &operator = (ZF_IN const paramName##_PropT &ref) { \
547 this->value = ref.value; \
548 return *this; \
549 } \
550 public: \
551 T_ParamType value; \
552 }; \
553 paramName##_PropT paramName##_PropV; \
554 \
555 public: \
556 \
557 inline zfself &paramName(ZF_IN T_ParamType const &value) { \
558 this->paramName##_PropV.value = value; \
559 return *this; \
560 }
561
563#endif // #ifndef _ZFI_ZFCoreUtilMacro_h_
564
types for ZFFramework
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98