diff options
Diffstat (limited to 'boost/archive/detail')
21 files changed, 129 insertions, 254 deletions
diff --git a/boost/archive/detail/abi_prefix.hpp b/boost/archive/detail/abi_prefix.hpp index e39ef11f18..debf79e9f0 100644 --- a/boost/archive/detail/abi_prefix.hpp +++ b/boost/archive/detail/abi_prefix.hpp @@ -14,7 +14,3 @@ # pragma warning(disable : 4251 4231 4660 4275) #endif -#if defined( __BORLANDC__ ) -#pragma nopushoptwarn -#endif - diff --git a/boost/archive/detail/abi_suffix.hpp b/boost/archive/detail/abi_suffix.hpp index a283b36cf3..4e054d6621 100644 --- a/boost/archive/detail/abi_suffix.hpp +++ b/boost/archive/detail/abi_suffix.hpp @@ -13,7 +13,3 @@ #endif #include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas -#if defined( __BORLANDC__ ) -#pragma nopushoptwarn -#endif - diff --git a/boost/archive/detail/archive_serializer_map.hpp b/boost/archive/detail/archive_serializer_map.hpp index 53fcae4045..5432bfc73e 100644 --- a/boost/archive/detail/archive_serializer_map.hpp +++ b/boost/archive/detail/archive_serializer_map.hpp @@ -36,12 +36,11 @@ namespace detail { class basic_serializer; template<class Archive> -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) -archive_serializer_map { +class BOOST_SYMBOL_VISIBLE archive_serializer_map { public: - static bool insert(const basic_serializer * bs); - static void erase(const basic_serializer * bs); - static const basic_serializer * find( + static BOOST_ARCHIVE_OR_WARCHIVE_DECL bool insert(const basic_serializer * bs); + static BOOST_ARCHIVE_OR_WARCHIVE_DECL void erase(const basic_serializer * bs); + static BOOST_ARCHIVE_OR_WARCHIVE_DECL const basic_serializer * find( const boost::serialization::extended_type_info & type_ ); }; diff --git a/boost/archive/detail/basic_archive_impl.hpp b/boost/archive/detail/basic_archive_impl.hpp deleted file mode 100644 index 860066f89f..0000000000 --- a/boost/archive/detail/basic_archive_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP -#define BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// basic_archive_impl.hpp: - -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . -// 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 <set> - -#include <boost/archive/detail/abi_prefix.hpp> // must be the last header - -namespace boost { -namespace serialization { - class extended_type_info; -} // namespace serialization - -namespace archive { -namespace detail { - -////////////////////////////////////////////////////////////////////// -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_archive_impl -{ -}; - -} // namespace detail -} // namespace serialization -} // namespace boost - -#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas - -#endif //BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP - - - diff --git a/boost/archive/detail/basic_config.hpp b/boost/archive/detail/basic_config.hpp deleted file mode 100644 index 4bd2723eb2..0000000000 --- a/boost/archive/detail/basic_config.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP -#define BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -// basic_config.hpp ---------------------------------------------// - -// (c) Copyright Robert Ramey 2004 -// 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 library home page at http://www.boost.org/libs/serialization - -//----------------------------------------------------------------------------// - -// This header implements separate compilation features as described in -// http://www.boost.org/more/separate_compilation.html - -#include <boost/config.hpp> - -#ifdef BOOST_HAS_DECLSPEC // defined in config system -// we need to import/export our code only if the user has specifically -// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost -// libraries to be dynamically linked, or BOOST_ARCHIVE_DYN_LINK -// if they want just this one to be dynamically linked: -#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ARCHIVE_DYN_LINK) -// export if this is our own source, otherwise import: -#ifdef BOOST_ARCHIVE_SOURCE -# define BOOST_ARCHIVE_DECL __declspec(dllexport) -#else -# define BOOST_ARCHIVE_DECL __declspec(dllimport) -#endif // BOOST_ARCHIVE_SOURCE -#endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC -// -// if BOOST_ARCHIVE_DECL isn't defined yet define it now: -#ifndef BOOST_ARCHIVE_DECL -#define BOOST_ARCHIVE_DECL -#endif - -#endif // BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP diff --git a/boost/archive/detail/basic_iarchive.hpp b/boost/archive/detail/basic_iarchive.hpp index ce8dbc0793..befd0c75f2 100644 --- a/boost/archive/detail/basic_iarchive.hpp +++ b/boost/archive/detail/basic_iarchive.hpp @@ -37,11 +37,12 @@ namespace archive { namespace detail { class basic_iarchive_impl; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class basic_iserializer; +class basic_pointer_iserializer; + ////////////////////////////////////////////////////////////////////// // class basic_iarchive - read serialized objects from a input stream -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : +class BOOST_SYMBOL_VISIBLE basic_iarchive : private boost::noncopyable, public boost::archive::detail::helper_collection { @@ -56,41 +57,46 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : virtual void vload(class_name_type &t) = 0; virtual void vload(tracking_type &t) = 0; protected: - basic_iarchive(unsigned int flags); + BOOST_ARCHIVE_DECL basic_iarchive(unsigned int flags); + boost::archive::detail::helper_collection & + get_helper_collection(){ + return *this; + } public: + // some msvc versions require that the following function be public + // otherwise it should really protected. // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_iarchive(); + BOOST_ARCHIVE_DECL ~basic_iarchive(); // note: NOT part of the public API. - void next_object_pointer(void *t); - void register_basic_serializer( + BOOST_ARCHIVE_DECL void next_object_pointer(void *t); + BOOST_ARCHIVE_DECL void register_basic_serializer( const basic_iserializer & bis ); - void load_object( + BOOST_ARCHIVE_DECL void load_object( void *t, const basic_iserializer & bis ); - const basic_pointer_iserializer * + BOOST_ARCHIVE_DECL const basic_pointer_iserializer * load_pointer( void * & t, const basic_pointer_iserializer * bpis_ptr, const basic_pointer_iserializer * (*finder)( const boost::serialization::extended_type_info & eti ) - ); // real public API starts here - void + BOOST_ARCHIVE_DECL void set_library_version(library_version_type archive_library_version); - library_version_type + BOOST_ARCHIVE_DECL library_version_type get_library_version() const; - unsigned int + BOOST_ARCHIVE_DECL unsigned int get_flags() const; - void + BOOST_ARCHIVE_DECL void reset_object_address(const void * new_address, const void * old_address); - void + BOOST_ARCHIVE_DECL void delete_created_pointers(); }; diff --git a/boost/archive/detail/basic_iserializer.hpp b/boost/archive/detail/basic_iserializer.hpp index 3bff3e1256..240f0bc06e 100644 --- a/boost/archive/detail/basic_iserializer.hpp +++ b/boost/archive/detail/basic_iserializer.hpp @@ -39,23 +39,23 @@ namespace serialization { namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class basic_iarchive; +class basic_pointer_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer : +class BOOST_SYMBOL_VISIBLE basic_iserializer : public basic_serializer { private: basic_pointer_iserializer *m_bpis; protected: - explicit basic_iserializer( + explicit BOOST_ARCHIVE_DECL basic_iserializer( const boost::serialization::extended_type_info & type ); // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_iserializer(); + BOOST_ARCHIVE_DECL ~basic_iserializer(); public: bool serialized_as_pointer() const { return m_bpis != NULL; diff --git a/boost/archive/detail/basic_oarchive.hpp b/boost/archive/detail/basic_oarchive.hpp index fe192f0ab3..702c5604bc 100644 --- a/boost/archive/detail/basic_oarchive.hpp +++ b/boost/archive/detail/basic_oarchive.hpp @@ -35,12 +35,12 @@ namespace archive { namespace detail { class basic_oarchive_impl; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class basic_oserializer; +class basic_pointer_oserializer; ////////////////////////////////////////////////////////////////////// // class basic_oarchive - write serialized objects to an output stream -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : +class BOOST_SYMBOL_VISIBLE basic_oarchive : private boost::noncopyable, public boost::archive::detail::helper_collection { @@ -59,22 +59,26 @@ class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : virtual void vsave(const class_name_type & t) = 0; virtual void vsave(const tracking_type t) = 0; protected: - basic_oarchive(unsigned int flags = 0); + BOOST_ARCHIVE_DECL basic_oarchive(unsigned int flags = 0); + BOOST_ARCHIVE_DECL boost::archive::detail::helper_collection & + get_helper_collection(){ + return *this; + } // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_oarchive(); + BOOST_ARCHIVE_DECL ~basic_oarchive(); public: // note: NOT part of the public interface - void register_basic_serializer( + BOOST_ARCHIVE_DECL void register_basic_serializer( const basic_oserializer & bos ); - void save_object( + BOOST_ARCHIVE_DECL void save_object( const void *x, const basic_oserializer & bos ); - void save_pointer( + BOOST_ARCHIVE_DECL void save_pointer( const void * t, const basic_pointer_oserializer * bpos_ptr ); @@ -82,9 +86,9 @@ public: vsave(NULL_POINTER_TAG); } // real public interface starts here - void end_preamble(); // default implementation does nothing - library_version_type get_library_version() const; - unsigned int get_flags() const; + BOOST_ARCHIVE_DECL void end_preamble(); // default implementation does nothing + BOOST_ARCHIVE_DECL library_version_type get_library_version() const; + BOOST_ARCHIVE_DECL unsigned int get_flags() const; }; } // namespace detail diff --git a/boost/archive/detail/basic_oserializer.hpp b/boost/archive/detail/basic_oserializer.hpp index 6ae063f55d..7a710ba6bc 100644 --- a/boost/archive/detail/basic_oserializer.hpp +++ b/boost/archive/detail/basic_oserializer.hpp @@ -40,23 +40,23 @@ namespace serialization { namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class basic_oarchive; +class basic_pointer_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer : +class BOOST_SYMBOL_VISIBLE basic_oserializer : public basic_serializer { private: basic_pointer_oserializer *m_bpos; protected: - explicit basic_oserializer( + explicit BOOST_ARCHIVE_DECL basic_oserializer( const boost::serialization::extended_type_info & type_ ); // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_oserializer(); + BOOST_ARCHIVE_DECL ~basic_oserializer(); public: bool serialized_as_pointer() const { return m_bpos != NULL; diff --git a/boost/archive/detail/basic_pointer_iserializer.hpp b/boost/archive/detail/basic_pointer_iserializer.hpp index 86badc1937..23b9f906dc 100644 --- a/boost/archive/detail/basic_pointer_iserializer.hpp +++ b/boost/archive/detail/basic_pointer_iserializer.hpp @@ -37,20 +37,20 @@ namespace serialization { namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; +class basic_iarchive; +class basic_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer +class BOOST_SYMBOL_VISIBLE basic_pointer_iserializer : public basic_serializer { protected: - explicit basic_pointer_iserializer( + explicit BOOST_ARCHIVE_DECL basic_pointer_iserializer( const boost::serialization::extended_type_info & type_ ); // account for bogus gcc warning #if defined(__GNUC__) virtual #endif - ~basic_pointer_iserializer(); + BOOST_ARCHIVE_DECL ~basic_pointer_iserializer(); public: virtual void * heap_allocation() const = 0; virtual const basic_iserializer & get_basic_serializer() const = 0; diff --git a/boost/archive/detail/basic_pointer_oserializer.hpp b/boost/archive/detail/basic_pointer_oserializer.hpp index bafc46a1d7..868e2fa580 100644 --- a/boost/archive/detail/basic_pointer_oserializer.hpp +++ b/boost/archive/detail/basic_pointer_oserializer.hpp @@ -36,14 +36,14 @@ namespace serialization { namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; +class basic_oarchive; +class basic_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer : +class BOOST_SYMBOL_VISIBLE basic_pointer_oserializer : public basic_serializer { protected: - explicit basic_pointer_oserializer( + explicit BOOST_ARCHIVE_DECL basic_pointer_oserializer( const boost::serialization::extended_type_info & type_ ); public: @@ -51,7 +51,7 @@ public: #if defined(__GNUC__) virtual #endif - ~basic_pointer_oserializer(); + BOOST_ARCHIVE_DECL ~basic_pointer_oserializer(); virtual const basic_oserializer & get_basic_serializer() const = 0; virtual void save_object_ptr( basic_oarchive & ar, diff --git a/boost/archive/detail/basic_serializer_map.hpp b/boost/archive/detail/basic_serializer_map.hpp index 202c20e1ff..7934180336 100644 --- a/boost/archive/detail/basic_serializer_map.hpp +++ b/boost/archive/detail/basic_serializer_map.hpp @@ -34,7 +34,7 @@ namespace detail { class basic_serializer; -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +class BOOST_SYMBOL_VISIBLE basic_serializer_map : public boost::noncopyable { @@ -50,9 +50,9 @@ basic_serializer_map : public > map_type; map_type m_map; public: - bool insert(const basic_serializer * bs); - void erase(const basic_serializer * bs); - const basic_serializer * find( + BOOST_ARCHIVE_DECL bool insert(const basic_serializer * bs); + BOOST_ARCHIVE_DECL void erase(const basic_serializer * bs); + BOOST_ARCHIVE_DECL const basic_serializer * find( const boost::serialization::extended_type_info & type_ ) const; private: diff --git a/boost/archive/detail/common_iarchive.hpp b/boost/archive/detail/common_iarchive.hpp index 45e6d34b3e..b4c44d2767 100644 --- a/boost/archive/detail/common_iarchive.hpp +++ b/boost/archive/detail/common_iarchive.hpp @@ -62,7 +62,7 @@ private: protected: // default processing - invoke serialization library template<class T> - void load_override(T & t, BOOST_PFTO int){ + void load_override(T & t){ archive::load(* this->This(), t); } // default implementations of functions which emit start/end tags for diff --git a/boost/archive/detail/common_oarchive.hpp b/boost/archive/detail/common_oarchive.hpp index 0d7474bcdc..13c71bc5a8 100644 --- a/boost/archive/detail/common_oarchive.hpp +++ b/boost/archive/detail/common_oarchive.hpp @@ -65,7 +65,7 @@ private: protected: // default processing - invoke serialization library template<class T> - void save_override(T & t, BOOST_PFTO int){ + void save_override(T & t){ archive::save(* this->This(), t); } void save_start(const char * /*name*/){} diff --git a/boost/archive/detail/decl.hpp b/boost/archive/detail/decl.hpp index 44e22be96b..bb386d86f8 100644 --- a/boost/archive/detail/decl.hpp +++ b/boost/archive/detail/decl.hpp @@ -22,58 +22,38 @@ // http://www.boost.org/more/separate_compilation.html #include <boost/config.hpp> -#include <boost/preprocessor/facilities/empty.hpp> -#if defined(BOOST_HAS_DECLSPEC) - #if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)) - #if defined(BOOST_ARCHIVE_SOURCE) - #if defined(__BORLANDC__) - #define BOOST_ARCHIVE_DECL(T) T __export - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export - #else - #define BOOST_ARCHIVE_DECL(T) __declspec(dllexport) T - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T - #endif - #else - #if defined(__BORLANDC__) - #define BOOST_ARCHIVE_DECL(T) T __import - #else - #define BOOST_ARCHIVE_DECL(T) __declspec(dllimport) T - #endif - #endif - #if defined(BOOST_WARCHIVE_SOURCE) - #if defined(__BORLANDC__) - #define BOOST_WARCHIVE_DECL(T) T __export - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export - #else - #define BOOST_WARCHIVE_DECL(T) __declspec(dllexport) T - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T - #endif - #else - #if defined(__BORLANDC__) - #define BOOST_WARCHIVE_DECL(T) T __import - #else - #define BOOST_WARCHIVE_DECL(T) __declspec(dllimport) T - #endif - #endif - #if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE) - #if defined(__BORLANDC__) - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __import - #else - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllimport) T - #endif - #endif +#if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)) + #if defined(BOOST_ARCHIVE_SOURCE) + #define BOOST_ARCHIVE_DECL BOOST_SYMBOL_EXPORT + #else + #define BOOST_ARCHIVE_DECL BOOST_SYMBOL_IMPORT #endif -#endif // BOOST_HAS_DECLSPEC + #if defined(BOOST_WARCHIVE_SOURCE) + #define BOOST_WARCHIVE_DECL BOOST_SYMBOL_EXPORT + #else + #define BOOST_WARCHIVE_DECL BOOST_SYMBOL_IMPORT + #endif + #if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_IMPORT + #endif + + #if defined(BOOST_WARCHIVE_SOURCE) || defined(BOOST_ARCHIVE_SOURCE) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_EXPORT + #else + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_IMPORT + #endif + +#endif #if ! defined(BOOST_ARCHIVE_DECL) - #define BOOST_ARCHIVE_DECL(T) T + #define BOOST_ARCHIVE_DECL #endif #if ! defined(BOOST_WARCHIVE_DECL) - #define BOOST_WARCHIVE_DECL(T) T + #define BOOST_WARCHIVE_DECL #endif #if ! defined(BOOST_ARCHIVE_OR_WARCHIVE_DECL) - #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL #endif #endif // BOOST_ARCHIVE_DETAIL_DECL_HPP diff --git a/boost/archive/detail/helper_collection.hpp b/boost/archive/detail/helper_collection.hpp index cfa644f7d4..edb4125e30 100644 --- a/boost/archive/detail/helper_collection.hpp +++ b/boost/archive/detail/helper_collection.hpp @@ -55,11 +55,12 @@ class helper_collection collection m_collection; struct predicate { + BOOST_DELETED_FUNCTION(predicate & operator=(const predicate & rhs)) + public: const void * const m_ti; bool operator()(helper_value_type const &rhs) const { return m_ti == rhs.first; } - predicate & operator=(const void * ti); // to suppress warning predicate(const void * ti) : m_ti(ti) {} @@ -69,7 +70,7 @@ protected: ~helper_collection(){} public: template<typename Helper> - Helper& get_helper(void * const id = 0) { + Helper& find_helper(void * const id = 0) { collection::const_iterator it = std::find_if( m_collection.begin(), diff --git a/boost/archive/detail/interface_iarchive.hpp b/boost/archive/detail/interface_iarchive.hpp index b7bd1659f3..4a99e28b59 100644 --- a/boost/archive/detail/interface_iarchive.hpp +++ b/boost/archive/detail/interface_iarchive.hpp @@ -20,6 +20,7 @@ #include <boost/mpl/bool.hpp> #include <boost/archive/detail/auto_link_archive.hpp> #include <boost/archive/detail/iserializer.hpp> +#include <boost/archive/detail/helper_collection.hpp> #include <boost/serialization/singleton.hpp> #include <boost/archive/detail/abi_prefix.hpp> // must be the last header @@ -27,7 +28,7 @@ namespace boost { namespace archive { namespace detail { -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class basic_pointer_iserializer; template<class Archive> class interface_iarchive @@ -55,9 +56,16 @@ public: this->This()->register_basic_serializer(bpis.get_basic_serializer()); return & bpis; } + template<class Helper> + Helper & + get_helper(void * const id = 0){ + helper_collection & hc = this->This()->get_helper_collection(); + return hc.template find_helper<Helper>(id); + } + template<class T> Archive & operator>>(T & t){ - this->This()->load_override(t, 0); + this->This()->load_override(t); return * this->This(); } diff --git a/boost/archive/detail/interface_oarchive.hpp b/boost/archive/detail/interface_oarchive.hpp index 7ae71768a8..187013b6cd 100644 --- a/boost/archive/detail/interface_oarchive.hpp +++ b/boost/archive/detail/interface_oarchive.hpp @@ -29,7 +29,7 @@ namespace boost { namespace archive { namespace detail { -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_pointer_oserializer; template<class Archive> class interface_oarchive @@ -57,22 +57,25 @@ public: this->This()->register_basic_serializer(bpos.get_basic_serializer()); return & bpos; } + + template<class Helper> + Helper & + get_helper(void * const id = 0){ + helper_collection & hc = this->This()->get_helper_collection(); + return hc.template find_helper<Helper>(id); + } template<class T> - Archive & operator<<(T & t){ - this->This()->save_override(t, 0); + Archive & operator<<(const T & t){ + this->This()->save_override(t); return * this->This(); } // the & operator template<class T> - Archive & operator&(T & t){ - #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - return * this->This() << const_cast<const T &>(t); - #else - return * this->This() << t; - #endif - } + Archive & operator&(const T & t){ + return * this ->This() << t; + }; }; } // namespace detail diff --git a/boost/archive/detail/iserializer.hpp b/boost/archive/detail/iserializer.hpp index 65dfe8e305..d6d3f42f6e 100644 --- a/boost/archive/detail/iserializer.hpp +++ b/boost/archive/detail/iserializer.hpp @@ -58,8 +58,7 @@ namespace std{ #include <boost/serialization/assume_abstract.hpp> #define DONT_USE_HAS_NEW_OPERATOR ( \ - defined(__BORLANDC__) \ - || BOOST_WORKAROUND(__IBMCPP__, < 1210) \ + BOOST_WORKAROUND(__IBMCPP__, < 1210) \ || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \ ) #if ! DONT_USE_HAS_NEW_OPERATOR @@ -618,40 +617,6 @@ inline void load(Archive & ar, T &t){ typex::invoke(ar, t); } -#if 0 - -// BORLAND -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) -// borland has a couple of problems -// a) if function is partially specialized - see below -// const paramters are transformed to non-const ones -// b) implementation of base_object can't be made to work -// correctly which results in all base_object s being const. -// So, strip off the const for borland. This breaks the trap -// for loading const objects - but I see no alternative -template<class Archive, class T> -inline void load(Archive &ar, const T & t){ - load(ar, const_cast<T &>(t)); -} -#endif - -// let wrappers through. -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -template<class Archive, class T> -inline void load_wrapper(Archive &ar, const T&t, mpl::true_){ - boost::archive::load(ar, const_cast<T&>(t)); -} - -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) -template<class Archive, class T> -inline void load(Archive &ar, const T&t){ - load_wrapper(ar,t,serialization::is_wrapper< T >()); -} -#endif -#endif - -#endif - } // namespace archive } // namespace boost diff --git a/boost/archive/detail/polymorphic_iarchive_route.hpp b/boost/archive/detail/polymorphic_iarchive_route.hpp index a8eb7aa94a..2c57a3f51c 100644 --- a/boost/archive/detail/polymorphic_iarchive_route.hpp +++ b/boost/archive/detail/polymorphic_iarchive_route.hpp @@ -39,8 +39,8 @@ namespace serialization { namespace archive { namespace detail{ -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class BOOST_ARCHIVE_DECL basic_iserializer; +class BOOST_ARCHIVE_DECL basic_pointer_iserializer; #ifdef BOOST_MSVC # pragma warning(push) @@ -166,10 +166,13 @@ private: virtual void load_end(const char * name){ ArchiveImplementation::load_end(name); } - virtual void register_basic_serializer(const basic_iserializer & bis){ ArchiveImplementation::register_basic_serializer(bis); } + virtual helper_collection & + get_helper_collection(){ + return ArchiveImplementation::get_helper_collection(); + } public: // this can't be inheriteded because they appear in mulitple // parents diff --git a/boost/archive/detail/polymorphic_oarchive_route.hpp b/boost/archive/detail/polymorphic_oarchive_route.hpp index 9211df2aa7..ae750133a8 100644 --- a/boost/archive/detail/polymorphic_oarchive_route.hpp +++ b/boost/archive/detail/polymorphic_oarchive_route.hpp @@ -39,8 +39,8 @@ namespace serialization { namespace archive { namespace detail{ -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class BOOST_ARCHIVE_DECL basic_oserializer; +class BOOST_ARCHIVE_DECL basic_pointer_oserializer; #ifdef BOOST_MSVC # pragma warning(push) @@ -160,6 +160,10 @@ private: virtual void register_basic_serializer(const detail::basic_oserializer & bos){ ArchiveImplementation::register_basic_serializer(bos); } + virtual helper_collection & + get_helper_collection(){ + return ArchiveImplementation::get_helper_collection(); + } public: // this can't be inheriteded because they appear in mulitple // parents |