1 /* /libs/serialization/xml_performance/node.hpp ********************************
2 
3 (C) Copyright 2010 Bryce Lelbach
4 
5 Use, modification and distribution is subject to the Boost Software License,
6 Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 
9 *******************************************************************************/
10 
11 #if !defined(BOOST_SERIALIZATION_XML_PERFORMANCE_NODE_HPP)
12 #define BOOST_SERIALIZATION_XML_PERFORMANCE_NODE_HPP
13 
14 #if defined(_MSC_VER)
15   #pragma once
16 #endif
17 
18 #include <boost/serialization/nvp.hpp>
19 #include <boost/serialization/utility.hpp>
20 #include <boost/serialization/list.hpp>
21 #include <boost/serialization/version.hpp>
22 
23 #include "macro.hpp"
24 
25 namespace boost {
26 namespace archive {
27 namespace xml {
28 
29 struct unused_type { };
30 
31 template<
32   typename T,
33   BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
34     BOOST_PP_SUB(BSL_NODE_MAX, 1), typename T, unused_type
35   )
36 > struct node;
37 
38 BOOST_PP_REPEAT_FROM_TO(1, BSL_NODE_MAX, BSL_NODE_DECL, _)
39 
40 template<BOOST_PP_ENUM_PARAMS(BSL_NODE_MAX, typename T)>
41 struct node {
BOOST_PP_REPEATboost::archive::xml::node42   BOOST_PP_REPEAT(BSL_NODE_MAX, BSL_NODE_DECL_MEMBER, _)
43 
44   template<class ARC>
45   void serialize (ARC& ar, const unsigned int) {
46     ar
47       BOOST_PP_REPEAT(BSL_NODE_MAX, BSL_NODE_SERIALIZE, _)
48     ;
49   }
50 
51   BSL_NODE_xDECL_CTOR()
52 
nodeboost::archive::xml::node53   node (BOOST_PP_ENUM_BINARY_PARAMS(BSL_NODE_MAX, T, p)):
54     BOOST_PP_REPEAT(BSL_NODE_MAX, BSL_NODE_INIT_LIST, _)
55   { }
56 };
57 
58 } // xml
59 } // archive
60 } // boost
61 
62 #endif // BOOST_SERIALIZATION_XML_PERFORMANCE_NODE_HPP
63 
64