]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/mpi/include/boost/mpi/detail/forward_skeleton_iarchive.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / mpi / include / boost / mpi / detail / forward_skeleton_iarchive.hpp
CommitLineData
7c673cae
FG
1// (C) Copyright 2005 Matthias Troyer
2
3// Use, modification and distribution is subject to the Boost Software
4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7// Authors: Matthias Troyer
8
9#ifndef BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP
10#define BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP
11
12#include <boost/archive/detail/auto_link_archive.hpp>
13#include <boost/archive/detail/iserializer.hpp>
14#include <boost/archive/detail/interface_iarchive.hpp>
15#include <boost/archive/detail/common_iarchive.hpp>
16#include <boost/serialization/collection_size_type.hpp>
17
18namespace boost { namespace mpi { namespace detail {
19
20template<class Archive, class ImplementationArchive>
21class forward_skeleton_iarchive
22 : public archive::detail::common_iarchive<Archive>
23{
24public:
25
26 typedef ImplementationArchive implementation_archive_type;
27
28 forward_skeleton_iarchive(implementation_archive_type& ar)
29 : archive::detail::common_iarchive<Archive>(archive::no_header),
30 implementation_archive(ar)
31 {
32 }
33
34#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
35public:
36#else
37 friend class archive::detail::interface_iarchive<Archive>;
38 friend class archive::load_access;
39protected:
40#endif
41
42 template<class T>
43 void load_override(T & t)
44 {
45 archive::load(* this->This(), t);
46 }
47
48#define BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(T) \
49 void load_override(T & t) \
50 { \
51 implementation_archive >> t; \
52 }
53
54BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_optional_type)
55BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::version_type)
56BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_type)
57BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_reference_type)
58BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_id_type)
59BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_reference_type)
60BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::tracking_type)
61BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_name_type)
62BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(serialization::collection_size_type)
63
64 void load_override(std::string & s)
65 {
66 serialization::collection_size_type length(s.size());
67 load_override(length);
68 s.resize(length);
69 }
70
71#undef BOOST_ARCHIVE_FORWARD_IMPLEMENTATION
72protected:
73 /// the actual archive used to serialize the information we actually want to store
74 implementation_archive_type& implementation_archive;
75};
76
77
78} } } // end namespace boost::mpi::detail
79
80#endif // BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP