/Src/Dependencies/Boost/boost/mpi/detail/ignore_skeleton_oarchive.hpp

http://hadesmem.googlecode.com/ · C++ Header · 79 lines · 55 code · 16 blank · 8 comment · 1 complexity · cdd98cd09ecf7aabf5180370c40450b4 MD5 · raw file

  1. // (C) Copyright 2005 Matthias Troyer
  2. // Use, modification and distribution is subject to the Boost Software
  3. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // Authors: Matthias Troyer
  6. #ifndef BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP
  7. #define BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP
  8. #include <boost/serialization/pfto.hpp>
  9. #include <boost/archive/detail/auto_link_archive.hpp>
  10. #include <boost/archive/detail/common_oarchive.hpp>
  11. #include <boost/archive/basic_archive.hpp>
  12. #include <boost/archive/detail/oserializer.hpp>
  13. #include <boost/serialization/collection_size_type.hpp>
  14. #include <boost/serialization/array.hpp>
  15. #include <boost/serialization/item_version_type.hpp>
  16. namespace boost { namespace mpi { namespace detail {
  17. template<class Archive>
  18. class ignore_skeleton_oarchive
  19. : public archive::detail::common_oarchive<Archive>
  20. {
  21. public:
  22. ignore_skeleton_oarchive()
  23. : archive::detail::common_oarchive<Archive>(archive::no_header)
  24. {
  25. }
  26. #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
  27. public:
  28. #else
  29. friend class archive::detail::interface_oarchive<Archive>;
  30. friend class archive::save_access;
  31. protected:
  32. #endif
  33. // intermediate level to support override of operators
  34. // for templates in the absence of partial function
  35. // template ordering
  36. template<class T>
  37. void save_override(T const& t, BOOST_PFTO int)
  38. {
  39. archive::save(* this->This(), t);
  40. }
  41. #define BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(T) \
  42. void save_override(T const & , int) \
  43. {}
  44. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_optional_type)
  45. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::version_type)
  46. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::library_version_type)
  47. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_type)
  48. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_reference_type)
  49. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::object_id_type)
  50. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::object_reference_type)
  51. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::tracking_type)
  52. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_name_type)
  53. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(serialization::collection_size_type)
  54. BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(serialization::item_version_type)
  55. void save_override(std::string const & s, int)
  56. {
  57. if (s.size())
  58. save_override(serialization::make_array(s.data(),s.size()),0);
  59. }
  60. #undef BOOST_ARCHIVE_IGNORE_IMPLEMENTATION
  61. };
  62. } } } // end namespace boost::mpi::detail
  63. #endif // BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP