Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*=============================================================================
0002     Copyright (c) 2001-2007 Joel de Guzman
0003     Copyright (c) 2007 Dan Marsden
0004     Copyright (c) 2009-2011 Christopher Schmidt
0005 
0006     Distributed under the Boost Software License, Version 1.0. (See accompanying
0007     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 ==============================================================================*/
0009 
0010 #ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_HPP
0011 #define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_HPP
0012 
0013 #include <boost/fusion/support/config.hpp>
0014 #include <boost/preprocessor/cat.hpp>
0015 #include <boost/preprocessor/empty.hpp>
0016 #include <boost/preprocessor/control/iif.hpp>
0017 #include <boost/preprocessor/comparison/less.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/adapt_base_assoc_attr_filler.hpp>
0022 #include <boost/fusion/adapted/struct/detail/at_impl.hpp>
0023 #include <boost/fusion/adapted/struct/detail/is_view_impl.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 
0036 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE(                                 \
0037     TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,PREFIX,ATTRIBUTE)                    \
0038                                                                                 \
0039     BOOST_FUSION_ADAPT_STRUCT_C_BASE(                                           \
0040         TEMPLATE_PARAMS_SEQ,                                                    \
0041         NAME_SEQ,                                                               \
0042         IS_VIEW,                                                                \
0043         I,                                                                      \
0044         BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY),       \
0045         BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE),                       \
0046         BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),                  \
0047         BOOST_PP_LESS(                                                          \
0048             BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3))           \
0049                                                                                 \
0050     template<                                                                   \
0051         BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ)   \
0052     >                                                                           \
0053     struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
0054     {                                                                           \
0055         typedef                                                                 \
0056           BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type;  \
0057     };
0058 
0059 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C(                                      \
0060     TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, I, ATTRIBUTE)                         \
0061                                                                                 \
0062     BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE(                                     \
0063         TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,BOOST_PP_EMPTY,ATTRIBUTE)
0064 
0065 
0066 #define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT(                                    \
0067     TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES)                                  \
0068                                                                                 \
0069     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
0070         (1)TEMPLATE_PARAMS_SEQ,                                                 \
0071         (1)NAME_SEQ,                                                            \
0072         assoc_struct_tag,                                                       \
0073         0,                                                                      \
0074         BOOST_PP_CAT(                                                           \
0075             BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END),    \
0076         BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
0077 
0078 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, ATTRIBUTES)                       \
0079     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
0080         (0),                                                                    \
0081         (0)(NAME),                                                              \
0082         assoc_struct_tag,                                                       \
0083         0,                                                                      \
0084         BOOST_PP_CAT(                                                           \
0085             BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END),    \
0086         BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
0087 
0088 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW(NAME, ATTRIBUTES)               \
0089     BOOST_FUSION_ADAPT_STRUCT_BASE(                                             \
0090         (0),                                                                    \
0091         (0)(NAME),                                                              \
0092         assoc_struct_tag,                                                       \
0093         1,                                                                      \
0094         BOOST_PP_CAT(                                                           \
0095             BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END),    \
0096         BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
0097 
0098 #endif