1 // (C) Copyright 2005 Matthias Troyer
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)
7 // Authors: Matthias Troyer
9 #ifndef BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP
10 #define BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP
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>
18 namespace boost { namespace mpi { namespace detail {
20 template<class Archive, class ImplementationArchive>
21 class forward_skeleton_iarchive
22 : public archive::detail::common_iarchive<Archive>
26 typedef ImplementationArchive implementation_archive_type;
28 forward_skeleton_iarchive(implementation_archive_type& ar)
29 : archive::detail::common_iarchive<Archive>(archive::no_header),
30 implementation_archive(ar)
34 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
37 friend class archive::detail::interface_iarchive<Archive>;
38 friend class archive::load_access;
43 void load_override(T & t)
45 archive::load(* this->This(), t);
48 #define BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(T) \
49 void load_override(T & t) \
51 implementation_archive >> t; \
54 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_optional_type)
55 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::version_type)
56 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_type)
57 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_reference_type)
58 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_id_type)
59 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_reference_type)
60 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::tracking_type)
61 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_name_type)
62 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(serialization::collection_size_type)
64 void load_override(std::string & s)
66 serialization::collection_size_type length(s.size());
67 load_override(length);
71 #undef BOOST_ARCHIVE_FORWARD_IMPLEMENTATION
73 /// the actual archive used to serialize the information we actually want to store
74 implementation_archive_type& implementation_archive;
78 } } } // end namespace boost::mpi::detail
80 #endif // BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP