• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Copyright (c) 2001-2009 Joel de Guzman
3     Copyright (c) 2009-2010 Hartmut Kaiser
4     Copyright (c) 2010-2011 Christopher Schmidt
5     Copyright (c) 2013-2014 Damien Buhl
6 
7     Distributed under the Boost Software License, Version 1.0. (See accompanying
8     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 ==============================================================================*/
10 
11 #ifndef BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_HPP
12 #define BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_HPP
13 
14 #include <boost/fusion/support/config.hpp>
15 #include <boost/preprocessor/cat.hpp>
16 #include <boost/preprocessor/empty.hpp>
17 #include <boost/preprocessor/control/if.hpp>
18 #include <boost/preprocessor/comparison/less.hpp>
19 
20 #include <boost/fusion/adapted/struct/detail/extension.hpp>
21 #include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
22 #include <boost/fusion/adapted/struct/detail/at_impl.hpp>
23 #include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
24 #include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
25 #include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
26 #include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
27 #include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
28 #include <boost/fusion/adapted/struct/detail/size_impl.hpp>
29 #include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
30 #include <boost/fusion/adapted/struct/detail/end_impl.hpp>
31 #include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
32 #include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
33 #include <boost/fusion/adapted/adt/detail/extension.hpp>
34 #include <boost/fusion/adapted/adt/detail/adapt_base.hpp>
35 #include <boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp>
36 
37 #define BOOST_FUSION_ADAPT_ADT_C(                                               \
38     TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE)                       \
39         BOOST_FUSION_ADAPT_ADT_C_BASE(                                          \
40             TEMPLATE_PARAMS_SEQ,                                                \
41             NAME_SEQ,                                                           \
42             I,                                                                  \
43             BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY),   \
44             BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE),                      \
45             BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE),                 \
46             BOOST_PP_LESS(                                                      \
47                 BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4))         \
48 
49 #define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES)  \
50     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
51         (1)TEMPLATE_PARAMS_SEQ,                                                 \
52         (1)NAME_SEQ,                                                            \
53         struct_tag,                                                             \
54         0,                                                                      \
55         BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END),  \
56         BOOST_FUSION_ADAPT_ADT_C)
57 
58 #define BOOST_FUSION_ADAPT_ADT(NAME, ATTRIBUTES)                                \
59     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
60         (0),                                                                    \
61         (0)(NAME),                                                              \
62         struct_tag,                                                             \
63         0,                                                                      \
64         BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END),  \
65         BOOST_FUSION_ADAPT_ADT_C)
66 
67 #define BOOST_FUSION_ADAPT_ADT_AS_VIEW(NAME, ATTRIBUTES)                        \
68     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
69         (0),                                                                    \
70         (0)(NAME),                                                              \
71         struct_tag,                                                             \
72         1,                                                                      \
73         BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END),  \
74         BOOST_FUSION_ADAPT_ADT_C)
75 
76 #endif
77