Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49603 - in branches/serialization_helper_support: boost/archive boost/archive/detail boost/archive/impl boost/serialization libs/detail libs/serialization/doc libs/serialization/example libs/serialization/src libs/serialization/test
From: joaquin_at_[hidden]
Date: 2008-11-05 16:39:32


Author: joaquin
Date: 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
New Revision: 49603
URL: http://svn.boost.org/trac/boost/changeset/49603

Log:
helper support first draft
Added:
   branches/serialization_helper_support/boost/archive/detail/helper_collection.hpp (contents, props changed)
   branches/serialization_helper_support/boost/serialization/shared_ptr_helper.hpp (contents, props changed)
   branches/serialization_helper_support/libs/detail/
   branches/serialization_helper_support/libs/detail/utf8_codecvt_facet.cpp (contents, props changed)
   branches/serialization_helper_support/libs/serialization/test/test_helper_support.cpp (contents, props changed)
Text files modified:
   branches/serialization_helper_support/boost/archive/basic_binary_iarchive.hpp | 12 ++--
   branches/serialization_helper_support/boost/archive/basic_binary_oarchive.hpp | 12 ++--
   branches/serialization_helper_support/boost/archive/basic_text_iarchive.hpp | 12 ++--
   branches/serialization_helper_support/boost/archive/basic_text_oarchive.hpp | 12 ++--
   branches/serialization_helper_support/boost/archive/basic_xml_iarchive.hpp | 10 ++--
   branches/serialization_helper_support/boost/archive/basic_xml_oarchive.hpp | 10 ++--
   branches/serialization_helper_support/boost/archive/binary_iarchive.hpp | 43 ++++++++++----------
   branches/serialization_helper_support/boost/archive/binary_iarchive_impl.hpp | 18 ++++----
   branches/serialization_helper_support/boost/archive/binary_oarchive.hpp | 46 ++++++++++++++++++++--
   branches/serialization_helper_support/boost/archive/binary_oarchive_impl.hpp | 16 +++---
   branches/serialization_helper_support/boost/archive/binary_wiarchive.hpp | 38 +++++++++---------
   branches/serialization_helper_support/boost/archive/binary_woarchive.hpp | 51 +++++++++++++++++++++--
   branches/serialization_helper_support/boost/archive/detail/common_iarchive.hpp | 8 +-
   branches/serialization_helper_support/boost/archive/detail/common_oarchive.hpp | 8 +-
   branches/serialization_helper_support/boost/archive/detail/interface_iarchive.hpp | 6 +
   branches/serialization_helper_support/boost/archive/detail/interface_oarchive.hpp | 6 +
   branches/serialization_helper_support/boost/archive/impl/basic_binary_iarchive.ipp | 8 +-
   branches/serialization_helper_support/boost/archive/impl/basic_binary_oarchive.ipp | 4
   branches/serialization_helper_support/boost/archive/impl/basic_text_iarchive.ipp | 8 +-
   branches/serialization_helper_support/boost/archive/impl/basic_text_oarchive.ipp | 8 +-
   branches/serialization_helper_support/boost/archive/impl/basic_xml_iarchive.ipp | 34 ++++++++--------
   branches/serialization_helper_support/boost/archive/impl/basic_xml_oarchive.ipp | 82 ++++++++++++++++++++--------------------
   branches/serialization_helper_support/boost/archive/impl/text_iarchive_impl.ipp | 36 ++++++++--------
   branches/serialization_helper_support/boost/archive/impl/text_oarchive_impl.ipp | 28 ++++++------
   branches/serialization_helper_support/boost/archive/impl/text_wiarchive_impl.ipp | 24 +++++-----
   branches/serialization_helper_support/boost/archive/impl/text_woarchive_impl.ipp | 16 +++---
   branches/serialization_helper_support/boost/archive/impl/xml_iarchive_impl.ipp | 34 ++++++++--------
   branches/serialization_helper_support/boost/archive/impl/xml_oarchive_impl.ipp | 22 +++++-----
   branches/serialization_helper_support/boost/archive/impl/xml_wiarchive_impl.ipp | 34 ++++++++--------
   branches/serialization_helper_support/boost/archive/impl/xml_woarchive_impl.ipp | 22 +++++-----
   branches/serialization_helper_support/boost/archive/polymorphic_binary_oarchive.hpp | 3
   branches/serialization_helper_support/boost/archive/polymorphic_iarchive.hpp | 13 +----
   branches/serialization_helper_support/boost/archive/polymorphic_oarchive.hpp | 4
   branches/serialization_helper_support/boost/archive/polymorphic_text_oarchive.hpp | 2
   branches/serialization_helper_support/boost/archive/text_iarchive.hpp | 33 ++++-----------
   branches/serialization_helper_support/boost/archive/text_oarchive.hpp | 27 +++++++++---
   branches/serialization_helper_support/boost/archive/text_wiarchive.hpp | 33 ++++-----------
   branches/serialization_helper_support/boost/archive/text_woarchive.hpp | 30 +++++++++----
   branches/serialization_helper_support/boost/archive/xml_iarchive.hpp | 33 ++++-----------
   branches/serialization_helper_support/boost/archive/xml_oarchive.hpp | 26 ++++++++---
   branches/serialization_helper_support/boost/archive/xml_wiarchive.hpp | 33 ++++-----------
   branches/serialization_helper_support/boost/archive/xml_woarchive.hpp | 26 ++++++++---
   branches/serialization_helper_support/boost/serialization/shared_ptr.hpp | 7 +-
   branches/serialization_helper_support/boost/serialization/split_free.hpp | 4
   branches/serialization_helper_support/boost/serialization/split_member.hpp | 4
   branches/serialization_helper_support/libs/serialization/doc/archives.html | 40 +++++++++++++++++++
   branches/serialization_helper_support/libs/serialization/doc/contents.html | 1
   branches/serialization_helper_support/libs/serialization/doc/implementation.html | 10 ++++
   branches/serialization_helper_support/libs/serialization/doc/special.html | 60 +++++++++++++++++++++++++++++
   branches/serialization_helper_support/libs/serialization/example/demo_fast_archive.cpp | 20 +++++---
   branches/serialization_helper_support/libs/serialization/example/portable_binary_iarchive.hpp | 6 -
   branches/serialization_helper_support/libs/serialization/example/portable_binary_oarchive.hpp | 3
   branches/serialization_helper_support/libs/serialization/src/binary_iarchive.cpp | 10 ++-
   branches/serialization_helper_support/libs/serialization/src/binary_oarchive.cpp | 20 ++++++++
   branches/serialization_helper_support/libs/serialization/src/binary_wiarchive.cpp | 10 ++-
   branches/serialization_helper_support/libs/serialization/src/binary_woarchive.cpp | 20 ++++++++
   branches/serialization_helper_support/libs/serialization/src/text_iarchive.cpp | 8 +-
   branches/serialization_helper_support/libs/serialization/src/text_oarchive.cpp | 8 ++
   branches/serialization_helper_support/libs/serialization/src/text_wiarchive.cpp | 8 +-
   branches/serialization_helper_support/libs/serialization/src/text_woarchive.cpp | 8 ++
   branches/serialization_helper_support/libs/serialization/src/xml_iarchive.cpp | 8 +-
   branches/serialization_helper_support/libs/serialization/src/xml_oarchive.cpp | 9 +++
   branches/serialization_helper_support/libs/serialization/src/xml_wiarchive.cpp | 8 +-
   branches/serialization_helper_support/libs/serialization/src/xml_woarchive.cpp | 8 ++
   branches/serialization_helper_support/libs/serialization/test/Jamfile.v2 | 1
   65 files changed, 722 insertions(+), 490 deletions(-)

Modified: branches/serialization_helper_support/boost/archive/basic_binary_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/basic_binary_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/basic_binary_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -38,9 +38,9 @@
 
 /////////////////////////////////////////////////////////////////////////
 // class basic_binary_iarchive - read serialized objects from a input binary stream
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class basic_binary_iarchive :
- public detail::common_iarchive<Archive>
+ public detail::common_iarchive<Archive, HelperSupport>
 {
 protected:
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
@@ -48,15 +48,15 @@
 #elif defined(BOOST_MSVC)
     // for some inexplicable reason insertion of "class" generates compile erro
     // on msvc 7.1
- friend detail::interface_iarchive<Archive>;
+ friend detail::interface_iarchive<Archive, HelperSupport>;
 #else
- friend class detail::interface_iarchive<Archive>;
+ friend class detail::interface_iarchive<Archive, HelperSupport>;
 #endif
     // intermediate level to support override of operators
     // fot templates in the absence of partial function
     // template ordering. If we get here pass to base class
     // note extra nonsense to sneak it pass the borland compiers
- typedef detail::common_iarchive<Archive> detail_common_iarchive;
+ typedef detail::common_iarchive<Archive, HelperSupport> detail_common_iarchive;
     template<class T>
     void load_override(T & t, BOOST_PFTO int version){
       this->detail_common_iarchive::load_override(t, static_cast<int>(version));
@@ -113,7 +113,7 @@
     init();
    
     basic_binary_iarchive(unsigned int flags) :
- detail::common_iarchive<Archive>(flags)
+ detail::common_iarchive<Archive, HelperSupport>(flags)
     {}
 };
 

Modified: branches/serialization_helper_support/boost/archive/basic_binary_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/basic_binary_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/basic_binary_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -42,9 +42,9 @@
 // by a program built with the same tools for the same machne. This class
 // does have the virtue of buiding the smalles archive in the minimum amount
 // of time. So under some circumstances it may be he right choice.
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class basic_binary_oarchive :
- public archive::detail::common_oarchive<Archive>
+ public archive::detail::common_oarchive<Archive, HelperSupport>
 {
 protected:
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
@@ -52,12 +52,12 @@
 #elif defined(BOOST_MSVC)
     // for some inexplicable reason insertion of "class" generates compile erro
     // on msvc 7.1
- friend detail::interface_oarchive<Archive>;
+ friend detail::interface_oarchive<Archive, HelperSupport>;
 #else
- friend class detail::interface_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
 #endif
     // any datatype not specifed below will be handled by base class
- typedef detail::common_oarchive<Archive> detail_common_oarchive;
+ typedef detail::common_oarchive<Archive, HelperSupport> detail_common_oarchive;
     template<class T>
     void save_override(const T & t, BOOST_PFTO int version){
       this->detail_common_oarchive::save_override(t, static_cast<int>(version));
@@ -113,7 +113,7 @@
     init();
 
     basic_binary_oarchive(unsigned int flags) :
- detail::common_oarchive<Archive>(flags)
+ detail::common_oarchive<Archive, HelperSupport>(flags)
     {}
 };
 

Modified: branches/serialization_helper_support/boost/archive/basic_text_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/basic_text_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/basic_text_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -38,9 +38,9 @@
 
 /////////////////////////////////////////////////////////////////////////
 // class basic_text_iarchive - read serialized objects from a input text stream
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class basic_text_iarchive :
- public detail::common_iarchive<Archive>
+ public detail::common_iarchive<Archive, HelperSupport>
 {
 protected:
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
@@ -48,14 +48,14 @@
 #elif defined(BOOST_MSVC)
     // for some inexplicable reason insertion of "class" generates compile erro
     // on msvc 7.1
- friend detail::interface_iarchive<Archive>;
+ friend detail::interface_iarchive<Archive, HelperSupport>;
 #else
- friend class detail::interface_iarchive<Archive>;
+ friend class detail::interface_iarchive<Archive, HelperSupport>;
 #endif
     // intermediate level to support override of operators
     // fot templates in the absence of partial function
     // template ordering
- typedef detail::common_iarchive<Archive> detail_common_iarchive;
+ typedef detail::common_iarchive<Archive, HelperSupport> detail_common_iarchive;
     template<class T>
     void load_override(T & t, BOOST_PFTO int)
     {
@@ -71,7 +71,7 @@
     init(void);
 
     basic_text_iarchive(unsigned int flags) :
- detail::common_iarchive<Archive>(flags)
+ detail::common_iarchive<Archive, HelperSupport>(flags)
     {}
     ~basic_text_iarchive(){}
 };

Modified: branches/serialization_helper_support/boost/archive/basic_text_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/basic_text_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/basic_text_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -39,9 +39,9 @@
 
 /////////////////////////////////////////////////////////////////////////
 // class basic_text_oarchive
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class basic_text_oarchive :
- public detail::common_oarchive<Archive>
+ public detail::common_oarchive<Archive, HelperSupport>
 {
 protected:
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
@@ -50,9 +50,9 @@
 #elif defined(BOOST_MSVC)
     // for some inexplicable reason insertion of "class" generates compile erro
     // on msvc 7.1
- friend detail::interface_oarchive<Archive>;
+ friend detail::interface_oarchive<Archive, HelperSupport>;
 #else
- friend class detail::interface_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
 #endif
     enum {
         none,
@@ -69,7 +69,7 @@
 
     // default processing - kick back to base class. Note the
     // extra stuff to get it passed borland compilers
- typedef detail::common_oarchive<Archive> detail_common_oarchive;
+ typedef detail::common_oarchive<Archive, HelperSupport> detail_common_oarchive;
     template<class T>
     void save_override(T & t, BOOST_PFTO int){
         this->detail_common_oarchive::save_override(t, 0);
@@ -120,7 +120,7 @@
     init();
 
     basic_text_oarchive(unsigned int flags) :
- detail::common_oarchive<Archive>(flags),
+ detail::common_oarchive<Archive, HelperSupport>(flags),
         delimiter(none)
     {}
     ~basic_text_oarchive(){}

Modified: branches/serialization_helper_support/boost/archive/basic_xml_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/basic_xml_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/basic_xml_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -34,9 +34,9 @@
 
 /////////////////////////////////////////////////////////////////////////
 // class xml_iarchive - read serialized objects from a input text stream
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class basic_xml_iarchive :
- public detail::common_iarchive<Archive>
+ public detail::common_iarchive<Archive, HelperSupport>
 {
 protected:
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
@@ -44,9 +44,9 @@
 #elif defined(BOOST_MSVC)
     // for some inexplicable reason insertion of "class" generates compile erro
     // on msvc 7.1
- friend detail::interface_oarchive<Archive>;
+ friend detail::interface_oarchive<Archive, HelperSupport>;
 #else
- friend class detail::interface_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
 #endif
     unsigned int depth;
     BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
@@ -68,7 +68,7 @@
 
     // Anything not an attribute - see below - should be a name value
     // pair and be processed here
- typedef detail::common_iarchive<Archive> detail_common_iarchive;
+ typedef detail::common_iarchive<Archive, HelperSupport> detail_common_iarchive;
     template<class T>
     void load_override(
         #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING

Modified: branches/serialization_helper_support/boost/archive/basic_xml_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/basic_xml_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/basic_xml_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -34,9 +34,9 @@
 
 //////////////////////////////////////////////////////////////////////
 // class basic_xml_oarchive - write serialized objects to a xml output stream
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class basic_xml_oarchive :
- public detail::common_oarchive<Archive>
+ public detail::common_oarchive<Archive, HelperSupport>
 {
 protected:
 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
@@ -44,10 +44,10 @@
 #elif defined(BOOST_MSVC)
     // for some inexplicable reason insertion of "class" generates compile erro
     // on msvc 7.1
- friend detail::interface_oarchive<Archive>;
+ friend detail::interface_oarchive<Archive, HelperSupport>;
     friend class save_access;
 #else
- friend class detail::interface_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
     friend class save_access;
 #endif
     // special stuff for xml output
@@ -90,7 +90,7 @@
     }
 
    // special treatment for name-value pairs.
- typedef detail::common_oarchive<Archive> detail_common_oarchive;
+ typedef detail::common_oarchive<Archive, HelperSupport> detail_common_oarchive;
     template<class T>
     void save_override(
         #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING

Modified: branches/serialization_helper_support/boost/archive/binary_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/binary_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/binary_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -26,39 +26,34 @@
 // via inhertance, derived from text_iarchive_impl instead. This will
 // preserve correct static polymorphism.
 
-// same as binary_iarchive below - without the shared_ptr_helper
+// same as binary_iarchive below - without helper support
 class naked_binary_iarchive :
     public binary_iarchive_impl<
         boost::archive::naked_binary_iarchive,
         std::istream::char_type,
- std::istream::traits_type
+ std::istream::traits_type,
+ false // no helper support
>
 {
 public:
     naked_binary_iarchive(std::istream & is, unsigned int flags = 0) :
         binary_iarchive_impl<
- naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
+ naked_binary_iarchive,
+ std::istream::char_type,
+ std::istream::traits_type,
+ false
>(is, flags)
     {}
     naked_binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
         binary_iarchive_impl<
- naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
+ naked_binary_iarchive,
+ std::istream::char_type,
+ std::istream::traits_type,
+ false
>(bsb, flags)
     {}
 };
 
-} // namespace archive
-} // namespace boost
-
-// note special treatment of shared_ptr. This type needs a special
-// structure associated with every archive. We created a "mix-in"
-// class to provide this functionality. Since shared_ptr holds a
-// special esteem in the boost library - we included it here by default.
-#include <boost/archive/shared_ptr_helper.hpp>
-
-namespace boost {
-namespace archive {
-
 // do not derive from this class. If you want to extend this functionality
 // via inhertance, derived from binary_iarchive_impl instead. This will
 // preserve correct static polymorphism.
@@ -66,19 +61,25 @@
     public binary_iarchive_impl<
         boost::archive::binary_iarchive,
         std::istream::char_type,
- std::istream::traits_type
- >,
- public detail::shared_ptr_helper
+ std::istream::traits_type,
+ true // helper support
+ >
 {
 public:
     binary_iarchive(std::istream & is, unsigned int flags = 0) :
         binary_iarchive_impl<
- binary_iarchive, std::istream::char_type, std::istream::traits_type
+ binary_iarchive,
+ std::istream::char_type,
+ std::istream::traits_type,
+ true
>(is, flags)
     {}
     binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
         binary_iarchive_impl<
- binary_iarchive, std::istream::char_type, std::istream::traits_type
+ binary_iarchive,
+ std::istream::char_type,
+ std::istream::traits_type,
+ true
>(bsb, flags)
     {}
 };

Modified: branches/serialization_helper_support/boost/archive/binary_iarchive_impl.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/binary_iarchive_impl.hpp (original)
+++ branches/serialization_helper_support/boost/archive/binary_iarchive_impl.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -24,16 +24,16 @@
 namespace boost {
 namespace archive {
 
-template<class Archive, class Elem, class Tr>
+template<class Archive, class Elem, class Tr, bool HelperSupport>
 class binary_iarchive_impl :
     public basic_binary_iprimitive<Archive, Elem, Tr>,
- public basic_binary_iarchive<Archive>
+ public basic_binary_iarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_iarchive<Archive>;
- friend class basic_binary_iarchive<Archive>;
+ friend class detail::interface_iarchive<Archive, HelperSupport>;
+ friend class basic_binary_iarchive<Archive, HelperSupport>;
     friend class load_access;
 protected:
 #endif
@@ -42,16 +42,16 @@
     // make this protected so it can be called from a derived archive
     template<class T>
     void load_override(T & t, BOOST_PFTO int){
- this->basic_binary_iarchive<Archive>::load_override(t, 0L);
+ this->basic_binary_iarchive<Archive, HelperSupport>::load_override(t, 0L);
     }
     void init(unsigned int flags){
         if(0 != (flags & no_header))
             return;
         #if ! defined(__MWERKS__)
- this->basic_binary_iarchive<Archive>::init();
+ this->basic_binary_iarchive<Archive, HelperSupport>::init();
             this->basic_binary_iprimitive<Archive, Elem, Tr>::init();
         #else
- basic_binary_iarchive<Archive>::init();
+ basic_binary_iarchive<Archive, HelperSupport>::init();
             basic_binary_iprimitive<Archive, Elem, Tr>::init();
         #endif
     }
@@ -63,7 +63,7 @@
             bsb,
             0 != (flags & no_codecvt)
         ),
- basic_binary_iarchive<Archive>(flags)
+ basic_binary_iarchive<Archive, HelperSupport>(flags)
     {
         init(flags);
     }
@@ -75,7 +75,7 @@
             * is.rdbuf(),
             0 != (flags & no_codecvt)
         ),
- basic_binary_iarchive<Archive>(flags)
+ basic_binary_iarchive<Archive, HelperSupport>(flags)
     {
         init(flags);
     }

Modified: branches/serialization_helper_support/boost/archive/binary_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/binary_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/binary_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -25,26 +25,62 @@
 // do not derive from this class. If you want to extend this functionality
 // via inhertance, derived from binary_oarchive_impl instead. This will
 // preserve correct static polymorphism.
+
+// same as binary_oarchive below - without helper support
+class naked_binary_oarchive :
+ public binary_oarchive_impl<
+ naked_binary_oarchive ,
+ std::ostream::char_type,
+ std::ostream::traits_type,
+ false // no helper_support
+ >
+{
+public:
+ naked_binary_oarchive(std::ostream & os, unsigned int flags = 0) :
+ binary_oarchive_impl<
+ naked_binary_oarchive,
+ std::ostream::char_type,
+ std::ostream::traits_type,
+ false
+ >(os, flags)
+ {}
+ naked_binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) :
+ binary_oarchive_impl<
+ naked_binary_oarchive,
+ std::ostream::char_type,
+ std::ostream::traits_type,
+ false
+ >(bsb, flags)
+ {}
+};
+
 class binary_oarchive :
     public binary_oarchive_impl<
- binary_oarchive, std::ostream::char_type, std::ostream::traits_type
+ binary_oarchive,
+ std::ostream::char_type,
+ std::ostream::traits_type,
+ true // helper support
>
 {
 public:
     binary_oarchive(std::ostream & os, unsigned int flags = 0) :
         binary_oarchive_impl<
- binary_oarchive, std::ostream::char_type, std::ostream::traits_type
+ binary_oarchive,
+ std::ostream::char_type,
+ std::ostream::traits_type,
+ true
>(os, flags)
     {}
     binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) :
         binary_oarchive_impl<
- binary_oarchive, std::ostream::char_type, std::ostream::traits_type
+ binary_oarchive,
+ std::ostream::char_type,
+ std::ostream::traits_type,
+ true
>(bsb, flags)
     {}
 };
 
-typedef binary_oarchive naked_binary_oarchive;
-
 } // namespace archive
 } // namespace boost
 

Modified: branches/serialization_helper_support/boost/archive/binary_oarchive_impl.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/binary_oarchive_impl.hpp (original)
+++ branches/serialization_helper_support/boost/archive/binary_oarchive_impl.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -24,16 +24,16 @@
 namespace boost {
 namespace archive {
 
-template<class Archive, class Elem, class Tr>
+template<class Archive, class Elem, class Tr, bool HelperSupport>
 class binary_oarchive_impl :
     public basic_binary_oprimitive<Archive, Elem, Tr>,
- public basic_binary_oarchive<Archive>
+ public basic_binary_oarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_oarchive<Archive>;
- friend class basic_binary_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
+ friend class basic_binary_oarchive<Archive, HelperSupport>;
     friend class save_access;
 protected:
 #endif
@@ -42,13 +42,13 @@
     // make this protected so it can be called from a derived archive
     template<class T>
     void save_override(T & t, BOOST_PFTO int){
- this->basic_binary_oarchive<Archive>::save_override(t, 0L);
+ this->basic_binary_oarchive<Archive, HelperSupport>::save_override(t, 0L);
     }
     void init(unsigned int flags) {
         if(0 != (flags & no_header))
             return;
         #if ! defined(__MWERKS__)
- this->basic_binary_oarchive<Archive>::init();
+ this->basic_binary_oarchive<Archive, HelperSupport>::init();
             this->basic_binary_oprimitive<Archive, Elem, Tr>::init();
         #else
             basic_binary_oarchive<Archive>::init();
@@ -63,7 +63,7 @@
             bsb,
             0 != (flags & no_codecvt)
         ),
- basic_binary_oarchive<Archive>(flags)
+ basic_binary_oarchive<Archive, HelperSupport>(flags)
     {
         init(flags);
     }
@@ -75,7 +75,7 @@
             * os.rdbuf(),
             0 != (flags & no_codecvt)
         ),
- basic_binary_oarchive<Archive>(flags)
+ basic_binary_oarchive<Archive, HelperSupport>(flags)
     {
         init(flags);
     }

Modified: branches/serialization_helper_support/boost/archive/binary_wiarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/binary_wiarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/binary_wiarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -27,12 +27,13 @@
 namespace boost {
 namespace archive {
 
-// same as binary_wiarchive below - without the shared_ptr_helper
+// same as binary_wiarchive below - without helper support
 class naked_binary_wiarchive :
     public binary_iarchive_impl<
         boost::archive::naked_binary_wiarchive,
         std::wistream::char_type,
- std::wistream::traits_type
+ std::wistream::traits_type,
+ false // no helper support
>
 {
 public:
@@ -40,44 +41,43 @@
         binary_iarchive_impl<
             naked_binary_wiarchive,
             std::wistream::char_type,
- std::wistream::traits_type
+ std::wistream::traits_type,
+ false
>(is, flags)
     {}
     naked_binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
         binary_iarchive_impl<
             naked_binary_wiarchive,
             std::wistream::char_type,
- std::wistream::traits_type
+ std::wistream::traits_type,
+ false
>(bsb, flags)
     {}
 };
 
-} // namespace archive
-} // namespace boost
-
-// note special treatment of shared_ptr. This type needs a special
-// structure associated with every archive. We created a "mix-in"
-// class to provide this functionality. Since shared_ptr holds a
-// special esteem in the boost library - we included it here by default.
-#include <boost/archive/shared_ptr_helper.hpp>
-
-namespace boost {
-namespace archive {
-
 class binary_wiarchive :
     public binary_iarchive_impl<
- binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
+ binary_wiarchive,
+ std::wistream::char_type,
+ std::wistream::traits_type,
+ true // helper support
>
 {
 public:
     binary_wiarchive(std::wistream & is, unsigned int flags = 0) :
         binary_iarchive_impl<
- binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
+ binary_wiarchive,
+ std::wistream::char_type,
+ std::wistream::traits_type,
+ true
>(is, flags)
     {}
     binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
         binary_iarchive_impl<
- binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
+ binary_wiarchive,
+ std::wistream::char_type,
+ std::wistream::traits_type,
+ true
>(bsb, flags)
     {}
 };

Modified: branches/serialization_helper_support/boost/archive/binary_woarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/binary_woarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/binary_woarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -30,26 +30,65 @@
 // do not derive from this class. If you want to extend this functionality
 // via inhertance, derived from binary_oarchive_impl instead. This will
 // preserve correct static polymorphism.
+
+// same as binary_iarchive below - without helper support
+class naked_binary_woarchive :
+ public binary_oarchive_impl<
+ naked_binary_woarchive,
+ std::wostream::char_type,
+ std::wostream::traits_type,
+ false // no helper support
+ >
+{
+public:
+ naked_binary_woarchive(std::wostream & os, unsigned int flags = 0) :
+ binary_oarchive_impl<
+ naked_binary_woarchive,
+ std::wostream::char_type,
+ std::wostream::traits_type,
+ false
+ >(os, flags)
+ {}
+ naked_binary_woarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
+ binary_oarchive_impl<
+ naked_binary_woarchive,
+ std::wostream::char_type,
+ std::wostream::traits_type,
+ false
+ >(bsb, flags)
+ {}
+};
+
+// do not derive from this class. If you want to extend this functionality
+// via inhertance, derived from binary_oarchive_impl instead. This will
+// preserve correct static polymorphism.
 class binary_woarchive :
     public binary_oarchive_impl<
- binary_woarchive, std::wostream::char_type, std::wostream::traits_type
- >
+ binary_woarchive,
+ std::wostream::char_type,
+ std::wostream::traits_type,
+ true // helper support
+ >
 {
 public:
     binary_woarchive(std::wostream & os, unsigned int flags = 0) :
         binary_oarchive_impl<
- binary_woarchive, std::wostream::char_type, std::wostream::traits_type
+ binary_woarchive,
+ std::wostream::char_type,
+ std::wostream::traits_type,
+ true
>(os, flags)
     {}
     binary_woarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
         binary_oarchive_impl<
- binary_woarchive, std::wostream::char_type, std::wostream::traits_type
+ binary_woarchive,
+ std::wostream::char_type,
+ std::wostream::traits_type,
+ true
>(bsb, flags)
     {}
 };
 
-typedef binary_woarchive naked_binary_woarchive;
-
 } // namespace archive
 } // namespace boost
 

Modified: branches/serialization_helper_support/boost/archive/detail/common_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/detail/common_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/detail/common_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -27,12 +27,12 @@
 namespace detail {
 
 // note: referred to as Curiously Recurring Template Patter (CRTP)
-template<class Archive>
+template<class Archive, bool HelperSupport = true>
 class common_iarchive :
     public basic_iarchive,
- public interface_iarchive<Archive>
+ public interface_iarchive<Archive, HelperSupport>
 {
- friend class interface_iarchive<Archive>;
+ friend class interface_iarchive<Archive, HelperSupport>;
 private:
     virtual void vload(version_type & t){
         * this->This() >> t;
@@ -65,7 +65,7 @@
     // default archive initialization
     common_iarchive(unsigned int flags = 0) :
         basic_iarchive(flags),
- interface_iarchive<Archive>()
+ interface_iarchive<Archive, HelperSupport>()
     {}
 };
 

Modified: branches/serialization_helper_support/boost/archive/detail/common_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/detail/common_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/detail/common_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -26,12 +26,12 @@
 namespace detail {
 
 // note: referred to as Curiously Recurring Template Patter (CRTP)
-template<class Archive>
+template<class Archive, bool HelperSupport = true>
 class common_oarchive :
     public basic_oarchive,
- public interface_oarchive<Archive>
+ public interface_oarchive<Archive, HelperSupport>
 {
- friend class interface_oarchive<Archive>;
+ friend class interface_oarchive<Archive, HelperSupport>;
 private:
     virtual void vsave(const version_type t){
         * this->This() << t;
@@ -67,7 +67,7 @@
     void save_end(const char * /*name*/){}
     common_oarchive(unsigned int flags = 0) :
         basic_oarchive(flags),
- interface_oarchive<Archive>()
+ interface_oarchive<Archive, HelperSupport>()
     {}
 };
 

Added: branches/serialization_helper_support/boost/archive/detail/helper_collection.hpp
==============================================================================
--- (empty file)
+++ branches/serialization_helper_support/boost/archive/detail/helper_collection.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -0,0 +1,81 @@
+#ifndef BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP
+#define BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// helper_collection.hpp: archive support for run-time helpers
+
+// (C) Copyright 2002-2008 Robert Ramey and Joaquin M Lopez Munoz
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <cstddef> // NULL
+#include <map>
+
+#include <boost/shared_ptr.hpp>
+
+namespace boost {
+namespace archive {
+namespace detail {
+
+class helper_collection
+{
+ helper_collection(const helper_collection&); // non-copyable
+ helper_collection& operator = (const helper_collection&); // non-copyable
+
+ typedef std::map<
+ const boost::serialization::extended_type_info *,
+ shared_ptr<void> > collection;
+ typedef collection::value_type helper_value_type;
+ typedef collection::iterator helper_iterator;
+
+ // dynamically allocated to minimize penalty when not used
+ collection * m_helpers;
+
+ collection& helpers()
+ {
+ if(!m_helpers) m_helpers = new collection;
+ return *m_helpers;
+ };
+protected:
+ helper_collection(): m_helpers(NULL){}
+ ~helper_collection()
+ {
+ delete m_helpers;
+ }
+public:
+ template<typename Helper>
+ Helper& get_helper(Helper * = NULL)
+ {
+ const boost::serialization::extended_type_info * eti =
+ &boost::serialization::type_info_implementation<Helper>::
+ type::get_const_instance();
+ helper_iterator it = helpers().find(eti);
+ if(it == helpers().end())
+ it = helpers().insert(
+ helper_value_type(
+ eti,
+ shared_ptr<void>(new Helper))).first;
+ return *static_cast<Helper *>(it->second.get());
+ }
+};
+
+// conditionally derive from helper_collection
+template<bool Derive>
+struct derive_from_helper_collection{};
+
+template<>
+struct derive_from_helper_collection<true>: helper_collection{};
+
+} // namespace detail
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP

Modified: branches/serialization_helper_support/boost/archive/detail/interface_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/detail/interface_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/detail/interface_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -20,6 +20,7 @@
 #include <boost/cstdint.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
+#include <boost/archive/detail/helper_collection.hpp>
 #include <boost/archive/detail/iserializer.hpp>
 #include <boost/serialization/singleton.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
@@ -30,8 +31,9 @@
 
 class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
 
-template<class Archive>
-class interface_iarchive
+template<class Archive, bool HelperSupport>
+class interface_iarchive :
+ public derive_from_helper_collection<HelperSupport>
 {
 protected:
     interface_iarchive(){};

Modified: branches/serialization_helper_support/boost/archive/detail/interface_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/detail/interface_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/detail/interface_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -21,6 +21,7 @@
 #include <boost/mpl/bool.hpp>
 
 #include <boost/archive/detail/auto_link_archive.hpp>
+#include <boost/archive/detail/helper_collection.hpp>
 #include <boost/archive/detail/oserializer.hpp>
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
@@ -32,8 +33,9 @@
 
 class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
 
-template<class Archive>
-class interface_oarchive
+template<class Archive, bool HelperSupport>
+class interface_oarchive :
+ public derive_from_helper_collection<HelperSupport>
 {
 protected:
     interface_oarchive(){};

Modified: branches/serialization_helper_support/boost/archive/impl/basic_binary_iarchive.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/basic_binary_iarchive.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/basic_binary_iarchive.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -28,9 +28,9 @@
 
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // implementation of binary_binary_archive
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_binary_iarchive<Archive>::load_override(class_name_type & t, int){
+basic_binary_iarchive<Archive, HelperSupport>::load_override(class_name_type & t, int){
     std::string cn;
     cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
     load_override(cn, 0);
@@ -43,9 +43,9 @@
     t.t[cn.size()] = '\0';
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_binary_iarchive<Archive>::init(){
+basic_binary_iarchive<Archive, HelperSupport>::init(){
     // read signature in an archive version independent manner
     std::string file_signature;
     * this->This() >> file_signature;

Modified: branches/serialization_helper_support/boost/archive/impl/basic_binary_oarchive.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/basic_binary_oarchive.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/basic_binary_oarchive.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -27,13 +27,13 @@
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // implementation of binary_binary_oarchive
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 #if !defined(__BORLANDC__)
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 #else
 void
 #endif
-basic_binary_oarchive<Archive>::init(){
+basic_binary_oarchive<Archive, HelperSupport>::init(){
     // write signature in an archive version independent manner
     const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
     * this->This() << file_signature;

Modified: branches/serialization_helper_support/boost/archive/impl/basic_text_iarchive.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/basic_text_iarchive.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/basic_text_iarchive.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -28,9 +28,9 @@
 
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // implementation of text_text_archive
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_text_iarchive<Archive>::load_override(class_name_type & t, int){
+basic_text_iarchive<Archive, HelperSupport>::load_override(class_name_type & t, int){
     std::string cn;
     cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
     load_override(cn, 0);
@@ -43,9 +43,9 @@
     t.t[cn.size()] = '\0';
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_text_iarchive<Archive>::init(void){
+basic_text_iarchive<Archive, HelperSupport>::init(void){
     // read signature in an archive version independent manner
     std::string file_signature;
     * this->This() >> file_signature;

Modified: branches/serialization_helper_support/boost/archive/impl/basic_text_oarchive.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/basic_text_oarchive.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/basic_text_oarchive.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -26,9 +26,9 @@
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // implementation of basic_text_oarchive
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_text_oarchive<Archive>::newtoken()
+basic_text_oarchive<Archive, HelperSupport>::newtoken()
 {
     switch(delimiter){
     default:
@@ -47,9 +47,9 @@
     }
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_text_oarchive<Archive>::init(){
+basic_text_oarchive<Archive, HelperSupport>::init(){
     // write signature in an archive version independent manner
     const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
     * this->This() << file_signature;

Modified: branches/serialization_helper_support/boost/archive/impl/basic_xml_iarchive.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/basic_xml_iarchive.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/basic_xml_iarchive.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -23,9 +23,9 @@
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // implementation of xml_text_archive
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_iarchive<Archive>::load_start(const char *name){
+basic_xml_iarchive<Archive, HelperSupport>::load_start(const char *name){
     // if there's no name
     if(NULL == name)
         return;
@@ -40,9 +40,9 @@
     return;
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_iarchive<Archive>::load_end(const char *name){
+basic_xml_iarchive<Archive, HelperSupport>::load_end(const char *name){
     // if there's no name
     if(NULL == name)
         return;
@@ -73,39 +73,39 @@
     }
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_iarchive<Archive>::load_override(object_id_type & t, int){
+basic_xml_iarchive<Archive, HelperSupport>::load_override(object_id_type & t, int){
     t = this->This()->gimpl->rv.object_id;
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_iarchive<Archive>::load_override(version_type & t, int){
+basic_xml_iarchive<Archive, HelperSupport>::load_override(version_type & t, int){
     t = this->This()->gimpl->rv.version;
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_iarchive<Archive>::load_override(class_id_type & t, int){
+basic_xml_iarchive<Archive, HelperSupport>::load_override(class_id_type & t, int){
     t = this->This()->gimpl->rv.class_id;
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_iarchive<Archive>::load_override(tracking_type & t, int){
+basic_xml_iarchive<Archive, HelperSupport>::load_override(tracking_type & t, int){
     t = this->This()->gimpl->rv.tracking_level;
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
-basic_xml_iarchive<Archive>::basic_xml_iarchive(unsigned int flags) :
- detail::common_iarchive<Archive>(flags),
+basic_xml_iarchive<Archive, HelperSupport>::basic_xml_iarchive(unsigned int flags) :
+ detail::common_iarchive<Archive, HelperSupport>(flags),
     depth(0)
 {}
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
-basic_xml_iarchive<Archive>::~basic_xml_iarchive(){}
+basic_xml_iarchive<Archive, HelperSupport>::~basic_xml_iarchive(){}
 
 } // namespace archive
 } // namespace boost

Modified: branches/serialization_helper_support/boost/archive/impl/basic_xml_oarchive.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/basic_xml_oarchive.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/basic_xml_oarchive.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -57,9 +57,9 @@
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // implemenations of functions common to both types of xml output
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::write_attribute(
+basic_xml_oarchive<Archive, HelperSupport>::write_attribute(
     const char *attribute_name,
     int t,
     const char *conjunction
@@ -71,9 +71,9 @@
     this->This()->put('"');
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::write_attribute(
+basic_xml_oarchive<Archive, HelperSupport>::write_attribute(
     const char *attribute_name,
     const char *key
 ){
@@ -84,17 +84,17 @@
     this->This()->put('"');
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::indent(){
+basic_xml_oarchive<Archive, HelperSupport>::indent(){
     int i;
     for(i = depth; i-- > 0;)
         this->This()->put('\t');
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_start(const char *name)
+basic_xml_oarchive<Archive, HelperSupport>::save_start(const char *name)
 {
     if(NULL == name)
         return;
@@ -114,9 +114,9 @@
     indent_next = false;
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_end(const char *name)
+basic_xml_oarchive<Archive, HelperSupport>::save_end(const char *name)
 {
     if(NULL == name)
         return;
@@ -138,90 +138,90 @@
         this->This()->put('\n');
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::end_preamble(){
+basic_xml_oarchive<Archive, HelperSupport>::end_preamble(){
     if(pending_preamble){
         this->This()->put('>');
         pending_preamble = false;
     }
 }
 #if 0
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(const object_id_type & t, int)
+basic_xml_oarchive<Archive, HelperSupport>::save_override(const object_id_type & t, int)
 {
     int i = t.t; // extra .t is for borland
     write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_");
 }
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(
+basic_xml_oarchive<Archive, HelperSupport>::save_override(
     const object_reference_type & t,
     int
 ){
     int i = t.t; // extra .t is for borland
     write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_");
 }
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
+basic_xml_oarchive<Archive, HelperSupport>::save_override(const version_type & t, int)
 {
     int i = t.t; // extra .t is for borland
     write_attribute(VBOOST_ARCHIVE_XML_ERSION(), i);
 }
 #endif
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(const object_id_type & t, int)
+basic_xml_oarchive<Archive, HelperSupport>::save_override(const object_id_type & t, int)
 {
     // borland doesn't do conversion of STRONG_TYPEDEFs very well
     const unsigned int i = t;
     write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_");
 }
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(
+basic_xml_oarchive<Archive, HelperSupport>::save_override(
     const object_reference_type & t,
     int
 ){
     const unsigned int i = t;
     write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_");
 }
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
+basic_xml_oarchive<Archive, HelperSupport>::save_override(const version_type & t, int)
 {
     const unsigned int i = t;
     write_attribute(BOOST_ARCHIVE_XML_VERSION(), i);
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(const class_id_type & t, int)
+basic_xml_oarchive<Archive, HelperSupport>::save_override(const class_id_type & t, int)
 {
     write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t);
 }
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(
+basic_xml_oarchive<Archive, HelperSupport>::save_override(
     const class_id_reference_type & t,
     int
 ){
     write_attribute(BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(), t);
 }
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(
+basic_xml_oarchive<Archive, HelperSupport>::save_override(
     const class_id_optional_type & t,
     int
 ){
     write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t);
 }
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(const class_name_type & t, int)
+basic_xml_oarchive<Archive, HelperSupport>::save_override(const class_name_type & t, int)
 {
     const char * key = t;
     if(NULL == key)
@@ -229,16 +229,16 @@
     write_attribute(BOOST_ARCHIVE_XML_CLASS_NAME(), key);
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::save_override(const tracking_type & t, int)
+basic_xml_oarchive<Archive, HelperSupport>::save_override(const tracking_type & t, int)
 {
     write_attribute(BOOST_ARCHIVE_XML_TRACKING(), t.t);
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
-basic_xml_oarchive<Archive>::init(){
+basic_xml_oarchive<Archive, HelperSupport>::init(){
     // xml header
     this->This()->put("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n");
     this->This()->put("<!DOCTYPE boost_serialization>\n");
@@ -249,19 +249,19 @@
     this->This()->put(">\n");
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
-basic_xml_oarchive<Archive>::basic_xml_oarchive(unsigned int flags) :
- detail::common_oarchive<Archive>(flags),
+basic_xml_oarchive<Archive, HelperSupport>::basic_xml_oarchive(unsigned int flags) :
+ detail::common_oarchive<Archive, HelperSupport>(flags),
     depth(0),
     indent_next(false),
     pending_preamble(false)
 {
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
-basic_xml_oarchive<Archive>::~basic_xml_oarchive(){
+basic_xml_oarchive<Archive, HelperSupport>::~basic_xml_oarchive(){
     if(0 == (this->get_flags() & no_header)){
         BOOST_TRY{
                 this->This()->put("</boost_serialization>\n");

Modified: branches/serialization_helper_support/boost/archive/impl/text_iarchive_impl.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/text_iarchive_impl.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/text_iarchive_impl.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -27,9 +27,9 @@
 namespace boost {
 namespace archive {
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_iarchive_impl<Archive>::load(char *s)
+text_iarchive_impl<Archive, HelperSupport>::load(char *s)
 {
     std::size_t size;
     * this->This() >> size;
@@ -40,9 +40,9 @@
     s[size] = '\0';
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_iarchive_impl<Archive>::load(std::string &s)
+text_iarchive_impl<Archive, HelperSupport>::load(std::string &s)
 {
     std::size_t size;
     * this->This() >> size;
@@ -59,9 +59,9 @@
 
 #ifndef BOOST_NO_CWCHAR
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_iarchive_impl<Archive>::load(wchar_t *ws)
+text_iarchive_impl<Archive, HelperSupport>::load(wchar_t *ws)
 {
     std::size_t size;
     * this->This() >> size;
@@ -73,9 +73,9 @@
 #endif // BOOST_NO_INTRINSIC_WCHAR_T
 
 #ifndef BOOST_NO_STD_WSTRING
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_iarchive_impl<Archive>::load(std::wstring &ws)
+text_iarchive_impl<Archive, HelperSupport>::load(std::wstring &ws)
 {
     std::size_t size;
     * this->This() >> size;
@@ -92,21 +92,21 @@
 #endif // BOOST_NO_STD_WSTRING
 #endif // BOOST_NO_CWCHAR
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_iarchive_impl<Archive>::load_override(class_name_type & t, int){
- basic_text_iarchive<Archive>::load_override(t, 0);
+text_iarchive_impl<Archive, HelperSupport>::load_override(class_name_type & t, int){
+ basic_text_iarchive<Archive, HelperSupport>::load_override(t, 0);
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_iarchive_impl<Archive>::init(){
- basic_text_iarchive<Archive>::init();
+text_iarchive_impl<Archive, HelperSupport>::init(){
+ basic_text_iarchive<Archive, HelperSupport>::init();
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
-text_iarchive_impl<Archive>::text_iarchive_impl(
+text_iarchive_impl<Archive, HelperSupport>::text_iarchive_impl(
     std::istream & is,
     unsigned int flags
 ) :
@@ -114,13 +114,13 @@
         is,
         0 != (flags & no_codecvt)
     ),
- basic_text_iarchive<Archive>(flags)
+ basic_text_iarchive<Archive, HelperSupport>(flags)
 {
     if(0 == (flags & no_header))
         #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
         this->init();
         #else
- this->basic_text_iarchive<Archive>::init();
+ this->basic_text_iarchive<Archive, HelperSupport>::init();
         #endif
 }
 

Modified: branches/serialization_helper_support/boost/archive/impl/text_oarchive_impl.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/text_oarchive_impl.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/text_oarchive_impl.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -37,9 +37,9 @@
 // implementation of basic_text_oprimitive overrides for the combination
 // of template parameters used to create a text_oprimitive
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_oarchive_impl<Archive>::save(const char * s)
+text_oarchive_impl<Archive, HelperSupport>::save(const char * s)
 {
     const std::size_t len = std::ostream::traits_type::length(s);
     *this->This() << len;
@@ -47,9 +47,9 @@
     os << s;
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_oarchive_impl<Archive>::save(const std::string &s)
+text_oarchive_impl<Archive, HelperSupport>::save(const std::string &s)
 {
     const std::size_t size = s.size();
     *this->This() << size;
@@ -59,9 +59,9 @@
 
 #ifndef BOOST_NO_CWCHAR
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_oarchive_impl<Archive>::save(const wchar_t * ws)
+text_oarchive_impl<Archive, HelperSupport>::save(const wchar_t * ws)
 {
     const std::size_t l = std::wcslen(ws);
     * this->This() << l;
@@ -71,9 +71,9 @@
 #endif
 
 #ifndef BOOST_NO_STD_WSTRING
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_oarchive_impl<Archive>::save(const std::wstring &ws)
+text_oarchive_impl<Archive, HelperSupport>::save(const std::wstring &ws)
 {
     const std::size_t l = ws.size();
     * this->This() << l;
@@ -83,9 +83,9 @@
 #endif
 #endif // BOOST_NO_CWCHAR
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
-text_oarchive_impl<Archive>::text_oarchive_impl(
+text_oarchive_impl<Archive, HelperSupport>::text_oarchive_impl(
     std::ostream & os,
     unsigned int flags
 ) :
@@ -93,19 +93,19 @@
         os,
         0 != (flags & no_codecvt)
     ),
- basic_text_oarchive<Archive>(flags)
+ basic_text_oarchive<Archive, HelperSupport>(flags)
 {
     if(0 == (flags & no_header))
         #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
         this->init();
         #else
- this->basic_text_oarchive<Archive>::init();
+ this->basic_text_oarchive<Archive, HelperSupport>::init();
         #endif
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-text_oarchive_impl<Archive>::save_binary(const void *address, std::size_t count){
+text_oarchive_impl<Archive, HelperSupport>::save_binary(const void *address, std::size_t count){
     put('\n');
     this->end_preamble();
     #if ! defined(__MWERKS__)

Modified: branches/serialization_helper_support/boost/archive/impl/text_wiarchive_impl.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/text_wiarchive_impl.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/text_wiarchive_impl.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -28,9 +28,9 @@
 //////////////////////////////////////////////////////////////////////
 // implementation of wiprimtives functions
 //
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-text_wiarchive_impl<Archive>::load(char *s)
+text_wiarchive_impl<Archive, HelperSupport>::load(char *s)
 {
     std::size_t size;
     * this->This() >> size;
@@ -42,9 +42,9 @@
     *s = '\0';
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-text_wiarchive_impl<Archive>::load(std::string &s)
+text_wiarchive_impl<Archive, HelperSupport>::load(std::string &s)
 {
     std::size_t size;
     * this->This() >> size;
@@ -62,9 +62,9 @@
 }
 
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-text_wiarchive_impl<Archive>::load(wchar_t *s)
+text_wiarchive_impl<Archive, HelperSupport>::load(wchar_t *s)
 {
     std::size_t size;
     * this->This() >> size;
@@ -77,9 +77,9 @@
 #endif
 
 #ifndef BOOST_NO_STD_WSTRING
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-text_wiarchive_impl<Archive>::load(std::wstring &ws)
+text_wiarchive_impl<Archive, HelperSupport>::load(std::wstring &ws)
 {
     std::size_t size;
     * this->This() >> size;
@@ -96,9 +96,9 @@
 }
 #endif
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
-text_wiarchive_impl<Archive>::text_wiarchive_impl(
+text_wiarchive_impl<Archive, HelperSupport>::text_wiarchive_impl(
     std::wistream & is,
     unsigned int flags
 ) :
@@ -106,10 +106,10 @@
         is,
         0 != (flags & no_codecvt)
     ),
- basic_text_iarchive<Archive>(flags)
+ basic_text_iarchive<Archive, HelperSupport>(flags)
 {
     if(0 == (flags & no_header))
- basic_text_iarchive<Archive>::init();
+ basic_text_iarchive<Archive, HelperSupport>::init();
 }
 
 } // archive

Modified: branches/serialization_helper_support/boost/archive/impl/text_woarchive_impl.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/text_woarchive_impl.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/text_woarchive_impl.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -30,9 +30,9 @@
 //////////////////////////////////////////////////////////////////////
 // implementation of woarchive functions
 //
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-text_woarchive_impl<Archive>::save(const char *s)
+text_woarchive_impl<Archive, HelperSupport>::save(const char *s)
 {
     // note: superfluous local variable fixes borland warning
     const std::size_t size = std::strlen(s);
@@ -42,9 +42,9 @@
         os.put(os.widen(*s++));
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-text_woarchive_impl<Archive>::save(const std::string &s)
+text_woarchive_impl<Archive, HelperSupport>::save(const std::string &s)
 {
     const std::size_t size = s.size();
     * this->This() << size;
@@ -55,9 +55,9 @@
 }
 
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-text_woarchive_impl<Archive>::save(const wchar_t *ws)
+text_woarchive_impl<Archive, HelperSupport>::save(const wchar_t *ws)
 {
     const std::size_t size = std::wostream::traits_type::length(ws);
     * this->This() << size;
@@ -67,9 +67,9 @@
 #endif
 
 #ifndef BOOST_NO_STD_WSTRING
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-text_woarchive_impl<Archive>::save(const std::wstring &ws)
+text_woarchive_impl<Archive, HelperSupport>::save(const std::wstring &ws)
 {
     const std::size_t size = ws.length();
     * this->This() << size;

Modified: branches/serialization_helper_support/boost/archive/impl/xml_iarchive_impl.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/xml_iarchive_impl.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/xml_iarchive_impl.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -50,9 +50,9 @@
 
 #ifndef BOOST_NO_CWCHAR
 #ifndef BOOST_NO_STD_WSTRING
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_iarchive_impl<Archive>::load(std::wstring &ws){
+xml_iarchive_impl<Archive, HelperSupport>::load(std::wstring &ws){
     std::string s;
     bool result = gimpl->parse_string(is, s);
     if(! result)
@@ -84,9 +84,9 @@
 #endif // BOOST_NO_STD_WSTRING
 
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_iarchive_impl<Archive>::load(wchar_t * ws){
+xml_iarchive_impl<Archive, HelperSupport>::load(wchar_t * ws){
     std::string s;
     bool result = gimpl->parse_string(is, s);
     if(! result)
@@ -116,9 +116,9 @@
 
 #endif // BOOST_NO_CWCHAR
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_iarchive_impl<Archive>::load(std::string &s){
+xml_iarchive_impl<Archive, HelperSupport>::load(std::string &s){
     bool result = gimpl->parse_string(is, s);
     if(! result)
         boost::serialization::throw_exception(
@@ -126,9 +126,9 @@
         );
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_iarchive_impl<Archive>::load(char * s){
+xml_iarchive_impl<Archive, HelperSupport>::load(char * s){
     std::string tstring;
     bool result = gimpl->parse_string(is, tstring);
     if(! result)
@@ -139,9 +139,9 @@
     s[tstring.size()] = 0;
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_iarchive_impl<Archive>::load_override(class_name_type & t, int){
+xml_iarchive_impl<Archive, HelperSupport>::load_override(class_name_type & t, int){
     const std::string & s = gimpl->rv.class_name;
     if(s.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
         boost::serialization::throw_exception(
@@ -152,16 +152,16 @@
     tptr[s.size()] = '\0';
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_iarchive_impl<Archive>::init(){
+xml_iarchive_impl<Archive, HelperSupport>::init(){
     gimpl->init(is);
     this->set_library_version(gimpl->rv.version);
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
-xml_iarchive_impl<Archive>::xml_iarchive_impl(
+xml_iarchive_impl<Archive, HelperSupport>::xml_iarchive_impl(
     std::istream &is_,
     unsigned int flags
 ) :
@@ -169,7 +169,7 @@
         is_,
         0 != (flags & no_codecvt)
     ),
- basic_xml_iarchive<Archive>(flags),
+ basic_xml_iarchive<Archive, HelperSupport>(flags),
     gimpl(new xml_grammar())
 {
     if(0 == (flags & no_header)){
@@ -186,9 +186,9 @@
     }
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
-xml_iarchive_impl<Archive>::~xml_iarchive_impl(){
+xml_iarchive_impl<Archive, HelperSupport>::~xml_iarchive_impl(){
     if(0 == (this->get_flags() & no_header)){
         BOOST_TRY{
             gimpl->windup(is);

Modified: branches/serialization_helper_support/boost/archive/impl/xml_oarchive_impl.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/xml_oarchive_impl.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/xml_oarchive_impl.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -49,9 +49,9 @@
 }
 
 #ifndef BOOST_NO_STD_WSTRING
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_oarchive_impl<Archive>::save(const std::wstring & ws){
+xml_oarchive_impl<Archive, HelperSupport>::save(const std::wstring & ws){
 // at least one library doesn't typedef value_type for strings
 // so rather than using string directly make a pointer iterator out of it
 // save_iterator(os, ws.data(), ws.data() + std::wcslen(ws.data()));
@@ -60,18 +60,18 @@
 #endif
 
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_oarchive_impl<Archive>::save(const wchar_t * ws){
+xml_oarchive_impl<Archive, HelperSupport>::save(const wchar_t * ws){
     save_iterator(os, ws, ws + std::wcslen(ws));
 }
 #endif
 
 #endif // BOOST_NO_CWCHAR
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_oarchive_impl<Archive>::save(const std::string & s){
+xml_oarchive_impl<Archive, HelperSupport>::save(const std::string & s){
 // at least one library doesn't typedef value_type for strings
 // so rather than using string directly make a pointer iterator out of it
     typedef boost::archive::iterators::xml_escape<
@@ -84,9 +84,9 @@
     );
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(void)
-xml_oarchive_impl<Archive>::save(const char * s){
+xml_oarchive_impl<Archive, HelperSupport>::save(const char * s){
     typedef boost::archive::iterators::xml_escape<
         const char *
> xml_escape_translator;
@@ -97,9 +97,9 @@
     );
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
-xml_oarchive_impl<Archive>::xml_oarchive_impl(
+xml_oarchive_impl<Archive, HelperSupport>::xml_oarchive_impl(
     std::ostream & os_,
     unsigned int flags
 ) :
@@ -107,7 +107,7 @@
         os_,
         0 != (flags & no_codecvt)
     ),
- basic_xml_oarchive<Archive>(flags)
+ basic_xml_oarchive<Archive, HelperSupport>(flags)
 {
     if(0 == (flags & no_header))
         this->init();

Modified: branches/serialization_helper_support/boost/archive/impl/xml_wiarchive_impl.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/xml_wiarchive_impl.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/xml_wiarchive_impl.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -67,9 +67,9 @@
 
 } // anonymous
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_wiarchive_impl<Archive>::load(std::string & s){
+xml_wiarchive_impl<Archive, HelperSupport>::load(std::string & s){
     std::wstring ws;
     bool result = gimpl->parse_string(is, ws);
     if(! result)
@@ -93,9 +93,9 @@
 }
 
 #ifndef BOOST_NO_STD_WSTRING
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_wiarchive_impl<Archive>::load(std::wstring & ws){
+xml_wiarchive_impl<Archive, HelperSupport>::load(std::wstring & ws){
     bool result = gimpl->parse_string(is, ws);
     if(! result)
         boost::serialization::throw_exception(
@@ -104,9 +104,9 @@
 }
 #endif
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_wiarchive_impl<Archive>::load(char * s){
+xml_wiarchive_impl<Archive, HelperSupport>::load(char * s){
     std::wstring ws;
     bool result = gimpl->parse_string(is, ws);
     if(! result)
@@ -117,9 +117,9 @@
 }
 
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_wiarchive_impl<Archive>::load(wchar_t * ws){
+xml_wiarchive_impl<Archive, HelperSupport>::load(wchar_t * ws){
     std::wstring twstring;
     bool result = gimpl->parse_string(is, twstring);
     if(! result)
@@ -131,9 +131,9 @@
 }
 #endif
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_wiarchive_impl<Archive>::load_override(class_name_type & t, int){
+xml_wiarchive_impl<Archive, HelperSupport>::load_override(class_name_type & t, int){
     const std::wstring & ws = gimpl->rv.class_name;
     if(ws.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
         boost::serialization::throw_exception(
@@ -142,16 +142,16 @@
     copy_to_ptr(t, ws);
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_wiarchive_impl<Archive>::init(){
+xml_wiarchive_impl<Archive, HelperSupport>::init(){
     gimpl->init(is);
     this->set_library_version(gimpl->rv.version);
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
-xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
+xml_wiarchive_impl<Archive, HelperSupport>::xml_wiarchive_impl(
     std::wistream &is_,
     unsigned int flags
 ) :
@@ -159,7 +159,7 @@
         is_,
         true // don't change the codecvt - use the one below
     ),
- basic_xml_iarchive<Archive>(flags),
+ basic_xml_iarchive<Archive, HelperSupport>(flags),
     gimpl(new xml_wgrammar())
 {
     if(0 == (flags & no_codecvt)){
@@ -185,9 +185,9 @@
     }
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
-xml_wiarchive_impl<Archive>::~xml_wiarchive_impl(){
+xml_wiarchive_impl<Archive, HelperSupport>::~xml_wiarchive_impl(){
     if(0 == (this->get_flags() & no_header)){
         BOOST_TRY{
             gimpl->windup(is);

Modified: branches/serialization_helper_support/boost/archive/impl/xml_woarchive_impl.ipp
==============================================================================
--- branches/serialization_helper_support/boost/archive/impl/xml_woarchive_impl.ipp (original)
+++ branches/serialization_helper_support/boost/archive/impl/xml_woarchive_impl.ipp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -60,9 +60,9 @@
     );
 }
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_woarchive_impl<Archive>::save(const std::string & s){
+xml_woarchive_impl<Archive, HelperSupport>::save(const std::string & s){
     // note: we don't use s.begin() and s.end() because dinkumware
     // doesn't have string::value_type defined. So use a wrapper
     // around these values to implement the definitions.
@@ -72,9 +72,9 @@
 }
 
 #ifndef BOOST_NO_STD_WSTRING
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_woarchive_impl<Archive>::save(const std::wstring & ws){
+xml_woarchive_impl<Archive, HelperSupport>::save(const std::wstring & ws){
 #if 0
     typedef iterators::xml_escape<std::wstring::const_iterator> xmbtows;
     std::copy(
@@ -92,16 +92,16 @@
 }
 #endif //BOOST_NO_STD_WSTRING
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_woarchive_impl<Archive>::save(const char * s){
+xml_woarchive_impl<Archive, HelperSupport>::save(const char * s){
    save_iterator(os, s, s + std::strlen(s));
 }
 
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(void)
-xml_woarchive_impl<Archive>::save(const wchar_t * ws){
+xml_woarchive_impl<Archive, HelperSupport>::save(const wchar_t * ws){
     os << ws;
     typedef iterators::xml_escape<const wchar_t *> xmbtows;
     std::copy(
@@ -112,9 +112,9 @@
 }
 #endif
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
-xml_woarchive_impl<Archive>::xml_woarchive_impl(
+xml_woarchive_impl<Archive, HelperSupport>::xml_woarchive_impl(
     std::wostream & os_,
     unsigned int flags
 ) :
@@ -122,7 +122,7 @@
         os_,
         true // don't change the codecvt - use the one below
     ),
- basic_xml_oarchive<Archive>(flags)
+ basic_xml_oarchive<Archive, HelperSupport>(flags)
 {
     // Standard behavior is that imbue can be called
     // a) before output is invoked or

Modified: branches/serialization_helper_support/boost/archive/polymorphic_binary_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/polymorphic_binary_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/polymorphic_binary_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -27,7 +27,8 @@
     binary_oarchive_impl<
         naked_binary_oarchive,
         std::ostream::char_type,
- std::ostream::traits_type
+ std::ostream::traits_type,
+ false // no helper support
>
> polymorphic_binary_oarchive;
 

Modified: branches/serialization_helper_support/boost/archive/polymorphic_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/polymorphic_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/polymorphic_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -66,12 +66,12 @@
 class polymorphic_iarchive;
 
 class polymorphic_iarchive_impl :
- public detail::interface_iarchive<polymorphic_iarchive>
+ public detail::interface_iarchive<polymorphic_iarchive, true /* helper support */>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_iarchive<polymorphic_iarchive>;
+ friend class detail::interface_iarchive<polymorphic_iarchive, true>;
     friend class load_access;
 #endif
     // primitive types the only ones permitted by polymorphic archives
@@ -162,18 +162,11 @@
 } // namespace archive
 } // namespace boost
 
-// note special treatment of shared_ptr. This type needs a special
-// structure associated with every archive. We created a "mix-in"
-// class to provide this functionality. Since shared_ptr holds a
-// special esteem in the boost library - we included it here by default.
-#include <boost/archive/shared_ptr_helper.hpp>
-
 namespace boost {
 namespace archive {
 
 class polymorphic_iarchive :
- public polymorphic_iarchive_impl,
- public detail::shared_ptr_helper
+ public polymorphic_iarchive_impl
 {
 public:
     virtual ~polymorphic_iarchive(){};

Modified: branches/serialization_helper_support/boost/archive/polymorphic_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/polymorphic_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/polymorphic_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -65,12 +65,12 @@
 class polymorphic_oarchive;
 
 class polymorphic_oarchive_impl :
- public detail::interface_oarchive<polymorphic_oarchive>
+ public detail::interface_oarchive<polymorphic_oarchive, true /* helper support */>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_oarchive<polymorphic_oarchive>;
+ friend class detail::interface_oarchive<polymorphic_oarchive, true>;
     friend class save_access;
 #endif
     // primitive types the only ones permitted by polymorphic archives

Modified: branches/serialization_helper_support/boost/archive/polymorphic_text_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/polymorphic_text_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/polymorphic_text_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -24,7 +24,7 @@
 namespace archive {
 
 typedef detail::polymorphic_oarchive_route<
- text_oarchive_impl<naked_text_oarchive>
+ text_oarchive_impl<naked_text_oarchive, false /* no helper support */>
> polymorphic_text_oarchive;
 
 } // namespace archive

Modified: branches/serialization_helper_support/boost/archive/text_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/text_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/text_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -28,16 +28,16 @@
 namespace boost {
 namespace archive {
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class text_iarchive_impl :
     public basic_text_iprimitive<std::istream>,
- public basic_text_iarchive<Archive>
+ public basic_text_iarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_iarchive<Archive>;
- friend class basic_text_iarchive<Archive>;
+ friend class detail::interface_iarchive<Archive, HelperSupport>;
+ friend class basic_text_iarchive<Archive, HelperSupport>;
     friend class load_access;
 protected:
 #endif
@@ -62,7 +62,7 @@
     // make this protected so it can be called from a derived archive
     template<class T>
     void load_override(T & t, BOOST_PFTO int){
- basic_text_iarchive<Archive>::load_override(t, 0);
+ basic_text_iarchive<Archive, HelperSupport>::load_override(t, 0);
     }
     BOOST_ARCHIVE_DECL(void)
     load_override(class_name_type & t, int);
@@ -78,36 +78,23 @@
 // via inhertance, derived from text_iarchive_impl instead. This will
 // preserve correct static polymorphism.
 
-// same as text_iarchive below - without the shared_ptr_helper
+// same as text_iarchive below - without helper support
 class naked_text_iarchive :
- public text_iarchive_impl<naked_text_iarchive>
+ public text_iarchive_impl<naked_text_iarchive, false /* no helper support*/>
 {
 public:
     naked_text_iarchive(std::istream & is, unsigned int flags = 0) :
- text_iarchive_impl<naked_text_iarchive>(is, flags)
+ text_iarchive_impl<naked_text_iarchive, false>(is, flags)
     {}
     ~naked_text_iarchive(){}
 };
 
-} // namespace archive
-} // namespace boost
-
-// note special treatment of shared_ptr. This type needs a special
-// structure associated with every archive. We created a "mix-in"
-// class to provide this functionality. Since shared_ptr holds a
-// special esteem in the boost library - we included it here by default.
-#include <boost/archive/shared_ptr_helper.hpp>
-
-namespace boost {
-namespace archive {
-
 class text_iarchive :
- public text_iarchive_impl<text_iarchive>,
- public detail::shared_ptr_helper
+ public text_iarchive_impl<text_iarchive, true /* helper support */>
 {
 public:
     text_iarchive(std::istream & is, unsigned int flags = 0) :
- text_iarchive_impl<text_iarchive>(is, flags)
+ text_iarchive_impl<text_iarchive,true>(is, flags)
     {}
     ~text_iarchive(){}
 };

Modified: branches/serialization_helper_support/boost/archive/text_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/text_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/text_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -35,16 +35,16 @@
 namespace boost {
 namespace archive {
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class text_oarchive_impl :
      /* protected ? */ public basic_text_oprimitive<std::ostream>,
- public basic_text_oarchive<Archive>
+ public basic_text_oarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_oarchive<Archive>;
- friend class basic_text_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
+ friend class basic_text_oarchive<Archive, HelperSupport>;
     friend class save_access;
 protected:
 #endif
@@ -77,19 +77,30 @@
 // do not derive from this class. If you want to extend this functionality
 // via inhertance, derived from text_oarchive_impl instead. This will
 // preserve correct static polymorphism.
+
+// same as text_oarchive below - without helper support
+class naked_text_oarchive :
+ public text_oarchive_impl<naked_text_oarchive, false /* no helper support*/>
+{
+public:
+
+ naked_text_oarchive(std::ostream & os, unsigned int flags = 0) :
+ text_oarchive_impl<naked_text_oarchive, false>(os, flags)
+ {}
+ ~naked_text_oarchive(){}
+};
+
 class text_oarchive :
- public text_oarchive_impl<text_oarchive>
+ public text_oarchive_impl<text_oarchive, true /* helper support */>
 {
 public:
      
     text_oarchive(std::ostream & os, unsigned int flags = 0) :
- text_oarchive_impl<text_oarchive>(os, flags)
+ text_oarchive_impl<text_oarchive, true>(os, flags)
     {}
     ~text_oarchive(){}
 };
 
-typedef text_oarchive naked_text_oarchive;
-
 } // namespace archive
 } // namespace boost
 

Modified: branches/serialization_helper_support/boost/archive/text_wiarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/text_wiarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/text_wiarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -32,16 +32,16 @@
 namespace boost {
 namespace archive {
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class text_wiarchive_impl :
     public basic_text_iprimitive<std::wistream>,
- public basic_text_iarchive<Archive>
+ public basic_text_iarchive<Archive,HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_iarchive<Archive>;
- friend class basic_text_iarchive<Archive>;
+ friend class detail::interface_iarchive<Archive, HelperSupport>;
+ friend class basic_text_iarchive<Archive, HelperSupport>;
     friend class load_access;
 protected:
 #endif
@@ -65,7 +65,7 @@
     // fails to compile one test (test_shared_ptr) without it !!!
     template<class T>
     void load_override(T & t, BOOST_PFTO int){
- basic_text_iarchive<Archive>::load_override(t, 0);
+ basic_text_iarchive<Archive, HelperSupport>::load_override(t, 0);
     }
     BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
     text_wiarchive_impl(std::wistream & is, unsigned int flags);
@@ -76,36 +76,23 @@
 // via inhertance, derived from text_iarchive_impl instead. This will
 // preserve correct static polymorphism.
 
-// same as text_wiarchive below - without the shared_ptr_helper
+// same as text_wiarchive below - without helper support
 class naked_text_wiarchive :
- public text_wiarchive_impl<naked_text_wiarchive>
+ public text_wiarchive_impl<naked_text_wiarchive, false /* no helper support */>
 {
 public:
     naked_text_wiarchive(std::wistream & is, unsigned int flags = 0) :
- text_wiarchive_impl<naked_text_wiarchive>(is, flags)
+ text_wiarchive_impl<naked_text_wiarchive, false>(is, flags)
     {}
     ~naked_text_wiarchive(){}
 };
 
-} // namespace archive
-} // namespace boost
-
-// note special treatment of shared_ptr. This type needs a special
-// structure associated with every archive. We created a "mix-in"
-// class to provide this functionality. Since shared_ptr holds a
-// special esteem in the boost library - we included it here by default.
-#include <boost/archive/shared_ptr_helper.hpp>
-
-namespace boost {
-namespace archive {
-
 class text_wiarchive :
- public text_wiarchive_impl<text_wiarchive>,
- public detail::shared_ptr_helper
+ public text_wiarchive_impl<text_wiarchive, true /* helper support */>
 {
 public:
     text_wiarchive(std::wistream & is, unsigned int flags = 0) :
- text_wiarchive_impl<text_wiarchive>(is, flags)
+ text_wiarchive_impl<text_wiarchive,true >(is, flags)
     {}
     ~text_wiarchive(){}
 };

Modified: branches/serialization_helper_support/boost/archive/text_woarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/text_woarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/text_woarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -40,16 +40,16 @@
 namespace boost {
 namespace archive {
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class text_woarchive_impl :
     public basic_text_oprimitive<std::wostream>,
- public basic_text_oarchive<Archive>
+ public basic_text_oarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_oarchive<Archive>;
- friend class basic_text_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
+ friend class basic_text_oarchive<Archive, HelperSupport>;
     friend class save_access;
 protected:
 #endif
@@ -75,10 +75,10 @@
             os,
             0 != (flags & no_codecvt)
         ),
- basic_text_oarchive<Archive>(flags)
+ basic_text_oarchive<Archive, HelperSupport>(flags)
     {
         if(0 == (flags & no_header))
- basic_text_oarchive<Archive>::init();
+ basic_text_oarchive<Archive, HelperSupport>::init();
     }
 public:
     void save_binary(const void *address, std::size_t count){
@@ -104,18 +104,28 @@
 // do not derive from this class. If you want to extend this functionality
 // via inhertance, derived from text_oarchive_impl instead. This will
 // preserve correct static polymorphism.
+
+// same as text_woarchive below - without helper support
+class naked_text_woarchive :
+ public text_woarchive_impl<naked_text_woarchive, false /* no helper support*/>
+{
+public:
+ naked_text_woarchive(std::wostream & os, unsigned int flags = 0) :
+ text_woarchive_impl<naked_text_woarchive, false>(os, flags)
+ {}
+ ~naked_text_woarchive(){}
+};
+
 class text_woarchive :
- public text_woarchive_impl<text_woarchive>
+ public text_woarchive_impl<text_woarchive, true /* helper support */>
 {
 public:
     text_woarchive(std::wostream & os, unsigned int flags = 0) :
- text_woarchive_impl<text_woarchive>(os, flags)
+ text_woarchive_impl<text_woarchive, true>(os, flags)
     {}
     ~text_woarchive(){}
 };
 
-typedef text_woarchive naked_text_woarchive;
-
 } // namespace archive
 } // namespace boost
 

Modified: branches/serialization_helper_support/boost/archive/xml_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/xml_iarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/xml_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -32,16 +32,16 @@
 class basic_xml_grammar;
 typedef basic_xml_grammar<char> xml_grammar;
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class xml_iarchive_impl :
     public basic_text_iprimitive<std::istream>,
- public basic_xml_iarchive<Archive>
+ public basic_xml_iarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_iarchive<Archive>;
- friend class basic_xml_iarchive<Archive>;
+ friend class detail::interface_iarchive<Archive, HelperSupport>;
+ friend class basic_xml_iarchive<Archive, HelperSupport>;
     friend class load_access;
 protected:
 #endif
@@ -71,7 +71,7 @@
     #endif
     template<class T>
     void load_override(T & t, BOOST_PFTO int){
- basic_xml_iarchive<Archive>::load_override(t, 0);
+ basic_xml_iarchive<Archive, HelperSupport>::load_override(t, 0);
     }
     BOOST_ARCHIVE_DECL(void)
     load_override(class_name_type & t, int);
@@ -87,36 +87,23 @@
 // via inhertance, derived from text_iarchive_impl instead. This will
 // preserve correct static polymorphism.
 
-// same as xml_iarchive below - without the shared_ptr_helper
+// same as xml_iarchive below - without helper support
 class naked_xml_iarchive :
- public xml_iarchive_impl<naked_xml_iarchive>
+ public xml_iarchive_impl<naked_xml_iarchive, false /* no helper support */>
 {
 public:
     naked_xml_iarchive(std::istream & is, unsigned int flags = 0) :
- xml_iarchive_impl<naked_xml_iarchive>(is, flags)
+ xml_iarchive_impl<naked_xml_iarchive, false>(is, flags)
     {}
     ~naked_xml_iarchive(){}
 };
 
-} // namespace archive
-} // namespace boost
-
-// note special treatment of shared_ptr. This type needs a special
-// structure associated with every archive. We created a "mix-in"
-// class to provide this functionality. Since shared_ptr holds a
-// special esteem in the boost library - we included it here by default.
-#include <boost/archive/shared_ptr_helper.hpp>
-
-namespace boost {
-namespace archive {
-
 class xml_iarchive :
- public xml_iarchive_impl<xml_iarchive>,
- public detail::shared_ptr_helper
+ public xml_iarchive_impl<xml_iarchive, true /* helper support */>
 {
 public:
     xml_iarchive(std::istream & is, unsigned int flags = 0) :
- xml_iarchive_impl<xml_iarchive>(is, flags)
+ xml_iarchive_impl<xml_iarchive, true>(is, flags)
     {}
     ~xml_iarchive(){};
 };

Modified: branches/serialization_helper_support/boost/archive/xml_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/xml_oarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/xml_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -35,16 +35,16 @@
 namespace boost {
 namespace archive {
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class xml_oarchive_impl :
     public basic_text_oprimitive<std::ostream>,
- public basic_xml_oarchive<Archive>
+ public basic_xml_oarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_oarchive<Archive>;
- friend class basic_xml_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
+ friend class basic_xml_oarchive<Archive, HelperSupport>;
     friend class save_access;
 protected:
 #endif
@@ -91,18 +91,28 @@
 // do not derive from this class. If you want to extend this functionality
 // via inhertance, derived from xml_oarchive_impl instead. This will
 // preserve correct static polymorphism.
+
+// same as xml_oarchive below - without helper support
+class naked_xml_oarchive :
+ public xml_oarchive_impl<naked_xml_oarchive, false /* helper support */>
+{
+public:
+ naked_xml_oarchive(std::ostream & os, unsigned int flags = 0) :
+ xml_oarchive_impl<naked_xml_oarchive, false>(os, flags)
+ {}
+ ~naked_xml_oarchive(){}
+};
+
 class xml_oarchive :
- public xml_oarchive_impl<xml_oarchive>
+ public xml_oarchive_impl<xml_oarchive, true /* helper support*/>
 {
 public:
     xml_oarchive(std::ostream & os, unsigned int flags = 0) :
- xml_oarchive_impl<xml_oarchive>(os, flags)
+ xml_oarchive_impl<xml_oarchive, true>(os, flags)
     {}
     ~xml_oarchive(){}
 };
 
-typedef xml_oarchive naked_xml_oarchive;
-
 } // namespace archive
 } // namespace boost
 

Modified: branches/serialization_helper_support/boost/archive/xml_wiarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/xml_wiarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/xml_wiarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -37,16 +37,16 @@
 class basic_xml_grammar;
 typedef basic_xml_grammar<wchar_t> xml_wgrammar;
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class xml_wiarchive_impl :
     public basic_text_iprimitive<std::wistream>,
- public basic_xml_iarchive<Archive>
+ public basic_xml_iarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_iarchive<Archive>;
- friend class basic_xml_iarchive<Archive>;
+ friend class detail::interface_iarchive<Archive, HelperSupport>;
+ friend class basic_xml_iarchive<Archive, HelperSupport>;
     friend class load_access;
 protected:
 #endif
@@ -75,7 +75,7 @@
     #endif
     template<class T>
     void load_override(T & t, BOOST_PFTO int){
- basic_xml_iarchive<Archive>::load_override(t, 0);
+ basic_xml_iarchive<Archive, HelperSupport>::load_override(t, 0);
     }
     BOOST_WARCHIVE_DECL(void)
     load_override(class_name_type & t, int);
@@ -91,36 +91,23 @@
 // via inhertance, derived from xml_wiarchive_impl instead. This will
 // preserve correct static polymorphism.
 
-// same as xml_wiarchive below - without the shared_ptr_helper
+// same as xml_wiarchive below - without helper support
 class naked_xml_wiarchive :
- public xml_wiarchive_impl<naked_xml_wiarchive>
+ public xml_wiarchive_impl<naked_xml_wiarchive, false /* helper support */>
 {
 public:
     naked_xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
- xml_wiarchive_impl<naked_xml_wiarchive>(is, flags)
+ xml_wiarchive_impl<naked_xml_wiarchive, false>(is, flags)
     {}
     ~naked_xml_wiarchive(){}
 };
 
-} // namespace archive
-} // namespace boost
-
-// note special treatment of shared_ptr. This type needs a special
-// structure associated with every archive. We created a "mix-in"
-// class to provide this functionality. Since shared_ptr holds a
-// special esteem in the boost library - we included it here by default.
-#include <boost/archive/shared_ptr_helper.hpp>
-
-namespace boost {
-namespace archive {
-
 class xml_wiarchive :
- public xml_wiarchive_impl<xml_wiarchive>,
- public detail::shared_ptr_helper
+ public xml_wiarchive_impl<xml_wiarchive, true /* helper support*/>
 {
 public:
     xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
- xml_wiarchive_impl<xml_wiarchive>(is, flags)
+ xml_wiarchive_impl<xml_wiarchive, true>(is, flags)
     {}
     ~xml_wiarchive(){}
 };

Modified: branches/serialization_helper_support/boost/archive/xml_woarchive.hpp
==============================================================================
--- branches/serialization_helper_support/boost/archive/xml_woarchive.hpp (original)
+++ branches/serialization_helper_support/boost/archive/xml_woarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -47,16 +47,16 @@
 operator<<(std::wostream &os, const char t);
 #endif
 
-template<class Archive>
+template<class Archive, bool HelperSupport>
 class xml_woarchive_impl :
     public basic_text_oprimitive<std::wostream>,
- public basic_xml_oarchive<Archive>
+ public basic_xml_oarchive<Archive, HelperSupport>
 {
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class detail::interface_oarchive<Archive>;
- friend class basic_xml_oarchive<Archive>;
+ friend class detail::interface_oarchive<Archive, HelperSupport>;
+ friend class basic_xml_oarchive<Archive, HelperSupport>;
     friend class save_access;
 protected:
 #endif
@@ -105,18 +105,28 @@
 // do not derive from this class. If you want to extend this functionality
 // via inhertance, derived from xml_woarchive_impl instead. This will
 // preserve correct static polymorphism.
+
+// same as xml_woarchive below - without helper support
+class naked_xml_woarchive :
+ public xml_woarchive_impl<naked_xml_woarchive, false /* helper support */>
+{
+public:
+ naked_xml_woarchive(std::wostream & os, unsigned int flags = 0) :
+ xml_woarchive_impl<naked_xml_woarchive, false>(os, flags)
+ {}
+ ~naked_xml_woarchive(){}
+};
+
 class xml_woarchive :
- public xml_woarchive_impl<xml_woarchive>
+ public xml_woarchive_impl<xml_woarchive, true /* helper support*/>
 {
 public:
     xml_woarchive(std::wostream & os, unsigned int flags = 0) :
- xml_woarchive_impl<xml_woarchive>(os, flags)
+ xml_woarchive_impl<xml_woarchive, true>(os, flags)
     {}
     ~xml_woarchive(){}
 };
 
-typedef xml_woarchive naked_xml_woarchive;
-
 } // namespace archive
 } // namespace boost
 

Modified: branches/serialization_helper_support/boost/serialization/shared_ptr.hpp
==============================================================================
--- branches/serialization_helper_support/boost/serialization/shared_ptr.hpp (original)
+++ branches/serialization_helper_support/boost/serialization/shared_ptr.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -26,6 +26,7 @@
 #include <boost/detail/workaround.hpp>
 #include <boost/shared_ptr.hpp>
 
+#include <boost/serialization/shared_ptr_helper.hpp>
 #include <boost/serialization/split_free.hpp>
 #include <boost/serialization/nvp.hpp>
 #include <boost/serialization/version.hpp>
@@ -121,13 +122,13 @@
         // boost_132::detail::sp_counted_base_impl<T *, boost::checked_deleter<T> > *
         //>(NULL));
         ar.register_type(static_cast<
- boost_132::detail::sp_counted_base_impl<T *, boost::archive::detail::null_deleter > *
+ boost_132::detail::sp_counted_base_impl<T *, boost::serialization::detail::null_deleter > *
>(NULL));
         boost_132::shared_ptr<T> sp;
         ar >> boost::serialization::make_nvp("px", sp.px);
         ar >> boost::serialization::make_nvp("pn", sp.pn);
         // got to keep the sps around so the sp.pns don't disappear
- ar.append(sp);
+ ar.template get_helper<boost::serialization::detail::shared_ptr_helper>().append(sp);
         r = sp.get();
     }
     else
@@ -135,7 +136,7 @@
     {
         ar >> boost::serialization::make_nvp("px", r);
     }
- ar.reset(t,r);
+ ar.template get_helper<boost::serialization::detail::shared_ptr_helper>().reset(t,r);
 }
 
 template<class Archive, class T>

Added: branches/serialization_helper_support/boost/serialization/shared_ptr_helper.hpp
==============================================================================
--- (empty file)
+++ branches/serialization_helper_support/boost/serialization/shared_ptr_helper.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -0,0 +1,123 @@
+#ifndef BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
+#define BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// shared_ptr_helper.hpp: serialization for boost shared pointer
+
+// (C) Copyright 2004-2008 Robert Ramey, Martin Ecker and Joaquin M Lopez Munoz
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <map>
+#include <list>
+#include <cstddef> // NULL
+
+#include <boost/config.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/serialization/type_info_implementation.hpp>
+#include <boost/serialization/shared_ptr_132.hpp>
+#include <boost/serialization/throw_exception.hpp>
+
+#include <boost/archive/archive_exception.hpp>
+
+namespace boost_132 {
+ template<class T> class shared_ptr;
+}
+namespace boost {
+
+template<class T> class shared_ptr;
+
+namespace serialization {
+
+class extended_type_info;
+
+namespace detail {
+
+struct null_deleter {
+ void operator()(void const *) const {}
+};
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// a common class for holding various types of shared pointers
+
+class shared_ptr_helper {
+ typedef std::map<const void *, shared_ptr<void> > collection_type;
+ typedef collection_type::const_iterator iterator_type;
+ // list of shared_pointers create accessable by raw pointer. This
+ // is used to "match up" shared pointers loaded at different
+ // points in the archive.
+ collection_type m_pointers;
+
+ // list of loaded pointers. This is used to be sure that the pointers
+ // stay around long enough to be "matched" with other pointers loaded
+ // by the same archive. These are created with a "null_deleter" so that
+ // when this list is destroyed - the underlaying raw pointers are not
+ // destroyed. This has to be done because the pointers are also held by
+ // new system which is disjoint from this set. This is implemented
+ // by a change in load_construct_data below. It makes this file suitable
+ // only for loading pointers into a 1.33 or later boost system.
+ std::list<boost_132::shared_ptr<void> > m_pointers_132;
+
+ // return a void pointer to the most derived type
+ template<class T>
+ const void * object_identifier(T * t) const {
+ const boost::serialization::extended_type_info * true_type
+ = boost::serialization::type_info_implementation<T>::type
+ ::get_const_instance().get_derived_extended_type_info(*t);
+ // note:if this exception is thrown, be sure that derived pointer
+ // is either registered or exported.
+ if(NULL == true_type)
+ boost::serialization::throw_exception(
+ boost::archive::archive_exception(
+ boost::archive::archive_exception::unregistered_class
+ )
+ );
+ const boost::serialization::extended_type_info * this_type
+ = & boost::serialization::type_info_implementation<T>::type
+ ::get_const_instance();
+ const void * vp = void_downcast(
+ *true_type,
+ *this_type,
+ static_cast<const void *>(t)
+ );
+ return vp;
+ }
+public:
+ template<class T>
+ void reset(shared_ptr<T> & s, T * r){
+ if(NULL == r){
+ s.reset();
+ return;
+ }
+ // get pointer to the most derived object. This is effectively
+ // the object identifer
+ const void * od = object_identifier(r);
+
+ iterator_type it = m_pointers.find(od);
+
+ if(it == m_pointers.end()){
+ s.reset(r);
+ m_pointers.insert(collection_type::value_type(od,s));
+ }
+ else{
+ s = static_pointer_cast<T>((*it).second);
+ }
+ }
+ void append(const boost_132::shared_ptr<void> & t){
+ m_pointers_132.push_back(t);
+ }
+};
+
+} // namespace detail
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP

Modified: branches/serialization_helper_support/boost/serialization/split_free.hpp
==============================================================================
--- branches/serialization_helper_support/boost/serialization/split_free.hpp (original)
+++ branches/serialization_helper_support/boost/serialization/split_free.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -24,8 +24,8 @@
 namespace boost {
 namespace archive {
     namespace detail {
- template<class Archive> class interface_oarchive;
- template<class Archive> class interface_iarchive;
+ template<class Archive, bool HelperSupport> class interface_oarchive;
+ template<class Archive, bool HelperSupport> class interface_iarchive;
     } // namespace detail
 } // namespace archive
 

Modified: branches/serialization_helper_support/boost/serialization/split_member.hpp
==============================================================================
--- branches/serialization_helper_support/boost/serialization/split_member.hpp (original)
+++ branches/serialization_helper_support/boost/serialization/split_member.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -25,8 +25,8 @@
 namespace boost {
 namespace archive {
     namespace detail {
- template<class Archive> class interface_oarchive;
- template<class Archive> class interface_iarchive;
+ template<class Archive, bool HelperSupport> class interface_oarchive;
+ template<class Archive, bool HelperSupport> class interface_iarchive;
     } // namespace detail
 } // namespace archive
 

Added: branches/serialization_helper_support/libs/detail/utf8_codecvt_facet.cpp
==============================================================================
--- (empty file)
+++ branches/serialization_helper_support/libs/detail/utf8_codecvt_facet.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -0,0 +1,269 @@
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// utf8_codecvt_facet.cpp
+
+// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia_at_[hidden])
+// Andrew Lumsdaine, Indiana University (lums_at_[hidden]).
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Please see the comments in <boost/detail/utf8_codecvt_facet.hpp> to
+// learn how this file should be used.
+
+#include <boost/detail/utf8_codecvt_facet.hpp>
+
+#include <cstdlib> // for multi-byte converson routines
+#include <cassert>
+
+#include <boost/limits.hpp>
+#include <boost/config.hpp>
+
+// If we don't have wstring, then Unicode support
+// is not available anyway, so we don't need to even
+// compiler this file. This also fixes the problem
+// with mingw, which can compile this file, but will
+// generate link error when building DLL.
+#ifndef BOOST_NO_STD_WSTRING
+
+BOOST_UTF8_BEGIN_NAMESPACE
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// implementation for wchar_t
+
+// Translate incoming UTF-8 into UCS-4
+std::codecvt_base::result utf8_codecvt_facet::do_in(
+ std::mbstate_t& /*state*/,
+ const char * from,
+ const char * from_end,
+ const char * & from_next,
+ wchar_t * to,
+ wchar_t * to_end,
+ wchar_t * & to_next
+) const {
+ // Basic algorithm: The first octet determines how many
+ // octets total make up the UCS-4 character. The remaining
+ // "continuing octets" all begin with "10". To convert, subtract
+ // the amount that specifies the number of octets from the first
+ // octet. Subtract 0x80 (1000 0000) from each continuing octet,
+ // then mash the whole lot together. Note that each continuing
+ // octet only uses 6 bits as unique values, so only shift by
+ // multiples of 6 to combine.
+ while (from != from_end && to != to_end) {
+
+ // Error checking on the first octet
+ if (invalid_leading_octet(*from)){
+ from_next = from;
+ to_next = to;
+ return std::codecvt_base::error;
+ }
+
+ // The first octet is adjusted by a value dependent upon
+ // the number of "continuing octets" encoding the character
+ const int cont_octet_count = get_cont_octet_count(*from);
+ const wchar_t octet1_modifier_table[] = {
+ 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc
+ };
+
+ // The unsigned char conversion is necessary in case char is
+ // signed (I learned this the hard way)
+ wchar_t ucs_result =
+ (unsigned char)(*from++) - octet1_modifier_table[cont_octet_count];
+
+ // Invariants :
+ // 1) At the start of the loop, 'i' continuing characters have been
+ // processed
+ // 2) *from points to the next continuing character to be processed.
+ int i = 0;
+ while(i != cont_octet_count && from != from_end) {
+
+ // Error checking on continuing characters
+ if (invalid_continuing_octet(*from)) {
+ from_next = from;
+ to_next = to;
+ return std::codecvt_base::error;
+ }
+
+ ucs_result *= (1 << 6);
+
+ // each continuing character has an extra (10xxxxxx)b attached to
+ // it that must be removed.
+ ucs_result += (unsigned char)(*from++) - 0x80;
+ ++i;
+ }
+
+ // If the buffer ends with an incomplete unicode character...
+ if (from == from_end && i != cont_octet_count) {
+ // rewind "from" to before the current character translation
+ from_next = from - (i+1);
+ to_next = to;
+ return std::codecvt_base::partial;
+ }
+ *to++ = ucs_result;
+ }
+ from_next = from;
+ to_next = to;
+
+ // Were we done converting or did we run out of destination space?
+ if(from == from_end) return std::codecvt_base::ok;
+ else return std::codecvt_base::partial;
+}
+
+std::codecvt_base::result utf8_codecvt_facet::do_out(
+ std::mbstate_t& /*state*/,
+ const wchar_t * from,
+ const wchar_t * from_end,
+ const wchar_t * & from_next,
+ char * to,
+ char * to_end,
+ char * & to_next
+) const
+{
+ // RG - consider merging this table with the other one
+ const wchar_t octet1_modifier_table[] = {
+ 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc
+ };
+
+ wchar_t max_wchar = (std::numeric_limits<wchar_t>::max)();
+ while (from != from_end && to != to_end) {
+
+ // Check for invalid UCS-4 character
+ if (*from > max_wchar) {
+ from_next = from;
+ to_next = to;
+ return std::codecvt_base::error;
+ }
+
+ int cont_octet_count = get_cont_octet_out_count(*from);
+
+ // RG - comment this formula better
+ int shift_exponent = (cont_octet_count) * 6;
+
+ // Process the first character
+ *to++ = static_cast<char>(octet1_modifier_table[cont_octet_count] +
+ (unsigned char)(*from / (1 << shift_exponent)));
+
+ // Process the continuation characters
+ // Invariants: At the start of the loop:
+ // 1) 'i' continuing octets have been generated
+ // 2) '*to' points to the next location to place an octet
+ // 3) shift_exponent is 6 more than needed for the next octet
+ int i = 0;
+ while (i != cont_octet_count && to != to_end) {
+ shift_exponent -= 6;
+ *to++ = static_cast<char>(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)));
+ ++i;
+ }
+ // If we filled up the out buffer before encoding the character
+ if(to == to_end && i != cont_octet_count) {
+ from_next = from;
+ to_next = to - (i+1);
+ return std::codecvt_base::partial;
+ }
+ *from++;
+ }
+ from_next = from;
+ to_next = to;
+ // Were we done or did we run out of destination space
+ if(from == from_end) return std::codecvt_base::ok;
+ else return std::codecvt_base::partial;
+}
+
+// How many char objects can I process to get <= max_limit
+// wchar_t objects?
+int utf8_codecvt_facet::do_length(
+ BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &,
+ const char * from,
+ const char * from_end,
+ std::size_t max_limit
+#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+) const throw()
+#else
+) const
+#endif
+{
+ // RG - this code is confusing! I need a better way to express it.
+ // and test cases.
+
+ // Invariants:
+ // 1) last_octet_count has the size of the last measured character
+ // 2) char_count holds the number of characters shown to fit
+ // within the bounds so far (no greater than max_limit)
+ // 3) from_next points to the octet 'last_octet_count' before the
+ // last measured character.
+ int last_octet_count=0;
+ std::size_t char_count = 0;
+ const char* from_next = from;
+ // Use "<" because the buffer may represent incomplete characters
+ while (from_next+last_octet_count <= from_end && char_count <= max_limit) {
+ from_next += last_octet_count;
+ last_octet_count = (get_octet_count(*from_next));
+ ++char_count;
+ }
+ return static_cast<int>(from_next-from_end);
+}
+
+unsigned int utf8_codecvt_facet::get_octet_count(
+ unsigned char lead_octet
+){
+ // if the 0-bit (MSB) is 0, then 1 character
+ if (lead_octet <= 0x7f) return 1;
+
+ // Otherwise the count number of consecutive 1 bits starting at MSB
+// assert(0xc0 <= lead_octet && lead_octet <= 0xfd);
+
+ if (0xc0 <= lead_octet && lead_octet <= 0xdf) return 2;
+ else if (0xe0 <= lead_octet && lead_octet <= 0xef) return 3;
+ else if (0xf0 <= lead_octet && lead_octet <= 0xf7) return 4;
+ else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5;
+ else return 6;
+}
+BOOST_UTF8_END_NAMESPACE
+
+namespace {
+template<std::size_t s>
+int get_cont_octet_out_count_impl(wchar_t word){
+ if (word < 0x80) {
+ return 0;
+ }
+ if (word < 0x800) {
+ return 1;
+ }
+ return 2;
+}
+
+// note the following code will generate on some platforms where
+// wchar_t is defined as UCS2. The warnings are superfluous as
+// the specialization is never instantitiated with such compilers.
+template<>
+int get_cont_octet_out_count_impl<4>(wchar_t word){
+ if (word < 0x80) {
+ return 0;
+ }
+ if (word < 0x800) {
+ return 1;
+ }
+ if (word < 0x10000) {
+ return 2;
+ }
+ if (word < 0x200000) {
+ return 3;
+ }
+ if (word < 0x4000000) {
+ return 4;
+ }
+ return 5;
+}
+
+} // namespace anonymous
+
+BOOST_UTF8_BEGIN_NAMESPACE
+// How many "continuing octets" will be needed for this word
+// == total octets - 1.
+int utf8_codecvt_facet::get_cont_octet_out_count(
+ wchar_t word
+) const {
+ return get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
+}
+BOOST_UTF8_END_NAMESPACE
+
+#endif

Modified: branches/serialization_helper_support/libs/serialization/doc/archives.html
==============================================================================
--- branches/serialization_helper_support/libs/serialization/doc/archives.html (original)
+++ branches/serialization_helper_support/libs/serialization/doc/archives.html 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -112,6 +112,26 @@
     might be conditioned on the library version to make sure that libraries created by
     previous versions of the library can still be read.
   </dd>
+ <dt><h4><code>
+ sa.get_helper&lt;Helper&gt;()
+ <br>
+ sa.get_helper(u)
+ </code></h4></dt>
+ <dd>
+ The first time <code style="white-space: normal">sa.get_helper&lt;Helper&gt;()</code>
+ is invoked for a given <code style="white-space: normal">sa</code> with a particular copyable type
+ <code style="white-space: normal">Helper</code>, a default-constructed
+ <code style="white-space: normal">Helper</code> object is created, attached to
+ <code style="white-space: normal">sa</code> and a reference to it is returned. Subsequent
+ invocations of <code style="white-space: normal">sa.get_helper&lt;Helper&gt;()</code> return
+ a reference to the formerly constructed object. All objects created in this manner are
+ destroyed upon <code style="white-space: normal">sa</code> destruction time. The purpose
+ of helper objects is discussed in
+ Special Considerations - Helper Support.
+ The second syntax is included to permit this function to be called on non-conforming
+ compilers when <code style="white-space: normal">sa</code> is a template argument.
+ For more information, see <a target="detail" href="implementation.html#tempatesyntax">Template Invocation syntax</a>
+ </dd>
 </dl>
 
 <h4><a name="loading_interface">Loading Archive Concept</a></h4>
@@ -183,6 +203,26 @@
     sure that libraries created by previous versions of the library can still be read.
   </dd>
   <dt><h4><code>
+ la.get_helper&lt;Helper&gt;()
+ <br>
+ la.get_helper(u)
+ </code></h4></dt>
+ <dd>
+ The first time <code style="white-space: normal">la.get_helper&lt;Helper&gt;()</code>
+ is invoked for a given <code style="white-space: normal">la</code> with a particular copyable type
+ <code style="white-space: normal">Helper</code>, a default-constructed
+ <code style="white-space: normal">Helper</code> object is created, attached to
+ <code style="white-space: normal">la</code> and a reference to it is returned. Subsequent
+ invocations of <code style="white-space: normal">la.get_helper&lt;Helper&gt;()</code> return
+ a reference to the formerly constructed object. All objects created in this manner are
+ destroyed upon <code style="white-space: normal">la</code> destruction time. The purpose
+ of helper objects is discussed in
+ Special Considerations - Helper Support.
+ The second syntax is included to permit this function to be called on non-conforming
+ compilers when <code style="white-space: normal">la</code> is a template argument.
+ For more information, see <a target="detail" href="implementation.html#tempatesyntax">Template Invocation syntax</a>
+ </dd>
+ <dt><h4><code>
     la.reset_object_address(v, u)
   </code></h4></dt>
   <dd>

Modified: branches/serialization_helper_support/libs/serialization/doc/contents.html
==============================================================================
--- branches/serialization_helper_support/libs/serialization/doc/contents.html (original)
+++ branches/serialization_helper_support/libs/serialization/doc/contents.html 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -182,6 +182,7 @@
       <dd><div id="special_detail"><dl class="page-index">
         <dt><img style="display:none" src="dot.gif"><a target="detail" href="special.html#objecttracking">Object Tracking</a>
         <dt><img style="display:none" src="dot.gif"><a target="detail" href="special.html#classinfo">Class Information</a>
+ <dt><img style="display:none" src="dot.gif"><a target="detail" href="special.html#helpersupport">Helper Support</a>
         <dt><img style="display:none" src="plus.gif" id="portability"><a target="detail" href="special.html#portability">Archive Portability</a>
         <dd><div id="portability_detail"><dl class="page-index">
           <dt><img style="display:none" src="dot.gif"><a target="detail" href="special.html#numerics">Numerics</a>

Modified: branches/serialization_helper_support/libs/serialization/doc/implementation.html
==============================================================================
--- branches/serialization_helper_support/libs/serialization/doc/implementation.html (original)
+++ branches/serialization_helper_support/libs/serialization/doc/implementation.html 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -197,6 +197,16 @@
 </code></pre>
 so that one may write <code style="white-space: normal">ar.register_type(static_cast&lt;T *&gt;(NULL))</code> instead of
 the syntax described above.
+<p>
+Similarly, the expression
+<pre><code>
+ar.template get_helper&lt;Helper&gt;();
+</code></pre>
+that recovers a helper object of type <code>Helper</code> might pose problems,
+in which case the following alternative syntax can be used:
+<pre><code>
+ar.get_helper(static_cast&lt;Helper *&gt;(NULL));
+</code></pre>
 </ul>
 <h3><a name="othercompilerissues">Specific Compiler/Library Issues</a></h3>
 

Modified: branches/serialization_helper_support/libs/serialization/doc/special.html
==============================================================================
--- branches/serialization_helper_support/libs/serialization/doc/special.html (original)
+++ branches/serialization_helper_support/libs/serialization/doc/special.html 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -28,6 +28,7 @@
 <dl class="page-index">
   <dt>Object Tracking
   <dt>Class Information
+ <dt>Helper Support
   <dt>Archive Portability
   <dl class="page-index">
     <dt>Numerics
@@ -202,6 +203,65 @@
 BOOST_CLASS_TRACKING(pixel, boost::serialization::track_never)
 </code></pre>
 
+<h3><a name="helpersupport">Helper Support</a></h3>
+Some types, specially those with complicated lifetime behavior or limited
+access to their internal state, might need or benefit from elaborate serialization
+algorithms. In these cases, it can be advantageous to have a <i>helper object</i>
+associated to the current archive that can be used to store contextual
+information relevant to the particular type serialization algorithm.
+
+<pre><code>
+class complex_type
+{
+ ...
+};
+
+BOOST_SERIALIZATION_SPLIT_FREE(complex_type)
+
+class complex_type_serialization_helper
+{
+ // maintain contextual information for complex_type
+ // serialization algorithm
+};
+
+namespace boost {
+namespace serialization {
+
+template&lt;class Archive&gt;
+void save(Archive &amp; ar, const complex_type &amp; x, unsigned int /* version */)
+{
+ complex_type_serialization_helper &amp; hlp =
+ ar.template get_helper&lt;complex_type_serialization_helper&gt;();
+
+ // implement complex_type save algorithm with the aid of hlp
+}
+
+template&lt;class Archive&gt;
+void load(Archive &amp; ar, complex_type &amp; x, unsigned int /* version */)
+{
+ complex_type_serialization_helper &amp; hlp =
+ ar.template get_helper&lt;complex_type_serialization_helper&gt;();
+
+ // implement complex_type load algorithm with the aid of hlp
+}
+
+} // namespace serialization
+} // namespace boost
+</code></pre>
+<code style="white-space: normal">get_helper&lt;complex_type_serialization_helper&gt;();</code>
+creates a helper object associated to the archive the first time it is invoked;
+subsequent invocations return a reference to the object created in the first
+place, so that <code style="white-space: normal">hlp</code> can effectively be
+used to store contextual information persisting through the serialization
+of different <code style="white-space: normal">complex_type</code> objects on
+the same archive.
+Although the example code does not show it, the helper types used for saving and loading
+can be different. A notable example of a type whose serialization routines use helper support
+is <code style="white-space: normal">boost::shared_ptr</code>. The test
+program test_helper_support.cpp
+shows how to use helper support to implement a serialization algorithm
+for a string type that avoids emitting duplicate contents.
+
 <h3><a name="portability">Archive Portability</a></h3>
 Several archive classes create their data in the form of text or portable a binary format.
 It should be possible to save such an of such a class on one platform and load it on another.

Modified: branches/serialization_helper_support/libs/serialization/example/demo_fast_archive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/example/demo_fast_archive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/example/demo_fast_archive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -36,20 +36,22 @@
     public binary_oarchive_impl<
         fast_binary_oarchive,
         std::ostream::char_type,
- std::ostream::traits_type
+ std::ostream::traits_type,
+ true // helper support
>
 {
     typedef fast_binary_oarchive derived_t;
     typedef binary_oarchive_impl<
         fast_binary_oarchive,
         std::ostream::char_type,
- std::ostream::traits_type
+ std::ostream::traits_type,
+ true
> base_t;
 #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class boost::archive::detail::interface_oarchive<derived_t>;
- friend class basic_binary_oarchive<derived_t>;
+ friend class boost::archive::detail::interface_oarchive<derived_t, true>;
+ friend class basic_binary_oarchive<derived_t, true>;
     friend class basic_binary_oprimitive<
         derived_t,
         std::ostream::char_type,
@@ -101,20 +103,22 @@
     public binary_iarchive_impl<
         fast_binary_iarchive,
         std::istream::char_type,
- std::istream::traits_type
+ std::istream::traits_type,
+ true // helper support
>
 {
     typedef fast_binary_iarchive derived_t;
     typedef binary_iarchive_impl<
         fast_binary_iarchive,
         std::istream::char_type,
- std::istream::traits_type
+ std::istream::traits_type,
+ true
> base_t;
 #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
- friend class boost::archive::detail::interface_iarchive<derived_t>;
- friend class basic_binary_iarchive<derived_t>;
+ friend class boost::archive::detail::interface_iarchive<derived_t, true>;
+ friend class basic_binary_iarchive<derived_t, true>;
     friend class basic_binary_iprimitive<
         derived_t,
         std::ostream::char_type,

Modified: branches/serialization_helper_support/libs/serialization/example/portable_binary_iarchive.hpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/example/portable_binary_iarchive.hpp (original)
+++ branches/serialization_helper_support/libs/serialization/example/portable_binary_iarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -26,7 +26,6 @@
 #include <boost/archive/archive_exception.hpp>
 #include <boost/archive/basic_binary_iprimitive.hpp>
 #include <boost/archive/detail/common_iarchive.hpp>
-#include <boost/archive/shared_ptr_helper.hpp>
 #include <boost/archive/detail/register_archive.hpp>
 
 #include "portable_binary_archive.hpp"
@@ -69,8 +68,6 @@
     public boost::archive::detail::common_iarchive<
         portable_binary_iarchive
>
- ,
- public boost::archive::detail::shared_ptr_helper
         {
     typedef boost::archive::basic_binary_iprimitive<
         portable_binary_iarchive,
@@ -86,7 +83,8 @@
     friend archive_base_t;
     friend primitive_base_t; // since with override load below
     friend class boost::archive::detail::interface_iarchive<
- portable_binary_iarchive
+ portable_binary_iarchive,
+ true // helper support
>;
     friend class boost::archive::load_access;
 protected:

Modified: branches/serialization_helper_support/libs/serialization/example/portable_binary_oarchive.hpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/example/portable_binary_oarchive.hpp (original)
+++ branches/serialization_helper_support/libs/serialization/example/portable_binary_oarchive.hpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -84,7 +84,8 @@
     friend archive_base_t;
     friend primitive_base_t; // since with override save below
     friend class boost::archive::detail::interface_oarchive<
- portable_binary_oarchive
+ portable_binary_oarchive,
+ true // helper support
>;
     friend class boost::archive::save_access;
 protected:

Modified: branches/serialization_helper_support/libs/serialization/src/binary_iarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/binary_iarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/binary_iarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -26,11 +26,12 @@
     std::istream::char_type,
     std::istream::traits_type
>;
-template class basic_binary_iarchive<naked_binary_iarchive> ;
+template class basic_binary_iarchive<naked_binary_iarchive, false> ;
 template class binary_iarchive_impl<
     naked_binary_iarchive,
     std::istream::char_type,
- std::istream::traits_type
+ std::istream::traits_type,
+ false
>;
 template class detail::archive_pointer_iserializer<naked_binary_iarchive> ;
 
@@ -40,11 +41,12 @@
     std::istream::char_type,
     std::istream::traits_type
>;
-template class basic_binary_iarchive<binary_iarchive> ;
+template class basic_binary_iarchive<binary_iarchive, true> ;
 template class binary_iarchive_impl<
     binary_iarchive,
     std::istream::char_type,
- std::istream::traits_type
+ std::istream::traits_type,
+ true
>;
 template class detail::archive_pointer_iserializer<binary_iarchive> ;
 

Modified: branches/serialization_helper_support/libs/serialization/src/binary_oarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/binary_oarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/binary_oarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -22,16 +22,32 @@
 
 // explicitly instantiate for this type of binary stream
 template class basic_binary_oprimitive<
- binary_oarchive,
+ naked_binary_oarchive,
     std::ostream::char_type,
     std::ostream::traits_type
>;
-template class basic_binary_oarchive<binary_oarchive> ;
+template class basic_binary_oarchive<naked_binary_oarchive, false> ;
 template class binary_oarchive_impl<
+ naked_binary_oarchive,
+ std::ostream::char_type,
+ std::ostream::traits_type,
+ false
+>;
+template class detail::archive_pointer_oserializer<naked_binary_oarchive> ;
+
+// explicitly instantiate for this type of binary stream
+template class basic_binary_oprimitive<
     binary_oarchive,
     std::ostream::char_type,
     std::ostream::traits_type
>;
+template class basic_binary_oarchive<binary_oarchive, true> ;
+template class binary_oarchive_impl<
+ binary_oarchive,
+ std::ostream::char_type,
+ std::ostream::traits_type,
+ true
+>;
 template class detail::archive_pointer_oserializer<binary_oarchive> ;
 
 } // namespace archive

Modified: branches/serialization_helper_support/libs/serialization/src/binary_wiarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/binary_wiarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/binary_wiarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -30,11 +30,12 @@
     wchar_t,
     std::char_traits<wchar_t>
>;
-template class basic_binary_iarchive<naked_binary_wiarchive> ;
+template class basic_binary_iarchive<naked_binary_wiarchive, false> ;
 template class binary_iarchive_impl<
     naked_binary_wiarchive,
     wchar_t,
- std::char_traits<wchar_t>
+ std::char_traits<wchar_t>,
+ false
>;
 template class detail::archive_pointer_iserializer<naked_binary_wiarchive> ;
 
@@ -44,11 +45,12 @@
     wchar_t,
     std::char_traits<wchar_t>
>;
-template class basic_binary_iarchive<binary_wiarchive> ;
+template class basic_binary_iarchive<binary_wiarchive, true> ;
 template class binary_iarchive_impl<
     binary_wiarchive,
     wchar_t,
- std::char_traits<wchar_t>
+ std::char_traits<wchar_t>,
+ true
>;
 template class detail::archive_pointer_iserializer<binary_wiarchive> ;
 

Modified: branches/serialization_helper_support/libs/serialization/src/binary_woarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/binary_woarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/binary_woarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -26,16 +26,32 @@
 
 // explicitly instantiate for this type of text stream
 template class basic_binary_oprimitive<
- binary_woarchive,
+ naked_binary_woarchive,
     wchar_t,
     std::char_traits<wchar_t>
>;
-template class basic_binary_oarchive<binary_woarchive> ;
+template class basic_binary_oarchive<naked_binary_woarchive, false> ;
 template class binary_oarchive_impl<
+ naked_binary_woarchive,
+ wchar_t,
+ std::char_traits<wchar_t>,
+ false
+>;
+template class detail::archive_pointer_oserializer<naked_binary_woarchive> ;
+
+// explicitly instantiate for this type of text stream
+template class basic_binary_oprimitive<
     binary_woarchive,
     wchar_t,
     std::char_traits<wchar_t>
>;
+template class basic_binary_oarchive<binary_woarchive, true> ;
+template class binary_oarchive_impl<
+ binary_woarchive,
+ wchar_t,
+ std::char_traits<wchar_t>,
+ true
+>;
 template class detail::archive_pointer_oserializer<binary_woarchive> ;
 
 } // namespace archive

Modified: branches/serialization_helper_support/libs/serialization/src/text_iarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/text_iarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/text_iarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -19,12 +19,12 @@
 namespace boost {
 namespace archive {
 
-template class basic_text_iarchive<naked_text_iarchive> ;
-template class text_iarchive_impl<naked_text_iarchive> ;
+template class basic_text_iarchive<naked_text_iarchive, false> ;
+template class text_iarchive_impl<naked_text_iarchive, false> ;
 template class detail::archive_pointer_iserializer<naked_text_iarchive> ;
 
-template class basic_text_iarchive<text_iarchive> ;
-template class text_iarchive_impl<text_iarchive> ;
+template class basic_text_iarchive<text_iarchive, true> ;
+template class text_iarchive_impl<text_iarchive, true> ;
 template class detail::archive_pointer_iserializer<text_iarchive> ;
 
 } // namespace archive

Modified: branches/serialization_helper_support/libs/serialization/src/text_oarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/text_oarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/text_oarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -23,9 +23,13 @@
 namespace boost {
 namespace archive {
 
+template class basic_text_oarchive<naked_text_oarchive, false> ;
+template class text_oarchive_impl<naked_text_oarchive, false> ;
+template class detail::archive_pointer_oserializer<naked_text_oarchive> ;
+
 //template class basic_text_oprimitive<std::ostream> ;
-template class basic_text_oarchive<text_oarchive> ;
-template class text_oarchive_impl<text_oarchive> ;
+template class basic_text_oarchive<text_oarchive, true> ;
+template class text_oarchive_impl<text_oarchive, true> ;
 template class detail::archive_pointer_oserializer<text_oarchive> ;
 
 } // namespace serialization

Modified: branches/serialization_helper_support/libs/serialization/src/text_wiarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/text_wiarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/text_wiarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -25,12 +25,12 @@
 namespace boost {
 namespace archive {
 
-template class basic_text_iarchive<naked_text_wiarchive> ;
-template class text_wiarchive_impl<naked_text_wiarchive> ;
+template class basic_text_iarchive<naked_text_wiarchive, false> ;
+template class text_wiarchive_impl<naked_text_wiarchive, false> ;
 template class detail::archive_pointer_iserializer<naked_text_wiarchive> ;
 
-template class basic_text_iarchive<text_wiarchive> ;
-template class text_wiarchive_impl<text_wiarchive> ;
+template class basic_text_iarchive<text_wiarchive, true> ;
+template class text_wiarchive_impl<text_wiarchive, true> ;
 template class detail::archive_pointer_iserializer<text_wiarchive> ;
 
 } // namespace archive

Modified: branches/serialization_helper_support/libs/serialization/src/text_woarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/text_woarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/text_woarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -23,8 +23,12 @@
 namespace boost {
 namespace archive {
 
-template class basic_text_oarchive<text_woarchive> ;
-template class text_woarchive_impl<text_woarchive> ;
+template class basic_text_oarchive<naked_text_woarchive, false> ;
+template class text_woarchive_impl<naked_text_woarchive, false> ;
+template class detail::archive_pointer_oserializer<naked_text_woarchive> ;
+
+template class basic_text_oarchive<text_woarchive, true> ;
+template class text_woarchive_impl<text_woarchive, true> ;
 template class detail::archive_pointer_oserializer<text_woarchive> ;
 
 } // namespace archive

Modified: branches/serialization_helper_support/libs/serialization/src/xml_iarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/xml_iarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/xml_iarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -33,13 +33,13 @@
 namespace boost {
 namespace archive {
 
-template class basic_xml_iarchive<naked_xml_iarchive> ;
+template class basic_xml_iarchive<naked_xml_iarchive, false> ;
 template class detail::archive_pointer_iserializer<naked_xml_iarchive> ;
-template class xml_iarchive_impl<naked_xml_iarchive> ;
+template class xml_iarchive_impl<naked_xml_iarchive, false> ;
 
-template class basic_xml_iarchive<xml_iarchive> ;
+template class basic_xml_iarchive<xml_iarchive, true> ;
 template class detail::archive_pointer_iserializer<xml_iarchive> ;
-template class xml_iarchive_impl<xml_iarchive> ;
+template class xml_iarchive_impl<xml_iarchive, true> ;
 
 } // namespace archive
 } // namespace boost

Modified: branches/serialization_helper_support/libs/serialization/src/xml_oarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/xml_oarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/xml_oarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -23,9 +23,14 @@
 namespace archive {
 
 // explicitly instantiate for this type of xml stream
-template class basic_xml_oarchive<xml_oarchive> ;
+template class basic_xml_oarchive<naked_xml_oarchive, false> ;
+template class detail::archive_pointer_oserializer<naked_xml_oarchive> ;
+template class xml_oarchive_impl<naked_xml_oarchive, false> ;
+
+// explicitly instantiate for this type of xml stream
+template class basic_xml_oarchive<xml_oarchive, true> ;
 template class detail::archive_pointer_oserializer<xml_oarchive> ;
-template class xml_oarchive_impl<xml_oarchive> ;
+template class xml_oarchive_impl<xml_oarchive, true> ;
 
 } // namespace archive
 } // namespace boost

Modified: branches/serialization_helper_support/libs/serialization/src/xml_wiarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/xml_wiarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/xml_wiarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -38,12 +38,12 @@
 namespace boost {
 namespace archive {
 
-template class basic_xml_iarchive<naked_xml_wiarchive> ;
-template class xml_wiarchive_impl<naked_xml_wiarchive> ;
+template class basic_xml_iarchive<naked_xml_wiarchive, false> ;
+template class xml_wiarchive_impl<naked_xml_wiarchive, false> ;
 template class detail::archive_pointer_iserializer<naked_xml_wiarchive> ;
 
-template class basic_xml_iarchive<xml_wiarchive> ;
-template class xml_wiarchive_impl<xml_wiarchive> ;
+template class basic_xml_iarchive<xml_wiarchive, true> ;
+template class xml_wiarchive_impl<xml_wiarchive, true> ;
 template class detail::archive_pointer_iserializer<xml_wiarchive> ;
 
 } // namespace archive

Modified: branches/serialization_helper_support/libs/serialization/src/xml_woarchive.cpp
==============================================================================
--- branches/serialization_helper_support/libs/serialization/src/xml_woarchive.cpp (original)
+++ branches/serialization_helper_support/libs/serialization/src/xml_woarchive.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -56,8 +56,12 @@
 }
 #endif
 
-template class basic_xml_oarchive<xml_woarchive> ;
-template class xml_woarchive_impl<xml_woarchive> ;
+template class basic_xml_oarchive<naked_xml_woarchive, false> ;
+template class xml_woarchive_impl<naked_xml_woarchive, false> ;
+template class detail::archive_pointer_oserializer<naked_xml_woarchive> ;
+
+template class basic_xml_oarchive<xml_woarchive, true> ;
+template class xml_woarchive_impl<xml_woarchive, true> ;
 template class detail::archive_pointer_oserializer<xml_woarchive> ;
 
 } // namespace archive

Modified: branches/serialization_helper_support/libs/serialization/test/Jamfile.v2
==============================================================================
--- branches/serialization_helper_support/libs/serialization/test/Jamfile.v2 (original)
+++ branches/serialization_helper_support/libs/serialization/test/Jamfile.v2 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -42,6 +42,7 @@
      [ test-bsl-run_files test_class_info_save ]
      [ test-bsl-run_files test_object ]
      [ test-bsl-run_files test_primitive ]
+ [ test-bsl-run_files test_helper_support ]
      [ test-bsl-run_files test_list : A ]
      [ test-bsl-run_files test_list_ptrs : A ]
      [ test-bsl-run_files test_map : A ]

Added: branches/serialization_helper_support/libs/serialization/test/test_helper_support.cpp
==============================================================================
--- (empty file)
+++ branches/serialization_helper_support/libs/serialization/test/test_helper_support.cpp 2008-11-05 16:39:26 EST (Wed, 05 Nov 2008)
@@ -0,0 +1,129 @@
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// test_helper_support.cpp
+
+// (C) Copyright 2008 Joaquin M Lopez Munoz.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// should pass compilation and execution
+
+#include <algorithm>
+#include <cstddef>
+#include <fstream>
+
+#include <cstdio> // remove
+#include <boost/config.hpp>
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::remove;
+}
+#endif
+
+#include "test_tools.hpp"
+#include <boost/lexical_cast.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/vector.hpp>
+#include <string>
+#include <vector>
+
+class my_string:public std::string
+{
+ typedef std::string super;
+
+public:
+ my_string(){}
+ my_string(const super & str): super(str){}
+ my_string & operator=(const super& str)
+ {
+ super::operator=(str);
+ return *this;
+ }
+
+ const std::string& to_string() const { return *this; }
+};
+
+struct my_string_helper
+{
+ typedef std::vector<my_string> table;
+ table t;
+};
+
+BOOST_SERIALIZATION_SPLIT_FREE(my_string)
+
+namespace boost {
+namespace serialization {
+
+template<class Archive>
+void save(Archive & ar, const my_string & str, unsigned int /* version */)
+{
+ typedef my_string_helper::table table;
+ table& t = ar.get_helper(static_cast<my_string_helper *>(NULL)).t;
+
+ table::iterator it = std::find(t.begin(), t.end(), str);
+ if(it == t.end()){
+ table::size_type s = t.size();
+ ar << make_nvp("index", s);
+ t.push_back(str);
+ ar << make_nvp("string", str.to_string());
+ }
+ else{
+ table::size_type s = (table::size_type)(it - t.begin());
+ ar << make_nvp("index", s);
+ }
+}
+
+template<class Archive>
+void load(Archive & ar, my_string & str, unsigned int /* version */)
+{
+ typedef my_string_helper::table table;
+ table& t = ar.get_helper(static_cast<my_string_helper *>(NULL)).t;
+
+ table::size_type s = 0;
+ ar >> make_nvp("index", s);
+ if(s >= t.size()){
+ std::string tmp;
+ ar>>make_nvp("string", tmp);
+ str = tmp;
+ t.push_back(str);
+ }
+ else{
+ str = t[s];
+ }
+}
+
+} // namespace serialization
+} // namespace boost
+
+int test_helper_support()
+{
+ const char * testfile = boost::archive::tmpnam(NULL);
+ BOOST_REQUIRE(NULL != testfile);
+
+ std::vector<my_string> v1;
+ for(int i=0; i<1000; ++i){
+ v1.push_back(my_string(boost::lexical_cast<std::string>(i % 100)));
+ }
+ const std::vector<my_string>& cv1 = v1;
+ {
+ test_ostream os(testfile, TEST_STREAM_FLAGS);
+ test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
+ oa << boost::serialization::make_nvp("vector", cv1);
+ }
+ {
+ std::vector<my_string> v2;
+ test_istream is(testfile, TEST_STREAM_FLAGS);
+ test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
+ ia >> boost::serialization::make_nvp("vector", v2);
+ BOOST_CHECK(cv1 == v2);
+ }
+ std::remove(testfile);
+ return EXIT_SUCCESS;
+}
+
+int test_main( int /* argc */, char* /* argv */[] )
+{
+ return test_helper_support();
+}
+
+// EOF


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