File indexing completed on 2025-01-18 09:40:57
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP
0010 #define BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP
0011
0012 #include <boost/archive/detail/auto_link_archive.hpp>
0013 #include <boost/archive/basic_archive.hpp>
0014 #include <boost/mpi/detail/ignore_skeleton_oarchive.hpp>
0015 #include <boost/mpi/detail/mpi_datatype_primitive.hpp>
0016 #include <boost/mpi/datatype.hpp>
0017 #include <boost/archive/detail/register_archive.hpp>
0018
0019 namespace boost { namespace mpi {
0020
0021 namespace detail {
0022
0023
0024
0025
0026 class BOOST_MPI_DECL content_oarchive
0027 : public mpi_datatype_primitive,
0028 public ignore_skeleton_oarchive<content_oarchive>
0029 {
0030 public:
0031 content_oarchive()
0032 : committed(false)
0033 {}
0034
0035 content get_content()
0036 {
0037 if (!committed)
0038 {
0039
0040 c=this->get_mpi_datatype();
0041 committed=true;
0042 }
0043 return c;
0044 }
0045
0046 private:
0047 bool committed;
0048 content c;
0049 };
0050 }
0051
0052 template <class T>
0053 const content get_content(const T& x)
0054 {
0055 detail::content_oarchive ar;
0056 ar << x;
0057 return ar.get_content();
0058 }
0059
0060 } }
0061
0062
0063 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::content_oarchive)
0064 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::content_oarchive>)
0065 BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::detail::content_oarchive)
0066 #endif