1 //  macro_params.hpp
2 //
3 //  Copyright (c) 2003 Eugene Gladyshev
4 //
5 //  Permission to copy, use, modify, sell and distribute this software
6 //  is granted provided this copyright notice appears in all copies.
7 //  This software is provided "as is" without express or implied
8 //  warranty, and with no claim as to its suitability for any purpose.
9 //
10 
11 #ifndef __ttl_macro_params__hpp
12 #define __ttl_macro_params__hpp
13 
14 #include "settings/extern/ttl/macro_repeat.hpp"
15 
16 
17 #define TTL_TPARAM(n,t) typename t##n,
18 #define TTL_TPARAM_END(n,t) typename t##n
19 #define TTL_TPARAM_DEF(n, p) typename T##n = p,
20 #define TTL_TPARAM_DEF_END(n, p) typename T##n = p
21 
22 #define TTL_TPARAMSX(n,t) TTL_REPEAT(n, TTL_TPARAM, TTL_TPARAM_END, t)
23 #define TTL_TPARAMS(n) TTL_TPARAMSX(n,T)
24 #define TTL_TPARAMS_DEF(n, def) TTL_REPEAT(n, TTL_TPARAM_DEF, TTL_TPARAM_DEF_END, def)
25 
26 
27 #define TTL_ARG(n,t) t##n,
28 #define TTL_ARG_END(n,t) t##n
29 #define TTL_ARG_S(n,t) TTL_APPEND(t, TTL_CNTINC_##n),
30 #define TTL_ARG_S_END(n,t) TTL_APPEND(t, TTL_CNTINC_##n)
31 
32 #define TTL_ARGS(n) TTL_REPEAT(n, TTL_ARG, TTL_ARG_END, T)
33 #define TTL_ARGSX(n,p) TTL_REPEAT(n, TTL_ARG, TTL_ARG_END, p)
34 #define TTL_ARGS_S(n) TTL_REPEAT(n, TTL_ARG_S, TTL_ARG_S_END, T)
35 #define TTL_ARGS_SX(n,p) TTL_REPEAT(n, TTL_ARG_S, TTL_ARG_S_END, p)
36 
37 #define TTL_TYPEDEF(n, t) typedef t##n type##n;
38 #define TTL_TYPEDEF_END(n, t) typedef t##n type##n;
39 #define TTL_TYPEDEFS(n) TTL_REPEAT(n, TTL_TYPEDEF, TTL_TYPEDEF_END, T)
40 
41 #define TTL_LIST_ITEM(n, t) t,
42 #define TTL_LIST_ITEM_END(n, t) t
43 #define TTL_LIST_ITEMS(n, t) TTL_REPEAT(n,TTL_LIST_ITEM,TTL_LIST_ITEM_END,t)
44 
45 #define TTL_FUNC_PARAM(n,t) T##n t##n,
46 #define TTL_FUNC_PARAM_END(n,t) T##n t##n
47 #define TTL_FUNC_PARAMS(n, p) TTL_REPEAT(n, TTL_FUNC_PARAM, TTL_FUNC_PARAM_END, p)
48 
49 #define TTL_FUNC_PPARAM(n,t) P##n t##n,
50 #define TTL_FUNC_PPARAM_END(n,t) P##n t##n
51 #define TTL_FUNC_PPARAMS(n, p) TTL_REPEAT(n, TTL_FUNC_PPARAM, TTL_FUNC_PPARAM_END, p)
52 
53 #define TTL_ENUM_ITEMS(n, t) TTL_REPEAT(n,TTL_ARG,TTL_ARG_END,t)
54 
55 #endif //__macro_params__hpp
56