Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:31:07

0001 /*=============================================================================
0002     Copyright (c) 2001-2009 Joel de Guzman
0003     Copyright (c) 2007 Dan Marsden
0004     Copyright (c) 2010-2011 Christopher Schmidt
0005     Copyright (c) 2013-2014 Damien Buhl
0006 
0007     Distributed under the Boost Software License, Version 1.0. (See accompanying
0008     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 ==============================================================================*/
0010 
0011 #ifndef BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_HPP
0012 #define BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_HPP
0013 
0014 #include <boost/fusion/support/config.hpp>
0015 #include <boost/preprocessor/cat.hpp>
0016 #include <boost/preprocessor/empty.hpp>
0017 #include <boost/preprocessor/control/if.hpp>
0018 
0019 #include <boost/fusion/adapted/struct/detail/extension.hpp>
0020 #include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
0021 #include <boost/fusion/adapted/struct/detail/at_impl.hpp>
0022 #include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
0023 #include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
0024 #include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
0025 #include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
0026 #include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
0027 #include <boost/fusion/adapted/struct/detail/size_impl.hpp>
0028 #include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
0029 #include <boost/fusion/adapted/struct/detail/end_impl.hpp>
0030 #include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
0031 #include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
0032 #include <boost/fusion/adapted/struct/detail/deref_data_impl.hpp>
0033 #include <boost/fusion/adapted/struct/detail/key_of_impl.hpp>
0034 #include <boost/fusion/adapted/struct/detail/value_of_data_impl.hpp>
0035 #include <boost/fusion/adapted/adt/detail/extension.hpp>
0036 #include <boost/fusion/adapted/adt/detail/adapt_base.hpp>
0037 #include <boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp>
0038 
0039 #define BOOST_FUSION_ADAPT_ASSOC_ADT_C(                                         \
0040     TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE)                       \
0041                                                                                 \
0042         BOOST_FUSION_ADAPT_ADT_C_BASE(                                          \
0043             TEMPLATE_PARAMS_SEQ,                                                \
0044             NAME_SEQ,                                                           \
0045             I,                                                                  \
0046             BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY),   \
0047             BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE),                      \
0048             BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE),                 \
0049             BOOST_PP_LESS(                                                      \
0050                 BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5))         \
0051                                                                                 \
0052     template<                                                                   \
0053         BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ)   \
0054     >                                                                           \
0055     struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
0056     {                                                                           \
0057         typedef BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type;\
0058     };
0059 
0060 #define BOOST_FUSION_ADAPT_ASSOC_TPL_ADT(                                       \
0061     TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES)                                  \
0062                                                                                 \
0063     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
0064         (1)TEMPLATE_PARAMS_SEQ,                                                 \
0065         (1)NAME_SEQ,                                                            \
0066         assoc_struct_tag,                                                       \
0067         0,                                                                      \
0068         BOOST_PP_CAT(                                                           \
0069             BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END),   \
0070         BOOST_FUSION_ADAPT_ASSOC_ADT_C)
0071 
0072 #define BOOST_FUSION_ADAPT_ASSOC_ADT(NAME, ATTRIBUTES)                          \
0073     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
0074         (0),                                                                    \
0075         (0)(NAME),                                                              \
0076         assoc_struct_tag,                                                       \
0077         0,                                                                      \
0078         BOOST_PP_CAT(                                                           \
0079             BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END),   \
0080         BOOST_FUSION_ADAPT_ASSOC_ADT_C)
0081 
0082 #define BOOST_FUSION_ADAPT_ASSOC_ADT_AS_VIEW(NAME, ATTRIBUTES)                  \
0083     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
0084         (0),                                                                    \
0085         (0)(NAME),                                                              \
0086         assoc_struct_tag,                                                       \
0087         1,                                                                      \
0088         BOOST_PP_CAT(                                                           \
0089             BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END),   \
0090         BOOST_FUSION_ADAPT_ASSOC_ADT_C)
0091 
0092 #endif