Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2009 Joel de Guzman
|
Chris@16
|
3 Copyright (c) 2007 Dan Marsden
|
Chris@16
|
4 Copyright (c) 2010-2011 Christopher Schmidt
|
Chris@101
|
5 Copyright (c) 2013-2014 Damien Buhl
|
Chris@16
|
6
|
Chris@16
|
7 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
8 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 ==============================================================================*/
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_HPP
|
Chris@16
|
12 #define BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_HPP
|
Chris@16
|
13
|
Chris@101
|
14 #include <boost/fusion/support/config.hpp>
|
Chris@16
|
15 #include <boost/preprocessor/cat.hpp>
|
Chris@16
|
16 #include <boost/preprocessor/empty.hpp>
|
Chris@16
|
17 #include <boost/preprocessor/tuple/elem.hpp>
|
Chris@16
|
18 #include <boost/type_traits/add_reference.hpp>
|
Chris@16
|
19 #include <boost/type_traits/is_const.hpp>
|
Chris@16
|
20 #include <boost/type_traits/remove_const.hpp>
|
Chris@16
|
21
|
Chris@16
|
22 #include <boost/fusion/adapted/struct/detail/extension.hpp>
|
Chris@16
|
23 #include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
|
Chris@16
|
24 #include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
Chris@16
|
25 #include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
|
Chris@101
|
26 #include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
|
Chris@16
|
27 #include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
|
Chris@16
|
28 #include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
Chris@16
|
29 #include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
|
Chris@16
|
30 #include <boost/fusion/adapted/struct/detail/size_impl.hpp>
|
Chris@16
|
31 #include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
|
Chris@16
|
32 #include <boost/fusion/adapted/struct/detail/end_impl.hpp>
|
Chris@16
|
33 #include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
|
Chris@16
|
34 #include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
|
Chris@16
|
35 #include <boost/fusion/adapted/struct/detail/deref_data_impl.hpp>
|
Chris@16
|
36 #include <boost/fusion/adapted/struct/detail/key_of_impl.hpp>
|
Chris@16
|
37 #include <boost/fusion/adapted/struct/detail/value_of_data_impl.hpp>
|
Chris@16
|
38 #include <boost/fusion/adapted/adt/detail/extension.hpp>
|
Chris@16
|
39 #include <boost/fusion/adapted/adt/detail/adapt_base.hpp>
|
Chris@101
|
40 #include <boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp>
|
Chris@16
|
41
|
Chris@16
|
42 #define BOOST_FUSION_ADAPT_ASSOC_ADT_C( \
|
Chris@101
|
43 TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \
|
Chris@16
|
44 \
|
Chris@101
|
45 BOOST_FUSION_ADAPT_ADT_C_BASE( \
|
Chris@101
|
46 TEMPLATE_PARAMS_SEQ, \
|
Chris@101
|
47 NAME_SEQ, \
|
Chris@101
|
48 I, \
|
Chris@101
|
49 BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
|
Chris@101
|
50 BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \
|
Chris@101
|
51 BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
|
Chris@101
|
52 BOOST_PP_IF( \
|
Chris@101
|
53 BOOST_PP_LESS( \
|
Chris@101
|
54 BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5) \
|
Chris@101
|
55 , 1, 0)) \
|
Chris@16
|
56 \
|
Chris@16
|
57 template< \
|
Chris@16
|
58 BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
Chris@16
|
59 > \
|
Chris@16
|
60 struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
Chris@16
|
61 { \
|
Chris@101
|
62 typedef BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type;\
|
Chris@16
|
63 };
|
Chris@16
|
64
|
Chris@16
|
65 #define BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( \
|
Chris@16
|
66 TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
|
Chris@16
|
67 \
|
Chris@16
|
68 BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
Chris@16
|
69 (1)TEMPLATE_PARAMS_SEQ, \
|
Chris@16
|
70 (1)NAME_SEQ, \
|
Chris@16
|
71 assoc_struct_tag, \
|
Chris@16
|
72 0, \
|
Chris@16
|
73 BOOST_PP_CAT( \
|
Chris@16
|
74 BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END), \
|
Chris@16
|
75 BOOST_FUSION_ADAPT_ASSOC_ADT_C)
|
Chris@16
|
76
|
Chris@16
|
77 #define BOOST_FUSION_ADAPT_ASSOC_ADT(NAME, ATTRIBUTES) \
|
Chris@16
|
78 BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
Chris@16
|
79 (0), \
|
Chris@16
|
80 (0)(NAME), \
|
Chris@16
|
81 assoc_struct_tag, \
|
Chris@16
|
82 0, \
|
Chris@16
|
83 BOOST_PP_CAT( \
|
Chris@16
|
84 BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END), \
|
Chris@16
|
85 BOOST_FUSION_ADAPT_ASSOC_ADT_C)
|
Chris@16
|
86
|
Chris@16
|
87 #define BOOST_FUSION_ADAPT_ASSOC_ADT_AS_VIEW(NAME, ATTRIBUTES) \
|
Chris@16
|
88 BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
Chris@16
|
89 (0), \
|
Chris@16
|
90 (0)(NAME), \
|
Chris@16
|
91 assoc_struct_tag, \
|
Chris@16
|
92 1, \
|
Chris@16
|
93 BOOST_PP_CAT( \
|
Chris@16
|
94 BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END), \
|
Chris@16
|
95 BOOST_FUSION_ADAPT_ASSOC_ADT_C)
|
Chris@16
|
96
|
Chris@16
|
97 #endif
|