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_CONTENT_OARCHIVE_HPP
10 #define BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP
12 #include <boost/archive/detail/auto_link_archive.hpp>
13 #include <boost/archive/basic_archive.hpp>
14 #include <boost/mpi/detail/ignore_skeleton_oarchive.hpp>
15 #include <boost/mpi/detail/mpi_datatype_primitive.hpp>
16 #include <boost/mpi/datatype.hpp>
17 #include <boost/archive/detail/register_archive.hpp>
19 namespace boost { namespace mpi {
22 // an archive wrapper that stores only the data members but not the
23 // special types defined by the serialization library
24 // to define the data skeletons (classes, pointers, container sizes, ...)
26 class BOOST_MPI_DECL content_oarchive
27 : public mpi_datatype_primitive,
28 public ignore_skeleton_oarchive<content_oarchive>
39 // create the content holder only once
40 c=this->get_mpi_datatype();
50 } // end namespace detail
53 const content get_content(const T& x)
55 detail::content_oarchive ar;
57 return ar.get_content();
60 } } // end namespace boost::mpi
63 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::content_oarchive)
64 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::content_oarchive>)
65 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::detail::content_oarchive)
66 #endif // BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP