Boost logo

Boost-Commit :

From: ramey_at_[hidden]
Date: 2008-03-18 01:52:10


Author: ramey
Date: 2008-03-18 01:52:10 EDT (Tue, 18 Mar 2008)
New Revision: 43693
URL: http://svn.boost.org/trac/boost/changeset/43693

Log:
Support serialization in DLLS
Make thread-safe
fix portable binary archives
Text files modified:
   trunk/boost/archive/array/iarchive.hpp | 18 ++++++------------
   trunk/boost/archive/array/oarchive.hpp | 8 +-------
   2 files changed, 7 insertions(+), 19 deletions(-)

Modified: trunk/boost/archive/array/iarchive.hpp
==============================================================================
--- trunk/boost/archive/array/iarchive.hpp (original)
+++ trunk/boost/archive/array/iarchive.hpp 2008-03-18 01:52:10 EDT (Tue, 18 Mar 2008)
@@ -8,17 +8,16 @@
 
 
 #include <boost/archive/basic_archive.hpp>
-#include <boost/archive/archive_exception.hpp>
 #include <boost/archive/detail/common_iarchive.hpp>
-#include <boost/serialization/nvp.hpp>
 #include <boost/serialization/array.hpp>
 #include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/nvp.hpp>
 #include <boost/serialization/detail/get_data.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/mpl/apply.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/pfto.hpp>
-
+//#include <boost/archive/archive_exception.hpp>
 
 namespace boost { namespace archive { namespace array {
 
@@ -51,8 +50,8 @@
   {}
 
 
- // save_override for std::vector and serialization::array dispatches to
- // save_optimized with an additional argument.
+ // load_override for std::vector and serialization::array dispatches to
+ // load_optimized with an additional argument.
   //
   // If that argument is of type mpl::true_, an optimized serialization is provided
   // If it is false, we just forward to the default serialization in the base class
@@ -65,9 +64,9 @@
   }
 
   // the optimized implementation for vector uses serialization::array
- template<class U, class Allocator>
+ template<class ValueType, class Allocator>
   void load_optimized(
- std::vector<U, Allocator> &t, unsigned int version, mpl::true_)
+ std::vector<ValueType, Allocator> &t, unsigned int version, mpl::true_)
   {
     t.clear();
     // retrieve number of elements
@@ -86,7 +85,6 @@
     this->This()->load_array(t,version);
   }
 
-
   // to load a vector:
   // if the value type is trivially constructable or an optimized array save exists,
   // then we can use the optimized version
@@ -103,7 +101,6 @@
     load_optimized(x,version, use_optimized() );
   }
   
-
   // dispatch loading of arrays to the optimized version where supported
   template<class ValueType>
   void load_override(serialization::array<ValueType> const& x, unsigned int version)
@@ -123,10 +120,7 @@
   }
 };
 
-
 } } } // end namespace boost::archive::array
 
-
-
 #endif // BOOST_ARCHIVE_ARRAY_OARCHIVE_HPP
 

Modified: trunk/boost/archive/array/oarchive.hpp
==============================================================================
--- trunk/boost/archive/array/oarchive.hpp (original)
+++ trunk/boost/archive/array/oarchive.hpp 2008-03-18 01:52:10 EDT (Tue, 18 Mar 2008)
@@ -13,11 +13,11 @@
 #include <boost/serialization/collection_size_type.hpp>
 #include <boost/serialization/nvp.hpp>
 #include <boost/serialization/detail/get_data.hpp>
-#include <boost/type_traits/remove_const.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/mpl/apply.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/pfto.hpp>
+#include <boost/type_traits/remove_const.hpp>
 
 namespace boost { namespace archive { namespace array {
 
@@ -63,7 +63,6 @@
     Base::save_override(t, version);
   }
 
-
   // the optimized implementation for vector uses serialization::array
   template<class ValueType, class Allocator>
   void save_optimized(
@@ -83,7 +82,6 @@
     this->This()->save_array(t,version);
   }
 
-
   // to save a vector:
   // if the value type is trivially constructable or an optimized array save exists,
   // then we can use the optimized version
@@ -100,8 +98,6 @@
>::type use_optimized;
     save_optimized(x,version,use_optimized() );
   }
-
-
   
   // dispatch saving of arrays to the optimized version where supported
   template<class ValueType>
@@ -125,6 +121,4 @@
 
 } } } // end namespace boost::archive::array
 
-
 #endif // BOOST_ARCHIVE_ARRAY_OARCHIVE_HPP
-


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk