]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // (C) Copyright Edward Diener 2011-2015 | |
3 | // Use, modification and distribution are subject to the Boost Software License, | |
4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
5 | // http://www.boost.org/LICENSE_1_0.txt). | |
6 | ||
7 | #if !defined(BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_HPP) | |
8 | #define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_HPP | |
9 | ||
10 | #include <boost/preprocessor/control/iif.hpp> | |
11 | #include <boost/vmd/identity.hpp> | |
12 | #include <boost/vmd/detail/equal_type.hpp> | |
13 | #include <boost/vmd/detail/is_array_common.hpp> | |
14 | #include <boost/vmd/detail/is_list.hpp> | |
15 | #include <boost/vmd/detail/type_registration.hpp> | |
16 | ||
17 | #define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_ARRAY(data,type) \ | |
18 | BOOST_PP_IIF \ | |
19 | ( \ | |
20 | BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX(data), \ | |
21 | BOOST_VMD_TYPE_ARRAY, \ | |
22 | type \ | |
23 | ) \ | |
24 | /**/ | |
25 | ||
26 | #define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_ARRAY_D(d,data,type) \ | |
27 | BOOST_PP_IIF \ | |
28 | ( \ | |
29 | BOOST_VMD_DETAIL_IS_ARRAY_SYNTAX_D(d,data), \ | |
30 | BOOST_VMD_TYPE_ARRAY, \ | |
31 | type \ | |
32 | ) \ | |
33 | /**/ | |
34 | ||
35 | #define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_LIST(data,type) \ | |
36 | BOOST_VMD_IDENTITY_RESULT \ | |
37 | ( \ | |
38 | BOOST_PP_IIF \ | |
39 | ( \ | |
40 | BOOST_VMD_DETAIL_IS_LIST_WLOOP(data), \ | |
41 | BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_LIST), \ | |
42 | BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_ARRAY \ | |
43 | ) \ | |
44 | (data,type) \ | |
45 | ) \ | |
46 | /**/ | |
47 | ||
48 | #define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_LIST_D(d,data,type) \ | |
49 | BOOST_VMD_IDENTITY_RESULT \ | |
50 | ( \ | |
51 | BOOST_PP_IIF \ | |
52 | ( \ | |
53 | BOOST_VMD_DETAIL_IS_LIST_WLOOP_D(d,data), \ | |
54 | BOOST_VMD_IDENTITY(BOOST_VMD_TYPE_LIST), \ | |
55 | BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_ARRAY_D \ | |
56 | ) \ | |
57 | (d,data,type) \ | |
58 | ) \ | |
59 | /**/ | |
60 | ||
61 | /* | |
62 | ||
63 | Input is any VMD data and a VMD type for that data | |
64 | ||
65 | If the type is a tuple, checks to see if it is a more specific | |
66 | type and, if it is, returns that type, | |
67 | otherwise returns the type passed as a parameter | |
68 | ||
69 | */ | |
70 | ||
71 | #define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE(data,type) \ | |
72 | BOOST_VMD_IDENTITY_RESULT \ | |
73 | ( \ | |
74 | BOOST_PP_IIF \ | |
75 | ( \ | |
76 | BOOST_VMD_DETAIL_EQUAL_TYPE(BOOST_VMD_TYPE_TUPLE,type), \ | |
77 | BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_LIST, \ | |
78 | BOOST_VMD_IDENTITY(type) \ | |
79 | ) \ | |
80 | (data,type) \ | |
81 | ) \ | |
82 | /**/ | |
83 | ||
84 | #define BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_D(d,data,type) \ | |
85 | BOOST_VMD_IDENTITY_RESULT \ | |
86 | ( \ | |
87 | BOOST_PP_IIF \ | |
88 | ( \ | |
89 | BOOST_VMD_DETAIL_EQUAL_TYPE_D(d,BOOST_VMD_TYPE_TUPLE,type), \ | |
90 | BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_CHECK_LIST_D, \ | |
91 | BOOST_VMD_IDENTITY(type) \ | |
92 | ) \ | |
93 | (d,data,type) \ | |
94 | ) \ | |
95 | /**/ | |
96 | ||
97 | #endif /* BOOST_VMD_DETAIL_ADJUST_TUPLE_TYPE_HPP */ |