Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:50:00

0001 //  (C) Copyright Jeremy Siek 2006
0002 //  Distributed under the Boost Software License, Version 1.0. (See
0003 //  accompanying file LICENSE_1_0.txt or copy at
0004 //  http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_PROPERTY_SERIALIZE_HPP
0007 #define BOOST_PROPERTY_SERIALIZE_HPP
0008 
0009 #include <boost/pending/property.hpp>
0010 #include <boost/serialization/is_bitwise_serializable.hpp>
0011 #include <boost/serialization/base_object.hpp>
0012 #include <boost/serialization/nvp.hpp>
0013 
0014 namespace boost
0015 {
0016 template < class Archive >
0017 inline void serialize(Archive&, no_property&, const unsigned int)
0018 {
0019 }
0020 
0021 template < class Archive, class Tag, class T, class Base >
0022 void serialize(
0023     Archive& ar, property< Tag, T, Base >& prop, const unsigned int /*version*/)
0024 {
0025     ar& serialization::make_nvp("property_value", prop.m_value);
0026     ar& serialization::make_nvp("property_base", prop.m_base);
0027 }
0028 
0029 #ifdef BOOST_GRAPH_USE_MPI
0030 
0031 // Setting the serialization properties of boost::property<> and
0032 // boost::no_property to is_bitwise_serializable, object_serializable,
0033 // track_never only when BOOST_GRAPH_USE_MPI is defined is dubious.
0034 //
0035 // This changes the serialization format of these classes, and hence
0036 // of boost::adjacency_list, depending on whether BOOST_GRAPH_USE_MPI
0037 // is defined.
0038 //
0039 // These serialization properties should probably be set in either case.
0040 //
0041 // Unfortunately, doing that now will change the serialization format
0042 // of boost::adjacency_list in the non-MPI case, and could potentially
0043 // break software that reads files serialized with an older release.
0044 
0045 namespace mpi
0046 {
0047 
0048     // forward declaration, to avoid including mpi
0049     template < typename T > struct is_mpi_datatype;
0050 
0051     template < typename Tag, typename T, typename Base >
0052     struct is_mpi_datatype< property< Tag, T, Base > >
0053     : mpl::and_< is_mpi_datatype< T >, is_mpi_datatype< Base > >
0054     {
0055     };
0056 }
0057 
0058 namespace serialization
0059 {
0060     template < typename Tag, typename T, typename Base >
0061     struct is_bitwise_serializable< property< Tag, T, Base > >
0062     : mpl::and_< is_bitwise_serializable< T >, is_bitwise_serializable< Base > >
0063     {
0064     };
0065 
0066     template < typename Tag, typename T, typename Base >
0067     struct implementation_level< property< Tag, T, Base > >
0068     : mpl::int_< object_serializable >
0069     {
0070     };
0071 
0072     template < typename Tag, typename T, typename Base >
0073     struct tracking_level< property< Tag, T, Base > > : mpl::int_< track_never >
0074     {
0075     };
0076 
0077 }
0078 #endif // BOOST_GRAPH_USE_MPI
0079 
0080 } // end namespace boost
0081 
0082 #ifdef BOOST_GRAPH_USE_MPI
0083 namespace boost
0084 {
0085 namespace mpi
0086 {
0087     template <> struct is_mpi_datatype< boost::no_property > : mpl::true_
0088     {
0089     };
0090 
0091 }
0092 } // end namespace boost::mpi
0093 
0094 BOOST_IS_BITWISE_SERIALIZABLE(boost::no_property)
0095 BOOST_CLASS_IMPLEMENTATION(boost::no_property, object_serializable)
0096 BOOST_CLASS_TRACKING(boost::no_property, track_never)
0097 #endif // BOOST_GRAPH_USE_MPI
0098 
0099 #endif // BOOST_PROPERTY_SERIALIZE_HPP