]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2009-2010 Hartmut Kaiser | |
3 | Copyright (c) 2010 Christopher Schmidt | |
4 | ||
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 | ==============================================================================*/ | |
8 | ||
9 | #ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_NAMESPACE_HPP | |
10 | #define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_NAMESPACE_HPP | |
11 | ||
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> | |
20 | ||
21 | #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_BEGIN_I(R,DATA,ELEM) \ | |
22 | namespace 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:: | |
25 | ||
26 | #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ | |
27 | BOOST_PP_IF( \ | |
28 | BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \ | |
29 | BOOST_PP_SEQ_FOR_EACH_R, \ | |
30 | BOOST_PP_TUPLE_EAT(4))( \ | |
31 | 1, \ | |
32 | BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_BEGIN_I, \ | |
33 | _, \ | |
34 | BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ)) | |
35 | ||
36 | #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) \ | |
37 | BOOST_PP_REPEAT_1( \ | |
38 | BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \ | |
39 | BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_END_I, \ | |
40 | _) | |
41 | ||
42 | #define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ) \ | |
43 | BOOST_PP_IF( \ | |
44 | BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \ | |
45 | BOOST_PP_SEQ_FOR_EACH_R, \ | |
46 | BOOST_PP_TUPLE_EAT(4))( \ | |
47 | 1, \ | |
48 | BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I, \ | |
49 | _, \ | |
50 | BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ)) | |
51 | ||
52 | #endif |