node.hpp 1.9 KB

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