1 /*=============================================================================
2 Copyright (c) 2009-2010 Hartmut Kaiser
3 Copyright (c) 2010 Christopher Schmidt
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
9 #ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_NAMESPACE_HPP
10 #define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_NAMESPACE_HPP
12 #include <boost/fusion/support/config.hpp>
13 #include <boost/preprocessor/dec.hpp>
14 #include <boost/preprocessor/control/if.hpp>
15 #include <boost/preprocessor/seq/seq.hpp>
16 #include <boost/preprocessor/seq/for_each.hpp>
17 #include <boost/preprocessor/seq/size.hpp>
18 #include <boost/preprocessor/repetition/repeat.hpp>
19 #include <boost/preprocessor/tuple/eat.hpp>
21 #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_BEGIN_I(R,DATA,ELEM) \
23 #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_END_I(Z,I,DATA) }
24 #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I(Z,I,ELEM) ELEM::
26 #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
28 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
29 BOOST_PP_SEQ_FOR_EACH_R, \
30 BOOST_PP_TUPLE_EAT(4))( \
32 BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_BEGIN_I, \
34 BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ))
36 #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) \
38 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
39 BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_END_I, \
42 #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ) \
44 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
45 BOOST_PP_SEQ_FOR_EACH_R, \
46 BOOST_PP_TUPLE_EAT(4))( \
48 BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I, \
50 BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ))