Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62032 - branches/release/boost/serialization
From: dgregor_at_[hidden]
Date: 2010-05-16 11:40:00


Author: dgregor
Date: 2010-05-16 11:39:59 EDT (Sun, 16 May 2010)
New Revision: 62032
URL: http://svn.boost.org/trac/boost/changeset/62032

Log:
Revert my change to use collection_size_type/version_type throughout
Boost.Serialization; I had missed that this actually changes by binary
format.

Properties modified:
   branches/release/boost/serialization/ (props changed)
   branches/release/boost/serialization/factory.hpp (props changed)
Text files modified:
   branches/release/boost/serialization/collections_load_imp.hpp | 14 ++++++--------
   branches/release/boost/serialization/collections_save_imp.hpp | 7 +++----
   branches/release/boost/serialization/hash_collections_load_imp.hpp | 8 +++-----
   branches/release/boost/serialization/hash_collections_save_imp.hpp | 12 ++++--------
   branches/release/boost/serialization/optional.hpp | 9 +++------
   branches/release/boost/serialization/slist.hpp | 7 ++-----
   6 files changed, 21 insertions(+), 36 deletions(-)

Modified: branches/release/boost/serialization/collections_load_imp.hpp
==============================================================================
--- branches/release/boost/serialization/collections_load_imp.hpp (original)
+++ branches/release/boost/serialization/collections_load_imp.hpp 2010-05-16 11:39:59 EDT (Sun, 16 May 2010)
@@ -33,7 +33,6 @@
 #include <boost/detail/workaround.hpp>
 
 #include <boost/serialization/access.hpp>
-#include <boost/archive/basic_archive.hpp> // for version_type
 #include <boost/serialization/nvp.hpp>
 #include <boost/serialization/detail/stack_constructor.hpp>
 #include <boost/serialization/collection_size_type.hpp>
@@ -140,13 +139,12 @@
     s.clear();
     // retrieve number of elements
     collection_size_type count;
- unsigned int item_version_val = 0;
+ unsigned int item_version;
     ar >> BOOST_SERIALIZATION_NVP(count);
- if(3 < ar.get_library_version()) {
- boost::archive::version_type item_version(0);
- ar >> BOOST_SERIALIZATION_NVP(item_version);
- item_version_val = item_version.t;
- }
+ if(3 < ar.get_library_version())
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ else
+ item_version = 0;
     R rx;
     rx(s, count);
     std::size_t c = count;
@@ -154,7 +152,7 @@
     BOOST_DEDUCED_TYPENAME Container::iterator hint;
     hint = s.begin();
     while(c-- > 0){
- hint = ifunc(ar, s, item_version_val, hint);
+ hint = ifunc(ar, s, item_version, hint);
     }
 }
 

Modified: branches/release/boost/serialization/collections_save_imp.hpp
==============================================================================
--- branches/release/boost/serialization/collections_save_imp.hpp (original)
+++ branches/release/boost/serialization/collections_save_imp.hpp 2010-05-16 11:39:59 EDT (Sun, 16 May 2010)
@@ -19,7 +19,6 @@
 // helper function templates for serialization of collections
 
 #include <boost/config.hpp>
-#include <boost/archive/basic_archive.hpp> // for version_type
 #include <boost/serialization/nvp.hpp>
 #include <boost/serialization/serialization.hpp>
 #include <boost/serialization/version.hpp>
@@ -42,10 +41,10 @@
     // make sure the target type is registered so we can retrieve
     // the version when we load
     if(3 < ar.get_library_version()){
- const boost::archive::version_type item_version(version<
+ const unsigned int item_version = version<
             BOOST_DEDUCED_TYPENAME Container::value_type
- >::value);
- ar << BOOST_SERIALIZATION_NVP(item_version);
+ >::value;
+ ar << BOOST_SERIALIZATION_NVP(item_version);
     }
     BOOST_DEDUCED_TYPENAME Container::const_iterator it = s.begin();
     collection_size_type c=count;

Modified: branches/release/boost/serialization/hash_collections_load_imp.hpp
==============================================================================
--- branches/release/boost/serialization/hash_collections_load_imp.hpp (original)
+++ branches/release/boost/serialization/hash_collections_load_imp.hpp 2010-05-16 11:39:59 EDT (Sun, 16 May 2010)
@@ -19,10 +19,8 @@
 
 // helper function templates for serialization of hashed collections
 #include <boost/config.hpp>
-#include <boost/archive/basic_archive.hpp> // for version_type
 #include <boost/serialization/nvp.hpp>
 //#include <boost/serialization/collections_load_imp.hpp>
-#include <boost/serialization/collection_size_type.hpp>
 
 namespace boost{
 namespace serialization {
@@ -36,9 +34,9 @@
 {
     s.clear();
     // retrieve number of elements
- collection_size_type count;
- boost::archive::version_type item_version(0);
- collection_size_type bucket_count;
+ unsigned int count;
+ unsigned int item_version(0);
+ unsigned int bucket_count;;
     ar >> BOOST_SERIALIZATION_NVP(count);
     if(3 < ar.get_library_version()){
        ar >> BOOST_SERIALIZATION_NVP(bucket_count);

Modified: branches/release/boost/serialization/hash_collections_save_imp.hpp
==============================================================================
--- branches/release/boost/serialization/hash_collections_save_imp.hpp (original)
+++ branches/release/boost/serialization/hash_collections_save_imp.hpp 2010-05-16 11:39:59 EDT (Sun, 16 May 2010)
@@ -19,11 +19,9 @@
 // helper function templates for serialization of collections
 
 #include <boost/config.hpp>
-#include <boost/archive/basic_archive.hpp> // for version_type
 #include <boost/serialization/nvp.hpp>
 #include <boost/serialization/serialization.hpp>
 #include <boost/serialization/version.hpp>
-#include <boost/serialization/collection_size_type.hpp>
 
 namespace boost{
 namespace serialization {
@@ -37,20 +35,18 @@
 inline void save_hash_collection(Archive & ar, const Container &s)
 {
     // record number of elements
- unsigned int c = s.size();
- collection_size_type count(c);
+ unsigned int count = s.size();
     ar << BOOST_SERIALIZATION_NVP(count);
     // make sure the target type is registered so we can retrieve
     // the version when we load
     if(3 < ar.get_library_version()){
- const collection_size_type bucket_count(s.bucket_count());
+ const unsigned int bucket_count = s.bucket_count();
         ar << BOOST_SERIALIZATION_NVP(bucket_count);
- const boost::archive::version_type item_version(
- version<BOOST_DEDUCED_TYPENAME Container::value_type>::value);
+ const unsigned int item_version = version<BOOST_DEDUCED_TYPENAME Container::value_type>::value;
         ar << BOOST_SERIALIZATION_NVP(item_version);
     }
     BOOST_DEDUCED_TYPENAME Container::const_iterator it = s.begin();
- while(c-- > 0){
+ while(count-- > 0){
         // note borland emits a no-op without the explicit namespace
         boost::serialization::save_construct_data_adl(
             ar,

Modified: branches/release/boost/serialization/optional.hpp
==============================================================================
--- branches/release/boost/serialization/optional.hpp (original)
+++ branches/release/boost/serialization/optional.hpp 2010-05-16 11:39:59 EDT (Sun, 16 May 2010)
@@ -17,7 +17,6 @@
 #include <boost/config.hpp>
 
 #include <boost/optional.hpp>
-#include <boost/archive/basic_archive.hpp> // for version_type
 #include <boost/serialization/split_free.hpp>
 #include <boost/serialization/level.hpp>
 #include <boost/serialization/nvp.hpp>
@@ -39,8 +38,8 @@
     ar << boost::serialization::make_nvp("initialized", tflag);
     if (tflag){
         if(3 < ar.get_library_version()){
- const boost::archive::version_type v(version<T>::value);
- ar << boost::serialization::make_nvp("item_version", v);
+ const int v = version<T>::value;
+ ar << boost::serialization::make_nvp("item_version", v);
         }
         ar << boost::serialization::make_nvp("value", *t);
     }
@@ -57,9 +56,7 @@
     if (tflag){
         unsigned int v = 0;
         if(3 < ar.get_library_version()){
- boost::archive::version_type vt(v);
- ar >> boost::serialization::make_nvp("item_version", vt);
- v = vt.t;
+ ar >> boost::serialization::make_nvp("item_version", v);
         }
         detail::stack_construct<Archive, T> aux(ar, v);
         ar >> boost::serialization::make_nvp("value", aux.reference());

Modified: branches/release/boost/serialization/slist.hpp
==============================================================================
--- branches/release/boost/serialization/slist.hpp (original)
+++ branches/release/boost/serialization/slist.hpp 2010-05-16 11:39:59 EDT (Sun, 16 May 2010)
@@ -27,7 +27,6 @@
 #ifdef BOOST_HAS_SLIST
 #include BOOST_SLIST_HEADER
 
-#include <boost/archive/basic_archive.hpp> // for version_type
 #include <boost/serialization/collections_save_imp.hpp>
 #include <boost/serialization/collections_load_imp.hpp>
 #include <boost/serialization/split_free.hpp>
@@ -61,11 +60,9 @@
     ar >> BOOST_SERIALIZATION_NVP(count);
     if(std::size_t(0) == count)
         return;
- unsigned int v = 0;
+ unsigned int v;
     if(3 < ar.get_library_version()){
- boost::archive::version_type item_version(0);
- ar >> BOOST_SERIALIZATION_NVP(item_version);
- v = item_version.t;
+ ar >> boost::serialization::make_nvp("item_version", v);
     }
     boost::serialization::detail::stack_construct<Archive, U> u(ar, v);
     ar >> boost::serialization::make_nvp("item", u.reference());


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