Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:56:17

0001 // (C) Copyright 2005 Matthias Troyer 
0002 
0003 // Use, modification and distribution is subject to the Boost Software
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  Authors: Matthias Troyer
0008 
0009 #ifndef BOOST_MPI_DETAIL_FORWARD_SKELETON_OARCHIVE_HPP
0010 #define BOOST_MPI_DETAIL_FORWARD_SKELETON_OARCHIVE_HPP
0011 
0012 #include <boost/archive/detail/auto_link_archive.hpp>
0013 #include <boost/archive/detail/oserializer.hpp>
0014 #include <boost/archive/detail/interface_oarchive.hpp>
0015 #include <boost/archive/detail/common_oarchive.hpp>
0016 #include <boost/serialization/collection_size_type.hpp>
0017 
0018 namespace boost { namespace mpi { namespace detail {
0019 
0020 template<class Archive, class ImplementationArchive>
0021 class forward_skeleton_oarchive 
0022   : public archive::detail::common_oarchive<Archive>
0023 {
0024 public:
0025 
0026     typedef ImplementationArchive implementation_archive_type;
0027 
0028     forward_skeleton_oarchive(implementation_archive_type& ar) 
0029       : archive::detail::common_oarchive<Archive>(archive::no_header),
0030         implementation_archive(ar)
0031     {
0032     }
0033 
0034 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0035 public:
0036 #else
0037     friend class archive::detail::interface_oarchive<Archive>;
0038     friend class archive::save_access;
0039 protected:
0040 #endif
0041 
0042   template<class T>
0043   void save_override(T const& t)
0044   {
0045     archive::save(* this->This(), t);
0046   }
0047 
0048 #define BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(T) \
0049     void save_override(T const & t)             \
0050     {                                           \
0051       implementation_archive << t;              \
0052     }
0053 
0054 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_optional_type)
0055 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::version_type)
0056 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_type)
0057 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_reference_type)
0058 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_id_type)
0059 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_reference_type)
0060 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::tracking_type)
0061 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_name_type)
0062 BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(serialization::collection_size_type)
0063 
0064     void save_override(std::string const & t)    
0065     {                                          
0066       save_override(serialization::collection_size_type(t.size()));       
0067     }
0068 
0069 
0070 #undef BOOST_ARCHIVE_FORWARD_IMPLEMENTATION
0071 protected:
0072     /// the actual archive used to serialize the information we actually want to store
0073     implementation_archive_type& implementation_archive;
0074 };
0075 
0076 } } } // end namespace boost::mpi::detail
0077 
0078 #endif // BOOST_MPI_DETAIL_FORWARD_SKELETON_OARCHIVE_HPP