Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60370 - in trunk/boost/archive: . detail impl
From: ramey_at_[hidden]
Date: 2010-03-08 16:45:20


Author: ramey
Date: 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
New Revision: 60370
URL: http://svn.boost.org/trac/boost/changeset/60370

Log:
Merge in changes accidently commited to release branch
Properties modified:
   trunk/boost/archive/ (props changed)
Text files modified:
   trunk/boost/archive/detail/archive_serializer_map.hpp | 4 ++--
   trunk/boost/archive/detail/basic_serializer_map.hpp | 8 ++++++--
   trunk/boost/archive/detail/interface_iarchive.hpp | 1 -
   trunk/boost/archive/detail/interface_oarchive.hpp | 1 -
   trunk/boost/archive/detail/polymorphic_iarchive_route.hpp | 14 +++++++++++---
   trunk/boost/archive/detail/polymorphic_oarchive_route.hpp | 12 ++++++++++--
   trunk/boost/archive/impl/basic_binary_oprimitive.ipp | 4 ----
   trunk/boost/archive/polymorphic_iarchive.hpp | 30 +++++++-----------------------
   trunk/boost/archive/polymorphic_oarchive.hpp | 31 ++++++++-----------------------
   trunk/boost/archive/shared_ptr_helper.hpp | 36 +++++++++++++++++++++++-------------
   10 files changed, 67 insertions(+), 74 deletions(-)

Modified: trunk/boost/archive/detail/archive_serializer_map.hpp
==============================================================================
--- trunk/boost/archive/detail/archive_serializer_map.hpp (original)
+++ trunk/boost/archive/detail/archive_serializer_map.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -36,8 +36,8 @@
 class basic_serializer;
 
 template<class Archive>
-class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) archive_serializer_map
-{
+class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
+archive_serializer_map {
 public:
     static bool insert(const basic_serializer * bs);
     static void erase(const basic_serializer * bs);

Modified: trunk/boost/archive/detail/basic_serializer_map.hpp
==============================================================================
--- trunk/boost/archive/detail/basic_serializer_map.hpp (original)
+++ trunk/boost/archive/detail/basic_serializer_map.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -34,7 +34,8 @@
 
 class basic_serializer;
 
-class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_serializer_map : public
+class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
+basic_serializer_map : public
     boost::noncopyable
 {
     struct type_info_pointer_compare
@@ -43,7 +44,10 @@
             const basic_serializer * lhs, const basic_serializer * rhs
         ) const ;
     };
- typedef std::set<const basic_serializer *, type_info_pointer_compare> map_type;
+ typedef std::set<
+ const basic_serializer *,
+ type_info_pointer_compare
+ > map_type;
     map_type m_map;
 public:
     bool insert(const basic_serializer * bs);

Modified: trunk/boost/archive/detail/interface_iarchive.hpp
==============================================================================
--- trunk/boost/archive/detail/interface_iarchive.hpp (original)
+++ trunk/boost/archive/detail/interface_iarchive.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -15,7 +15,6 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 // See http://www.boost.org for updates, documentation, and revision history.
-#include <string>
 #include <cstddef> // NULL
 #include <boost/cstdint.hpp>
 #include <boost/mpl/bool.hpp>

Modified: trunk/boost/archive/detail/interface_oarchive.hpp
==============================================================================
--- trunk/boost/archive/detail/interface_oarchive.hpp (original)
+++ trunk/boost/archive/detail/interface_oarchive.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -15,7 +15,6 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 // See http://www.boost.org for updates, documentation, and revision history.
-#include <string>
 #include <cstddef> // NULL
 #include <boost/cstdint.hpp>
 #include <boost/mpl/bool.hpp>

Modified: trunk/boost/archive/detail/polymorphic_iarchive_route.hpp
==============================================================================
--- trunk/boost/archive/detail/polymorphic_iarchive_route.hpp (original)
+++ trunk/boost/archive/detail/polymorphic_iarchive_route.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -28,6 +28,7 @@
 #endif
 
 #include <boost/cstdint.hpp>
+#include <boost/integer_traits.hpp>
 #include <boost/archive/polymorphic_iarchive.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
@@ -129,11 +130,18 @@
     virtual void load(unsigned long & t){
         ArchiveImplementation::load(t);
     }
- #if !defined(BOOST_NO_INTRINSIC_INT64_T)
- virtual void load(boost::int64_t & t){
+ #if defined(BOOST_HAS_LONG_LONG)
+ virtual void load(boost::long_long_type & t){
         ArchiveImplementation::load(t);
     }
- virtual void load(boost::uint64_t & t){
+ virtual void load(boost::ulong_long_type & t){
+ ArchiveImplementation::load(t);
+ }
+ #elif defined(BOOST_HAS_MS_INT64)
+ virtual void load(__int64 & t){
+ ArchiveImplementation::load(t);
+ }
+ virtual void load(unsigned __int64 & t){
         ArchiveImplementation::load(t);
     }
     #endif

Modified: trunk/boost/archive/detail/polymorphic_oarchive_route.hpp
==============================================================================
--- trunk/boost/archive/detail/polymorphic_oarchive_route.hpp (original)
+++ trunk/boost/archive/detail/polymorphic_oarchive_route.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -18,7 +18,6 @@
 
 #include <string>
 #include <ostream>
-#include <boost/cstdint.hpp>
 #include <cstddef> // size_t
 
 #include <boost/config.hpp>
@@ -28,6 +27,8 @@
 } // namespace std
 #endif
 
+#include <boost/cstdint.hpp>
+#include <boost/integer_traits.hpp>
 #include <boost/archive/polymorphic_oarchive.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
@@ -108,7 +109,14 @@
     virtual void save(const unsigned long t){
         ArchiveImplementation::save(t);
     }
- #if !defined(BOOST_NO_INTRINSIC_INT64_T)
+ #if defined(BOOST_HAS_LONG_LONG)
+ virtual void save(const boost::long_long_type t){
+ ArchiveImplementation::save(t);
+ }
+ virtual void save(const boost::ulong_long_type t){
+ ArchiveImplementation::save(t);
+ }
+ #elif defined(BOOST_HAS_MS_INT64)
     virtual void save(const boost::int64_t t){
         ArchiveImplementation::save(t);
     }

Modified: trunk/boost/archive/impl/basic_binary_oprimitive.ipp
==============================================================================
--- trunk/boost/archive/impl/basic_binary_oprimitive.ipp (original)
+++ trunk/boost/archive/impl/basic_binary_oprimitive.ipp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -20,7 +20,6 @@
 } // namespace std
 #endif
 
-
 #ifndef BOOST_NO_CWCHAR
 #include <cwchar>
 #ifdef BOOST_NO_STDC_NAMESPACE
@@ -30,9 +29,6 @@
 
 #include <boost/detail/workaround.hpp>
 
-#include <boost/serialization/throw_exception.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/archive/archive_exception.hpp>
 #include <boost/archive/add_facet.hpp>
 #include <boost/archive/codecvt_null.hpp>
 

Modified: trunk/boost/archive/polymorphic_iarchive.hpp
==============================================================================
--- trunk/boost/archive/polymorphic_iarchive.hpp (original)
+++ trunk/boost/archive/polymorphic_iarchive.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -38,26 +38,6 @@
 #include <boost/archive/detail/decl.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-// determine if its necessary to handle (u)int64_t specifically
-// i.e. that its not a synonym for (unsigned) long
-// if there is no 64 bit int or if its the same as a long
-// we shouldn't define separate functions for int64 data types.
-#if defined(BOOST_NO_INT64_T)
- #define BOOST_NO_INTRINSIC_INT64_T
-#else
- #if defined(ULLONG_MAX)
- #if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
- #define BOOST_NO_INTRINSIC_INT64_T
- #endif
- #elif defined(ULONG_MAX)
- #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
- #define BOOST_NO_INTRINSIC_INT64_T
- #endif
- #else
- #define BOOST_NO_INTRINSIC_INT64_T
- #endif
-#endif
-
 namespace boost {
 template<class T>
 class shared_ptr;
@@ -99,10 +79,14 @@
     virtual void load(long & t) = 0;
     virtual void load(unsigned long & t) = 0;
 
- #if !defined(BOOST_NO_INTRINSIC_INT64_T)
- virtual void load(boost::int64_t & t) = 0;
- virtual void load(boost::uint64_t & t) = 0;
+ #if defined(BOOST_HAS_LONG_LONG)
+ virtual void load(boost::long_long_type & t) = 0;
+ virtual void load(boost::ulong_long_type & t) = 0;
+ #elif defined(BOOST_HAS_MS_INT64)
+ virtual void load(__int64 & t) = 0;
+ virtual void load(unsigned __int64 & t) = 0;
     #endif
+
     virtual void load(float & t) = 0;
     virtual void load(double & t) = 0;
 

Modified: trunk/boost/archive/polymorphic_oarchive.hpp
==============================================================================
--- trunk/boost/archive/polymorphic_oarchive.hpp (original)
+++ trunk/boost/archive/polymorphic_oarchive.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -37,26 +37,6 @@
 #include <boost/archive/detail/decl.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-// determine if its necessary to handle (u)int64_t specifically
-// i.e. that its not a synonym for (unsigned) long
-// if there is no 64 bit int or if its the same as a long
-// we shouldn't define separate functions for int64 data types.
-#if defined(BOOST_NO_INT64_T)
- #define BOOST_NO_INTRINSIC_INT64_T
-#else
- #if defined(ULLONG_MAX)
- #if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
- #define BOOST_NO_INTRINSIC_INT64_T
- #endif
- #elif defined(ULONG_MAX)
- #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
- #define BOOST_NO_INTRINSIC_INT64_T
- #endif
- #else
- #define BOOST_NO_INTRINSIC_INT64_T
- #endif
-#endif
-
 namespace boost {
 template<class T>
 class shared_ptr;
@@ -97,10 +77,15 @@
     virtual void save(const unsigned int t) = 0;
     virtual void save(const long t) = 0;
     virtual void save(const unsigned long t) = 0;
- #if !defined(BOOST_NO_INTRINSIC_INT64_T)
- virtual void save(const boost::int64_t t) = 0;
- virtual void save(const boost::uint64_t t) = 0;
+
+ #if defined(BOOST_HAS_LONG_LONG)
+ virtual void save(const boost::long_long_type t) = 0;
+ virtual void save(const boost::ulong_long_type t) = 0;
+ #elif defined(BOOST_HAS_MS_INT64)
+ virtual void save(const __int64 t) = 0;
+ virtual void save(const unsigned __int64 t) = 0;
     #endif
+
     virtual void save(const float t) = 0;
     virtual void save(const double t) = 0;
 

Modified: trunk/boost/archive/shared_ptr_helper.hpp
==============================================================================
--- trunk/boost/archive/shared_ptr_helper.hpp (original)
+++ trunk/boost/archive/shared_ptr_helper.hpp 2010-03-08 16:45:18 EST (Mon, 08 Mar 2010)
@@ -7,7 +7,7 @@
 #endif
 
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// shared_ptr_helper.hpp: serialization for boost shared pointer
+// shared_ptr_helper.hpp: serialization for boost shared pointern
 
 // (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo
 // Use, modification and distribution is subject to the Boost Software
@@ -32,7 +32,7 @@
 #include <boost/archive/archive_exception.hpp>
 #include <boost/archive/detail/decl.hpp>
 
-#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
+#include <boost/archive/detail/abi_prefix.hpp> // must be the last headern
 
 namespace boost_132 {
     template<class T> class shared_ptr;
@@ -121,6 +121,9 @@
         const boost::serialization::extended_type_info * this_type
     );
 
+ BOOST_ARCHIVE_DECL(void)
+ append(const boost::shared_ptr<const void> &);
+
     template<class T>
     struct non_polymorphic {
         static const boost::serialization::extended_type_info *
@@ -153,7 +156,7 @@
                     ::get_const_instance();
 
         // get pointer to the most derived object. This is effectively
- // the object identifer
+ // the object identifern
         typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
             is_polymorphic<T>,
             mpl::identity<polymorphic<T> >,
@@ -163,7 +166,7 @@
         const boost::serialization::extended_type_info * true_type
             = type::get_object_identifier(*t);
 
- // note:if this exception is thrown, be sure that derived pointer
+ // note:if this exception is thrown, be sure that derived pointern
         // is either registered or exported.
         if(NULL == true_type)
             boost::serialization::throw_exception(
@@ -178,15 +181,22 @@
                 true_type,
                 this_type
             );
-
- s = shared_ptr<T>(
- r,
- static_cast<T *>(r.get())
- );
-
- //s = static_pointer_cast<T,void>(
- // const_pointer_cast<void, const void>(*r)
- //);
+ if(!r){
+ s.reset(t);
+ const void * od = void_downcast(
+ *true_type,
+ *this_type,
+ static_cast<const void *>(t)
+ );
+ shared_ptr<const void> sp(s, od);
+ append(sp);
+ }
+ else{
+ s = shared_ptr<T>(
+ r,
+ static_cast<T *>(r.get())
+ );
+ }
     }
 
 // #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_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