Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/fusion/adapted/struct/adapt_struct.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*=============================================================================
0002     Copyright (c) 2001-2007 Joel de Guzman
0003     Copyright (c) 2009-2011 Christopher Schmidt
0004     Copyright (c) 2013-2014 Damien Buhl
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_STRUCT_HPP
0011 #define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP
0012 
0013 #include <boost/fusion/support/config.hpp>
0014 #include <boost/preprocessor/config/config.hpp>
0015 #include <boost/preprocessor/cat.hpp>
0016 #include <boost/preprocessor/empty.hpp>
0017 #include <boost/preprocessor/control/iif.hpp>
0018 #include <boost/preprocessor/comparison/less.hpp>
0019 #include <boost/preprocessor/seq/seq.hpp>
0020 #include <boost/preprocessor/variadic/to_seq.hpp>
0021 
0022 #include <boost/fusion/adapted/struct/detail/extension.hpp>
0023 #include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
0024 #include <boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp>
0025 #include <boost/fusion/adapted/struct/detail/at_impl.hpp>
0026 #include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
0027 #include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
0028 #include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
0029 #include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
0030 #include <boost/fusion/adapted/struct/detail/size_impl.hpp>
0031 #include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
0032 #include <boost/fusion/adapted/struct/detail/end_impl.hpp>
0033 #include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
0034 #include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
0035 
0036 #define BOOST_FUSION_ADAPT_STRUCT_C(                                            \
0037     TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE)                       \
0038         BOOST_FUSION_ADAPT_STRUCT_C_BASE(                                       \
0039             TEMPLATE_PARAMS_SEQ,                                                \
0040             NAME_SEQ,                                                           \
0041             IS_VIEW,                                                            \
0042             I,                                                                  \
0043             BOOST_PP_IIF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY),   \
0044             BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE),                   \
0045             BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),              \
0046             BOOST_PP_LESS(                                                      \
0047                 BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2))
0048 
0049 
0050 
0051 #if BOOST_PP_VARIADICS
0052 
0053 #   define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ...)     \
0054         BOOST_FUSION_ADAPT_STRUCT_BASE(                                         \
0055             (1)TEMPLATE_PARAMS_SEQ,                                             \
0056             (1)NAME_SEQ,                                                        \
0057             struct_tag,                                                         \
0058             0,                                                                  \
0059             BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(                        \
0060                 BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)),                         \
0061             BOOST_FUSION_ADAPT_STRUCT_C)
0062 
0063 #   define BOOST_FUSION_ADAPT_STRUCT(...)                                       \
0064         BOOST_FUSION_ADAPT_STRUCT_BASE(                                         \
0065             (0),                                                                \
0066             (0)(BOOST_PP_SEQ_HEAD(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))),      \
0067             struct_tag,                                                         \
0068             0,                                                                  \
0069             BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(                        \
0070               BOOST_PP_SEQ_TAIL(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))),        \
0071             BOOST_FUSION_ADAPT_STRUCT_C)
0072 
0073 #   define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(...)                               \
0074         BOOST_FUSION_ADAPT_STRUCT_BASE(                                         \
0075             (0),                                                                \
0076             (0)(BOOST_PP_SEQ_HEAD(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))),      \
0077             struct_tag,                                                         \
0078             1,                                                                  \
0079             BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(                        \
0080               BOOST_PP_SEQ_TAIL(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))),        \
0081             BOOST_FUSION_ADAPT_STRUCT_C)
0082 
0083 #else // BOOST_PP_VARIADICS
0084 
0085 #   define BOOST_FUSION_ADAPT_TPL_STRUCT(                                       \
0086         TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES)                               \
0087         BOOST_FUSION_ADAPT_STRUCT_BASE(                                         \
0088             (1)TEMPLATE_PARAMS_SEQ,                                             \
0089             (1)NAME_SEQ,                                                        \
0090             struct_tag,                                                         \
0091             0,                                                                  \
0092             BOOST_PP_CAT(                                                       \
0093                 BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END),        \
0094             BOOST_FUSION_ADAPT_STRUCT_C)
0095 
0096 #   define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES)                          \
0097         BOOST_FUSION_ADAPT_STRUCT_BASE(                                         \
0098             (0),                                                                \
0099             (0)(NAME),                                                          \
0100             struct_tag,                                                         \
0101             0,                                                                  \
0102             BOOST_PP_CAT(                                                       \
0103                 BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,              \
0104                 _END),                                                          \
0105             BOOST_FUSION_ADAPT_STRUCT_C)
0106 
0107 #   define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES)                  \
0108         BOOST_FUSION_ADAPT_STRUCT_BASE(                                         \
0109             (0),                                                                \
0110             (0)(NAME),                                                          \
0111             struct_tag,                                                         \
0112             1,                                                                  \
0113             BOOST_PP_CAT(                                                       \
0114                 BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,              \
0115                 _END),                                                          \
0116             BOOST_FUSION_ADAPT_STRUCT_C)
0117 
0118 
0119 #endif // BOOST_PP_VARIADICS
0120 
0121 #endif