Python: Upgraded boost to 1.58

This commit is contained in:
Philippe Tillet
2015-08-06 23:47:51 -07:00
parent bf866978ad
commit 080bbea9b9
2821 changed files with 12373 additions and 384959 deletions

View File

@@ -48,10 +48,10 @@ struct aligned_storage_imp
{ {
char buf[size_]; char buf[size_];
typename mpl::eval_if_c< typename ::boost::mpl::eval_if_c<
alignment_ == std::size_t(-1) alignment_ == std::size_t(-1)
, mpl::identity<detail::max_align> , ::boost::mpl::identity< ::boost::detail::max_align >
, type_with_alignment<alignment_> , ::boost::type_with_alignment<alignment_>
>::type align_; >::type align_;
} data_; } data_;
void* address() const { return const_cast<aligned_storage_imp*>(this); } void* address() const { return const_cast<aligned_storage_imp*>(this); }
@@ -76,12 +76,12 @@ class aligned_storage :
#else #else
public public
#endif #endif
detail::aligned_storage::aligned_storage_imp<size_, alignment_> ::boost::detail::aligned_storage::aligned_storage_imp<size_, alignment_>
{ {
public: // constants public: // constants
typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type; typedef ::boost::detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
std::size_t std::size_t
@@ -96,25 +96,11 @@ public: // constants
) )
); );
#if defined(__GNUC__) &&\
(__GNUC__ > 3) ||\
(__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\
(__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3)))
private: // noncopyable private: // noncopyable
aligned_storage(const aligned_storage&); aligned_storage(const aligned_storage&);
aligned_storage& operator=(const aligned_storage&); aligned_storage& operator=(const aligned_storage&);
#else // gcc less than 3.2.3
public: // _should_ be noncopyable, but GCC compiler emits error
aligned_storage(const aligned_storage&);
aligned_storage& operator=(const aligned_storage&);
#endif // gcc < 3.2.3 workaround
public: // structors public: // structors
aligned_storage() aligned_storage()
@@ -132,46 +118,22 @@ public: // accessors
return static_cast<type*>(this)->address(); return static_cast<type*>(this)->address();
} }
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
const void* address() const const void* address() const
{ {
return static_cast<const type*>(this)->address(); return static_cast<const type*>(this)->address();
} }
#else // MSVC6
const void* address() const;
#endif // MSVC6 workaround
}; };
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
// MSVC6 seems not to like inline functions with const void* returns, so we
// declare the following here:
template <std::size_t S, std::size_t A>
const void* aligned_storage<S,A>::address() const
{
return const_cast< aligned_storage<S,A>* >(this)->address();
}
#endif // MSVC6 workaround
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// //
// Make sure that is_pod recognises aligned_storage<>::type // Make sure that is_pod recognises aligned_storage<>::type
// as a POD (Note that aligned_storage<> itself is not a POD): // as a POD (Note that aligned_storage<> itself is not a POD):
// //
template <std::size_t size_, std::size_t alignment_> template <std::size_t size_, std::size_t alignment_>
struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> > struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
BOOST_TT_AUX_BOOL_C_BASE(true) BOOST_TT_AUX_BOOL_C_BASE(true)
{ {
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
}; };
#endif
} // namespace boost } // namespace boost

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ADD_FACET_HPP #define BOOST_ARCHIVE_ADD_FACET_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP #define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -49,7 +49,7 @@ public:
typedef enum { typedef enum {
no_exception, // initialized without code no_exception, // initialized without code
other_exception, // any excepton not listed below other_exception, // any excepton not listed below
unregistered_class, // attempt to serialize a pointer of an unregistered_class, // attempt to serialize a pointer of
// an unregistered class // an unregistered class
invalid_signature, // first line of archive does not contain invalid_signature, // first line of archive does not contain
// expected string // expected string
@@ -57,8 +57,8 @@ public:
// subsequent to this one // subsequent to this one
pointer_conflict, // an attempt has been made to directly pointer_conflict, // an attempt has been made to directly
// serialize an object which has // serialize an object which has
// already been serialzed through a pointer. // already been serialized through a pointer.
// Were this permited, the archive load would result // Were this permitted, the archive load would result
// in the creation of an extra copy of the obect. // in the creation of an extra copy of the obect.
incompatible_native_format, // attempt to read native binary format incompatible_native_format, // attempt to read native binary format
// on incompatible platform // on incompatible platform
@@ -70,7 +70,7 @@ public:
unregistered_cast, // base - derived relationship not registered with unregistered_cast, // base - derived relationship not registered with
// void_cast_register // void_cast_register
unsupported_class_version, // type saved with a version # greater than the unsupported_class_version, // type saved with a version # greater than the
// one used by the program. This indicates that the proggram // one used by the program. This indicates that the program
// needs to be rebuilt. // needs to be rebuilt.
multiple_code_instantiation, // code for implementing serialization for some multiple_code_instantiation, // code for implementing serialization for some
// type has been instantiated in more than one module. // type has been instantiated in more than one module.

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -15,7 +15,7 @@
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <cstring> // count
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/cstdint.hpp> // size_t #include <boost/cstdint.hpp> // size_t
@@ -221,6 +221,9 @@ struct class_name_type :
operator char * () { operator char * () {
return t; return t;
} }
std::size_t size() const {
return std::strlen(t);
}
explicit class_name_type(const char *key_) explicit class_name_type(const char *key_)
: t(const_cast<char *>(key_)){} : t(const_cast<char *>(key_)){}
explicit class_name_type(char *key_) explicit class_name_type(char *key_)

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -44,21 +44,27 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_iarchive;
} // namespace detail
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class basic_binary_iarchive - read serialized objects from a input binary stream // class basic_binary_iarchive - read serialized objects from a input binary stream
template<class Archive> template<class Archive>
class basic_binary_iarchive : class basic_binary_iarchive :
public detail::common_iarchive<Archive> public detail::common_iarchive<Archive>
{ {
protected: #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public: public:
#elif defined(BOOST_MSVC) #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_iarchive<Archive>; friend detail::interface_iarchive<Archive>;
#else #else
friend class detail::interface_iarchive<Archive>; friend class detail::interface_iarchive<Archive>;
#endif
#endif #endif
// intermediate level to support override of operators // intermediate level to support override of operators
// fot templates in the absence of partial function // fot templates in the absence of partial function

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP #define BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -49,17 +49,21 @@ namespace std{
#include <boost/integer.hpp> #include <boost/integer.hpp>
#include <boost/integer_traits.hpp> #include <boost/integer_traits.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/mpl/placeholders.hpp> #include <boost/mpl/placeholders.hpp>
#include <boost/serialization/is_bitwise_serializable.hpp> #include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/serialization/array.hpp> #include <boost/serialization/array.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/detail/auto_link_archive.hpp> #include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost { namespace boost {
namespace archive { namespace archive {
template<class Ch>
class codecvt_null;
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// class binary_iarchive - read serialized objects from a input binary stream // class binary_iarchive - read serialized objects from a input binary stream
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
@@ -78,6 +82,7 @@ public:
} }
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<codecvt_null<Elem> > codecvt_facet;
boost::scoped_ptr<std::locale> archive_locale; boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver<Elem, Tr> locale_saver; basic_streambuf_locale_saver<Elem, Tr> locale_saver;
#endif #endif
@@ -126,7 +131,7 @@ public:
template <class T> template <class T>
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS) #if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
struct apply { struct apply {
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type; typedef typename boost::serialization::is_bitwise_serializable< T >::type type;
}; };
#else #else
struct apply : public boost::serialization::is_bitwise_serializable< T > {}; struct apply : public boost::serialization::is_bitwise_serializable< T > {};
@@ -178,7 +183,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load_binary(
boost::serialization::throw_exception( boost::serialization::throw_exception(
archive_exception(archive_exception::input_stream_error) archive_exception(archive_exception::input_stream_error)
); );
std::memcpy(static_cast<char*>(address) + (count - s), &t, s); std::memcpy(static_cast<char*>(address) + (count - s), &t, static_cast<std::size_t>(s));
} }
} }

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -46,6 +46,10 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// class basic_binary_oarchive - write serialized objects to a binary output stream // class basic_binary_oarchive - write serialized objects to a binary output stream
// note: this archive has no pretensions to portability. Archive format // note: this archive has no pretensions to portability. Archive format
@@ -58,15 +62,17 @@ template<class Archive>
class basic_binary_oarchive : class basic_binary_oarchive :
public archive::detail::common_oarchive<Archive> public archive::detail::common_oarchive<Archive>
{ {
protected: #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public: public:
#elif defined(BOOST_MSVC) #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_oarchive<Archive>; friend detail::interface_oarchive<Archive>;
#else #else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
#endif
#endif #endif
// any datatype not specifed below will be handled by base class // any datatype not specifed below will be handled by base class
typedef detail::common_oarchive<Archive> detail_common_oarchive; typedef detail::common_oarchive<Archive> detail_common_oarchive;

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP #define BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -54,12 +54,14 @@ namespace std{
namespace boost { namespace boost {
namespace archive { namespace archive {
template<class Ch>
class codecvt_null;
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class basic_binary_oprimitive - binary output of prmitives // class basic_binary_oprimitive - binary output of prmitives
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
class basic_binary_oprimitive class basic_binary_oprimitive {
{
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
friend class save_access; friend class save_access;
protected: protected:
@@ -72,6 +74,7 @@ public:
return static_cast<Archive *>(this); return static_cast<Archive *>(this);
} }
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<codecvt_null<Elem> > codecvt_facet;
boost::scoped_ptr<std::locale> archive_locale; boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver<Elem, Tr> locale_saver; basic_streambuf_locale_saver<Elem, Tr> locale_saver;
#endif #endif
@@ -122,7 +125,7 @@ public:
template <class T> template <class T>
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS) #if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
struct apply { struct apply {
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type; typedef typename boost::serialization::is_bitwise_serializable< T >::type type;
}; };
#else #else
struct apply : public boost::serialization::is_bitwise_serializable< T > {}; struct apply : public boost::serialization::is_bitwise_serializable< T > {};
@@ -170,7 +173,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save_binary(
archive_exception(archive_exception::output_stream_error) archive_exception(archive_exception::output_stream_error)
); );
//os.write( //os.write(
// static_cast<const BOOST_DEDUCED_TYPENAME OStream::char_type *>(address), // static_cast<const typename OStream::char_type *>(address),
// count // count
//); //);
//BOOST_ASSERT(os.good()); //BOOST_ASSERT(os.good());

View File

@@ -2,12 +2,12 @@
#define BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP #define BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_streambuf_local_saver.hpp // basic_streambuf_locale_saver.hpp
// (C) Copyright 2005 Robert Ramey - http://www.rrsd.com // (C) Copyright 2005 Robert Ramey - http://www.rrsd.com
@@ -50,13 +50,15 @@ public:
explicit basic_streambuf_locale_saver( state_type &s ) explicit basic_streambuf_locale_saver( state_type &s )
: s_save_( s ), a_save_( s.getloc() ) : s_save_( s ), a_save_( s.getloc() )
{} {}
basic_streambuf_locale_saver( state_type &s, aspect_type const &a ) explicit basic_streambuf_locale_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.pubimbue(a) ) : s_save_( s ), a_save_( s.pubimbue(a) )
{} {}
~basic_streambuf_locale_saver() ~basic_streambuf_locale_saver()
{ this->restore(); } { this->restore(); }
void restore() void restore(){
{ s_save_.pubimbue( a_save_ ); } s_save_.pubsync();
s_save_.pubimbue( a_save_ );
}
private: private:
state_type & s_save_; state_type & s_save_;
aspect_type const a_save_; aspect_type const a_save_;

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -40,21 +40,27 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_iarchive;
} // namespace detail
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class basic_text_iarchive - read serialized objects from a input text stream // class basic_text_iarchive - read serialized objects from a input text stream
template<class Archive> template<class Archive>
class basic_text_iarchive : class basic_text_iarchive :
public detail::common_iarchive<Archive> public detail::common_iarchive<Archive>
{ {
protected: #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public: public:
#elif defined(BOOST_MSVC) #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_iarchive<Archive>; friend detail::interface_iarchive<Archive>;
#else #else
friend class detail::interface_iarchive<Archive>; friend class detail::interface_iarchive<Archive>;
#endif
#endif #endif
// intermediate level to support override of operators // intermediate level to support override of operators
// fot templates in the absence of partial function // fot templates in the absence of partial function

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP #define BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -64,13 +64,8 @@ namespace archive {
#endif #endif
template<class IStream> template<class IStream>
class basic_text_iprimitive class basic_text_iprimitive {
{
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
protected: protected:
#else
public:
#endif
IStream &is; IStream &is;
io::ios_flags_saver flags_saver; io::ios_flags_saver flags_saver;
io::ios_precision_saver precision_saver; io::ios_precision_saver precision_saver;
@@ -78,18 +73,16 @@ public:
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale; boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver< basic_streambuf_locale_saver<
BOOST_DEDUCED_TYPENAME IStream::char_type, typename IStream::char_type,
BOOST_DEDUCED_TYPENAME IStream::traits_type typename IStream::traits_type
> locale_saver; > locale_saver;
#endif #endif
template<class T> template<class T>
void load(T & t) void load(T & t)
{ {
if(! is.fail()){ if(is >> t)
is >> t;
return; return;
}
boost::serialization::throw_exception( boost::serialization::throw_exception(
archive_exception(archive_exception::input_stream_error) archive_exception(archive_exception::input_stream_error)
); );

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -24,11 +24,9 @@
// in such cases. So we can't use basic_ostream<OStream::char_type> but rather // in such cases. So we can't use basic_ostream<OStream::char_type> but rather
// use two template parameters // use two template parameters
#include <boost/assert.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/archive/detail/common_oarchive.hpp> #include <boost/archive/detail/common_oarchive.hpp>
#include <boost/serialization/string.hpp> #include <boost/serialization/string.hpp>
@@ -42,23 +40,29 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class basic_text_oarchive // class basic_text_oarchive
template<class Archive> template<class Archive>
class basic_text_oarchive : class basic_text_oarchive :
public detail::common_oarchive<Archive> public detail::common_oarchive<Archive>
{ {
protected: #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|| BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560))
public: public:
#elif defined(BOOST_MSVC) #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_oarchive<Archive>; friend detail::interface_oarchive<Archive>;
#else #else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
#endif
#endif #endif
enum { enum {
none, none,
eol, eol,

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP #define BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -26,13 +26,14 @@
#include <iomanip> #include <iomanip>
#include <locale> #include <locale>
#include <boost/config/no_tr1/cmath.hpp> // isnan
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <cstddef> // size_t #include <cstddef> // size_t
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/io/ios_state.hpp>
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/archive/dinkumware.hpp> #include <boost/archive/dinkumware.hpp>
#endif #endif
@@ -46,6 +47,8 @@ namespace std{
} // namespace std } // namespace std
#endif #endif
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/limits.hpp> #include <boost/limits.hpp>
#include <boost/integer.hpp> #include <boost/integer.hpp>
#include <boost/io/ios_state.hpp> #include <boost/io/ios_state.hpp>
@@ -58,18 +61,12 @@ namespace std{
namespace boost { namespace boost {
namespace archive { namespace archive {
class save_access;
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class basic_text_oprimitive - output of prmitives to stream // class basic_text_oprimitive - output of prmitives to stream
template<class OStream> template<class OStream>
class basic_text_oprimitive class basic_text_oprimitive
{ {
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
protected: protected:
#else
public:
#endif
OStream &os; OStream &os;
io::ios_flags_saver flags_saver; io::ios_flags_saver flags_saver;
io::ios_precision_saver precision_saver; io::ios_precision_saver precision_saver;
@@ -77,21 +74,11 @@ public:
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale; boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver< basic_streambuf_locale_saver<
BOOST_DEDUCED_TYPENAME OStream::char_type, typename OStream::char_type,
BOOST_DEDUCED_TYPENAME OStream::traits_type typename OStream::traits_type
> locale_saver; > locale_saver;
#endif #endif
// default saving of primitives.
template<class T>
void save(const T &t){
if(os.fail())
boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error)
);
os << t;
}
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
// fundamental types that need special treatment // fundamental types that need special treatment
void save(const bool t){ void save(const bool t){
@@ -123,33 +110,77 @@ public:
save(static_cast<int>(t)); save(static_cast<int>(t));
} }
#endif #endif
void save(const float t)
{ /////////////////////////////////////////////////////////
// saving of any types not listed above
template<class T>
void save_impl(const T &t, boost::mpl::bool_<false> &){
if(os.fail())
boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error)
);
os << t;
}
/////////////////////////////////////////////////////////
// floating point types need even more special treatment
// the following determines whether the type T is some sort
// of floating point type. Note that we then assume that
// the stream << operator is defined on that type - if not
// we'll get a compile time error. This is meant to automatically
// support synthesized types which support floating point
// operations. Also it should handle compiler dependent types
// such long double. Due to John Maddock.
template<class T>
struct is_float {
typedef typename mpl::bool_<
boost::is_floating_point<T>::value
|| (std::numeric_limits<T>::is_specialized
&& !std::numeric_limits<T>::is_integer
&& !std::numeric_limits<T>::is_exact
&& std::numeric_limits<T>::max_exponent)
>::type type;
};
template<class T>
void save_impl(const T &t, boost::mpl::bool_<true> &){
// must be a user mistake - can't serialize un-initialized data // must be a user mistake - can't serialize un-initialized data
if(os.fail()) if(os.fail())
boost::serialization::throw_exception( boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error) archive_exception(archive_exception::output_stream_error)
); );
os << std::setprecision(std::numeric_limits<float>::digits10 + 2); // The formulae for the number of decimla digits required is given in
os << t; // http://www2.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf
// which is derived from Kahan's paper:
// www.eecs.berkeley.edu/~wkahan/ieee754status/ieee754.ps
// const unsigned int digits = (std::numeric_limits<T>::digits * 3010) / 10000;
// note: I've commented out the above because I didn't get good results. e.g.
// in one case I got a difference of 19 units.
#ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
const unsigned int digits = std::numeric_limits<T>::max_digits10;
#else
const unsigned int digits = std::numeric_limits<T>::digits10 + 2;
#endif
os << std::setprecision(digits) << std::scientific << t;
} }
void save(const double t)
{ template<class T>
// must be a user mistake - can't serialize un-initialized data void save(const T & t){
if(os.fail()) boost::io::ios_flags_saver fs(os);
boost::serialization::throw_exception( boost::io::ios_precision_saver ps(os);
archive_exception(archive_exception::output_stream_error) typename is_float<T>::type tf;
); save_impl(t, tf);
os << std::setprecision(std::numeric_limits<double>::digits10 + 2);
os << t;
} }
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_text_oprimitive(OStream & os, bool no_codecvt); basic_text_oprimitive(OStream & os, bool no_codecvt);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_text_oprimitive(); ~basic_text_oprimitive();
public: public:
// unformatted append of one character // unformatted append of one character
void put(BOOST_DEDUCED_TYPENAME OStream::char_type c){ void put(typename OStream::char_type c){
if(os.fail()) if(os.fail())
boost::serialization::throw_exception( boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error) archive_exception(archive_exception::output_stream_error)

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -37,21 +37,27 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_iarchive;
} // namespace detail
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class xml_iarchive - read serialized objects from a input text stream // class xml_iarchive - read serialized objects from a input text stream
template<class Archive> template<class Archive>
class basic_xml_iarchive : class basic_xml_iarchive :
public detail::common_iarchive<Archive> public detail::common_iarchive<Archive>
{ {
protected: #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public: public:
#elif defined(BOOST_MSVC) #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_oarchive<Archive>; friend detail::interface_iarchive<Archive>;
#else #else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_iarchive<Archive>;
#endif
#endif #endif
unsigned int depth; unsigned int depth;
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -17,6 +17,9 @@
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/serialization/pfto.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/archive/detail/common_oarchive.hpp> #include <boost/archive/detail/common_oarchive.hpp>
@@ -24,7 +27,6 @@
#include <boost/serialization/tracking.hpp> #include <boost/serialization/tracking.hpp>
#include <boost/serialization/string.hpp> #include <boost/serialization/string.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
@@ -36,24 +38,29 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// class basic_xml_oarchive - write serialized objects to a xml output stream // class basic_xml_oarchive - write serialized objects to a xml output stream
template<class Archive> template<class Archive>
class basic_xml_oarchive : class basic_xml_oarchive :
public detail::common_oarchive<Archive> public detail::common_oarchive<Archive>
{ {
protected: #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public: public:
#elif defined(BOOST_MSVC) #else
protected:
#endif
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_oarchive<Archive>; friend detail::interface_oarchive<Archive>;
friend class save_access;
#else #else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
friend class save_access;
#endif #endif
friend class save_access;
// special stuff for xml output // special stuff for xml output
unsigned int depth; unsigned int depth;
bool indent_next; bool indent_next;

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BINARY_IARCHIVE_HPP #define BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -28,43 +28,6 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
// do not derive from the classes below. If you want to extend this functionality
// via inhertance, derived from text_iarchive_impl instead. This will
// preserve correct static polymorphism.
// same as binary_iarchive below - without the shared_ptr_helper
class naked_binary_iarchive :
public binary_iarchive_impl<
boost::archive::naked_binary_iarchive,
std::istream::char_type,
std::istream::traits_type
>
{
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
>(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
>(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 // do not derive from this class. If you want to extend this functionality
// via inhertance, derived from binary_iarchive_impl instead. This will // via inhertance, derived from binary_iarchive_impl instead. This will
// preserve correct static polymorphism. // preserve correct static polymorphism.
@@ -73,9 +36,7 @@ class binary_iarchive :
boost::archive::binary_iarchive, boost::archive::binary_iarchive,
std::istream::char_type, std::istream::char_type,
std::istream::traits_type std::istream::traits_type
>, >{
public detail::shared_ptr_helper
{
public: public:
binary_iarchive(std::istream & is, unsigned int flags = 0) : binary_iarchive(std::istream & is, unsigned int flags = 0) :
binary_iarchive_impl< binary_iarchive_impl<

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP #define BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -29,6 +29,10 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_iarchive;
} // namespace detail
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
class binary_iarchive_impl : class binary_iarchive_impl :
public basic_binary_iprimitive<Archive, Elem, Tr>, public basic_binary_iprimitive<Archive, Elem, Tr>,
@@ -37,10 +41,18 @@ class binary_iarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_iarchive<Archive>;
friend basic_binary_iarchive<Archive>;
friend load_access;
#else
friend class detail::interface_iarchive<Archive>; friend class detail::interface_iarchive<Archive>;
friend class basic_binary_iarchive<Archive>; friend class basic_binary_iarchive<Archive>;
friend class load_access; friend class load_access;
protected: #endif
#endif #endif
// note: the following should not needed - but one compiler (vc 7.1) // note: the following should not needed - but one compiler (vc 7.1)
// fails to compile one test (test_shared_ptr) without it !!! // fails to compile one test (test_shared_ptr) without it !!!

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BINARY_OARCHIVE_HPP #define BOOST_ARCHIVE_BINARY_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -50,8 +50,6 @@ public:
{} {}
}; };
typedef binary_oarchive naked_binary_oarchive;
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP #define BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -30,6 +30,10 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
template<class Archive, class Elem, class Tr> template<class Archive, class Elem, class Tr>
class binary_oarchive_impl : class binary_oarchive_impl :
public basic_binary_oprimitive<Archive, Elem, Tr>, public basic_binary_oprimitive<Archive, Elem, Tr>,
@@ -38,10 +42,18 @@ class binary_oarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
friend basic_binary_oarchive<Archive>;
friend save_access;
#else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
friend class basic_binary_oarchive<Archive>; friend class basic_binary_oarchive<Archive>;
friend class save_access; friend class save_access;
protected: #endif
#endif #endif
// note: the following should not needed - but one compiler (vc 7.1) // note: the following should not needed - but one compiler (vc 7.1)
// fails to compile one test (test_shared_ptr) without it !!! // fails to compile one test (test_shared_ptr) without it !!!

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP #define BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -28,43 +28,6 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
// same as binary_wiarchive below - without the shared_ptr_helper
class naked_binary_wiarchive :
public binary_iarchive_impl<
boost::archive::naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>
{
public:
naked_binary_wiarchive(std::wistream & is, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>(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
>(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 : class binary_wiarchive :
public binary_iarchive_impl< public binary_iarchive_impl<
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type binary_wiarchive, std::wistream::char_type, std::wistream::traits_type

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP #define BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -49,8 +49,6 @@ public:
{} {}
}; };
typedef binary_woarchive naked_binary_woarchive;
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_CODECVT_NULL_HPP #define BOOST_ARCHIVE_CODECVT_NULL_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -87,6 +87,10 @@ class codecvt_null<wchar_t> : public std::codecvt<wchar_t, char, std::mbstate_t>
virtual int do_max_length( ) const throw( ){ virtual int do_max_length( ) const throw( ){
return do_encoding(); return do_encoding();
} }
public:
explicit codecvt_null(std::size_t no_locale_manage = 0) :
std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
{}
}; };
} // namespace archive } // namespace archive

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_SERIALIZER_MAP_HPP #define BOOST_ARCHIVE_SERIALIZER_MAP_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP #define BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP #define BOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP #define BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -17,15 +17,15 @@
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
// can't use this - much as I'd like to as borland doesn't support it // can't use this - much as I'd like to as borland doesn't support it
// #include <boost/scoped_ptr.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/type_traits/broken_compiler_spec.hpp>
#include <boost/serialization/tracking_enum.hpp> #include <boost/serialization/tracking_enum.hpp>
#include <boost/archive/basic_archive.hpp> #include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/decl.hpp> #include <boost/archive/detail/decl.hpp>
#include <boost/archive/detail/helper_collection.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost { namespace boost {
@@ -42,13 +42,12 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// class basic_iarchive - read serialized objects from a input stream // class basic_iarchive - read serialized objects from a input stream
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive :
private boost::noncopyable private boost::noncopyable,
public boost::archive::detail::helper_collection
{ {
friend class basic_iarchive_impl; friend class basic_iarchive_impl;
// hide implementation of this class to minimize header conclusion // hide implementation of this class to minimize header conclusion
// in client code. I couldn't used scoped pointer with borland boost::scoped_ptr<basic_iarchive_impl> pimpl;
// boost::scoped_ptr<basic_iarchive_impl> pimpl;
basic_iarchive_impl * pimpl;
virtual void vload(version_type &t) = 0; virtual void vload(version_type &t) = 0;
virtual void vload(object_id_type &t) = 0; virtual void vload(object_id_type &t) = 0;
@@ -58,12 +57,12 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive :
virtual void vload(tracking_type &t) = 0; virtual void vload(tracking_type &t) = 0;
protected: protected:
basic_iarchive(unsigned int flags); basic_iarchive(unsigned int flags);
public:
// account for bogus gcc warning // account for bogus gcc warning
#if defined(__GNUC__) #if defined(__GNUC__)
virtual virtual
#endif #endif
~basic_iarchive(); ~basic_iarchive();
public:
// note: NOT part of the public API. // note: NOT part of the public API.
void next_object_pointer(void *t); void next_object_pointer(void *t);
void register_basic_serializer( void register_basic_serializer(
@@ -99,12 +98,6 @@ public:
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_TT_BROKEN_COMPILER_SPEC(
boost::archive::detail::basic_iarchive
)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP #endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP #define BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_OARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -19,15 +19,11 @@
#include <cstddef> // NULL #include <cstddef> // NULL
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/type_traits/broken_compiler_spec.hpp>
// can't use this - much as I'd like to as borland doesn't support it
// #include <boost/scoped_ptr.hpp>
#include <boost/archive/basic_archive.hpp> #include <boost/archive/basic_archive.hpp>
#include <boost/serialization/tracking_enum.hpp> #include <boost/serialization/tracking_enum.hpp>
#include <boost/archive/detail/helper_collection.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost { namespace boost {
@@ -41,16 +37,16 @@ namespace detail {
class basic_oarchive_impl; class basic_oarchive_impl;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// class basic_oarchive - write serialized objects to an output stream // class basic_oarchive - write serialized objects to an output stream
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive :
private boost::noncopyable private boost::noncopyable,
public boost::archive::detail::helper_collection
{ {
friend class basic_oarchive_impl; friend class basic_oarchive_impl;
// hide implementation of this class to minimize header conclusion // hide implementation of this class to minimize header conclusion
// in client code. note: borland can't use scoped_ptr boost::scoped_ptr<basic_oarchive_impl> pimpl;
//boost::scoped_ptr<basic_oarchive_impl> pimpl;
basic_oarchive_impl * pimpl;
// overload these to bracket object attributes. Used to implement // overload these to bracket object attributes. Used to implement
// xml archives // xml archives
@@ -95,12 +91,6 @@ public:
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_TT_BROKEN_COMPILER_SPEC(
boost::archive::detail::basic_oarchive
)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif //BOOST_ARCHIVE_BASIC_OARCHIVE_HPP #endif //BOOST_ARCHIVE_BASIC_OARCHIVE_HPP

View File

@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP #define BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP #define BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -52,10 +52,11 @@ protected:
#endif #endif
~basic_pointer_iserializer(); ~basic_pointer_iserializer();
public: public:
virtual void * heap_allocation() const = 0;
virtual const basic_iserializer & get_basic_serializer() const = 0; virtual const basic_iserializer & get_basic_serializer() const = 0;
virtual void load_object_ptr( virtual void load_object_ptr(
basic_iarchive & ar, basic_iarchive & ar,
void * & x, void * x,
const unsigned int file_version const unsigned int file_version
) const = 0; ) const = 0;
}; };

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP #define BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_SERIALIZER_HPP #define BOOST_ARCHIVE_BASIC_SERIALIZER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_SERIALIZER_MAP_HPP #define BOOST_SERIALIZER_MAP_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_CHECK_HPP #define BOOST_ARCHIVE_DETAIL_CHECK_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#pragma inline_depth(511) #pragma inline_depth(511)
#pragma inline_recursion(on) #pragma inline_recursion(on)
@@ -50,7 +50,7 @@ namespace detail {
template<class T> template<class T>
inline void check_object_level(){ inline void check_object_level(){
typedef typedef
BOOST_DEDUCED_TYPENAME mpl::greater_equal< typename mpl::greater_equal<
serialization::implementation_level< T >, serialization::implementation_level< T >,
mpl::int_<serialization::primitive_type> mpl::int_<serialization::primitive_type>
>::type typex; >::type typex;
@@ -63,12 +63,12 @@ inline void check_object_level(){
template<class T> template<class T>
inline void check_object_versioning(){ inline void check_object_versioning(){
typedef typedef
BOOST_DEDUCED_TYPENAME mpl::or_< typename mpl::or_<
BOOST_DEDUCED_TYPENAME mpl::greater< typename mpl::greater<
serialization::implementation_level< T >, serialization::implementation_level< T >,
mpl::int_<serialization::object_serializable> mpl::int_<serialization::object_serializable>
>, >,
BOOST_DEDUCED_TYPENAME mpl::equal_to< typename mpl::equal_to<
serialization::version< T >, serialization::version< T >,
mpl::int_<0> mpl::int_<0>
> >
@@ -83,7 +83,7 @@ inline void check_object_tracking(){
// presume it has already been determined that // presume it has already been determined that
// T is not a const // T is not a const
BOOST_STATIC_ASSERT(! boost::is_const< T >::value); BOOST_STATIC_ASSERT(! boost::is_const< T >::value);
typedef BOOST_DEDUCED_TYPENAME mpl::equal_to< typedef typename mpl::equal_to<
serialization::tracking_level< T >, serialization::tracking_level< T >,
mpl::int_<serialization::track_never> mpl::int_<serialization::track_never>
>::type typex; >::type typex;
@@ -105,13 +105,13 @@ inline void check_pointer_level(){
// we should only invoke this once we KNOW that T // we should only invoke this once we KNOW that T
// has been used as a pointer!! // has been used as a pointer!!
typedef typedef
BOOST_DEDUCED_TYPENAME mpl::or_< typename mpl::or_<
BOOST_DEDUCED_TYPENAME mpl::greater< typename mpl::greater<
serialization::implementation_level< T >, serialization::implementation_level< T >,
mpl::int_<serialization::object_serializable> mpl::int_<serialization::object_serializable>
>, >,
BOOST_DEDUCED_TYPENAME mpl::not_< typename mpl::not_<
BOOST_DEDUCED_TYPENAME mpl::equal_to< typename mpl::equal_to<
serialization::tracking_level< T >, serialization::tracking_level< T >,
mpl::int_<serialization::track_selectively> mpl::int_<serialization::track_selectively>
> >
@@ -139,7 +139,7 @@ inline void check_pointer_level(){
template<class T> template<class T>
void inline check_pointer_tracking(){ void inline check_pointer_tracking(){
typedef BOOST_DEDUCED_TYPENAME mpl::greater< typedef typename mpl::greater<
serialization::tracking_level< T >, serialization::tracking_level< T >,
mpl::int_<serialization::track_never> mpl::int_<serialization::track_never>
>::type typex; >::type typex;
@@ -151,10 +151,10 @@ void inline check_pointer_tracking(){
template<class T> template<class T>
inline void check_const_loading(){ inline void check_const_loading(){
typedef typedef
BOOST_DEDUCED_TYPENAME mpl::or_< typename mpl::or_<
BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper< T >, typename boost::serialization::is_wrapper< T >,
BOOST_DEDUCED_TYPENAME mpl::not_< typename mpl::not_<
BOOST_DEDUCED_TYPENAME boost::is_const< T > typename boost::is_const< T >
> >
>::type typex; >::type typex;
// cannot load data into a "const" object unless it's a // cannot load data into a "const" object unless it's a

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP #define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP #define BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_DECL_HPP #define BOOST_ARCHIVE_DETAIL_DECL_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP #define BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP #define BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP #define BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#pragma inline_depth(511) #pragma inline_depth(511)
#pragma inline_recursion(on) #pragma inline_recursion(on)
@@ -23,7 +23,6 @@
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <new> // for placement new #include <new> // for placement new
#include <memory> // for auto_ptr
#include <cstddef> // size_t, NULL #include <cstddef> // size_t, NULL
#include <boost/config.hpp> #include <boost/config.hpp>
@@ -41,7 +40,7 @@ namespace std{
#include <boost/mpl/greater_equal.hpp> #include <boost/mpl/greater_equal.hpp>
#include <boost/mpl/equal_to.hpp> #include <boost/mpl/equal_to.hpp>
#include <boost/mpl/bool.hpp> #include <boost/mpl/bool.hpp>
#include <boost/detail/no_exceptions_support.hpp> #include <boost/core/no_exceptions_support.hpp>
#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO #ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
#include <boost/serialization/extended_type_info_typeid.hpp> #include <boost/serialization/extended_type_info_typeid.hpp>
@@ -58,14 +57,11 @@ namespace std{
#include <boost/type_traits/is_polymorphic.hpp> #include <boost/type_traits/is_polymorphic.hpp>
#include <boost/serialization/assume_abstract.hpp> #include <boost/serialization/assume_abstract.hpp>
#define DONT_USE_HAS_NEW_OPERATOR ( \ #define DONT_USE_HAS_NEW_OPERATOR ( \
defined(__BORLANDC__) \ defined(__BORLANDC__) \
|| BOOST_WORKAROUND(__IBMCPP__, < 1210) \ || BOOST_WORKAROUND(__IBMCPP__, < 1210) \
|| defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) \
|| defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \ || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
) )
#if ! DONT_USE_HAS_NEW_OPERATOR #if ! DONT_USE_HAS_NEW_OPERATOR
#include <boost/type_traits/has_new_operator.hpp> #include <boost/type_traits/has_new_operator.hpp>
#endif #endif
@@ -127,7 +123,7 @@ protected:
explicit iserializer() : explicit iserializer() :
basic_iserializer( basic_iserializer(
boost::serialization::singleton< boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME typename
boost::serialization::type_info_implementation< T >::type boost::serialization::type_info_implementation< T >::type
>::get_const_instance() >::get_const_instance()
) )
@@ -197,11 +193,109 @@ BOOST_DLLEXPORT void iserializer<Archive, T>::load_object_data(
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
#endif #endif
// the purpose of this code is to allocate memory for an object
// without requiring the constructor to be called. Presumably
// the allocated object will be subsequently initialized with
// "placement new".
// note: we have the boost type trait has_new_operator but we
// have no corresponding has_delete_operator. So we presume
// that the former being true would imply that the a delete
// operator is also defined for the class T.
template<class T>
struct heap_allocation {
// boost::has_new_operator< T > doesn't work on these compilers
#if DONT_USE_HAS_NEW_OPERATOR
// This doesn't handle operator new overload for class T
static T * invoke_new(){
return static_cast<T *>(operator new(sizeof(T)));
}
static void invoke_delete(T *t){
(operator delete(t));
}
#else
// note: we presume that a true value for has_new_operator
// implies the existence of a class specific delete operator as well
// as a class specific new operator.
struct has_new_operator {
static T * invoke_new() {
return static_cast<T *>((T::operator new)(sizeof(T)));
}
static void invoke_delete(T * t) {
// if compilation fails here, the likely cause that the class
// T has a class specific new operator but no class specific
// delete operator which matches the following signature. Fix
// your program to have this. Note that adding operator delete
// with only one parameter doesn't seem correct to me since
// the standard(3.7.4.2) says "
// "If a class T has a member deallocation function named
// 'operator delete' with exactly one parameter, then that function
// is a usual (non-placement) deallocation function" which I take
// to mean that it will call the destructor of type T which we don't
// want to do here.
// Note: reliance upon automatic conversion from T * to void * here
(T::operator delete)(t, sizeof(T));
}
};
struct doesnt_have_new_operator {
static T* invoke_new() {
return static_cast<T *>(operator new(sizeof(T)));
}
static void invoke_delete(T * t) {
// Note: I'm reliance upon automatic conversion from T * to void * here
(operator delete)(t);
}
};
static T * invoke_new() {
typedef typename
mpl::eval_if<
boost::has_new_operator< T >,
mpl::identity<has_new_operator >,
mpl::identity<doesnt_have_new_operator >
>::type typex;
return typex::invoke_new();
}
static void invoke_delete(T *t) {
typedef typename
mpl::eval_if<
boost::has_new_operator< T >,
mpl::identity<has_new_operator >,
mpl::identity<doesnt_have_new_operator >
>::type typex;
typex::invoke_delete(t);
}
#endif
explicit heap_allocation(){
m_p = invoke_new();
}
~heap_allocation(){
if (0 != m_p)
invoke_delete(m_p);
}
T* get() const {
return m_p;
}
T* release() {
T* p = m_p;
m_p = 0;
return p;
}
private:
T* m_p;
};
template<class Archive, class T> template<class Archive, class T>
class pointer_iserializer : class pointer_iserializer :
public basic_pointer_iserializer public basic_pointer_iserializer
{ {
private: private:
virtual void * heap_allocation() const {
detail::heap_allocation<T> h;
T * t = h.get();
h.release();
return t;
}
virtual const basic_iserializer & get_basic_serializer() const { virtual const basic_iserializer & get_basic_serializer() const {
return boost::serialization::singleton< return boost::serialization::singleton<
iserializer<Archive, T> iserializer<Archive, T>
@@ -209,7 +303,7 @@ private:
} }
BOOST_DLLEXPORT virtual void load_object_ptr( BOOST_DLLEXPORT virtual void load_object_ptr(
basic_iarchive & ar, basic_iarchive & ar,
void * & x, void * x,
const unsigned int file_version const unsigned int file_version
) const BOOST_USED; ) const BOOST_USED;
protected: protected:
@@ -222,121 +316,50 @@ protected:
# pragma warning(pop) # pragma warning(pop)
#endif #endif
// note trick to be sure that operator new is using class specific
// version if such exists. Due to Peter Dimov.
// note: the following fails if T has no default constructor.
// otherwise it would have been ideal
//struct heap_allocator : public T
//{
// T * invoke(){
// return ::new(sizeof(T));
// }
//}
template<class T>
struct heap_allocator
{
// boost::has_new_operator< T > doesn't work on these compilers
#if DONT_USE_HAS_NEW_OPERATOR
// This doesn't handle operator new overload for class T
static T * invoke(){
return static_cast<T *>(operator new(sizeof(T)));
}
#else
struct has_new_operator {
static T* invoke() {
return static_cast<T *>((T::operator new)(sizeof(T)));
}
};
struct doesnt_have_new_operator {
static T* invoke() {
return static_cast<T *>(operator new(sizeof(T)));
}
};
static T * invoke() {
typedef BOOST_DEDUCED_TYPENAME
mpl::eval_if<
boost::has_new_operator< T >,
mpl::identity<has_new_operator >,
mpl::identity<doesnt_have_new_operator >
>::type typex;
return typex::invoke();
}
#endif
};
// due to Martin Ecker
template <typename T>
class auto_ptr_with_deleter
{
public:
explicit auto_ptr_with_deleter(T* p) :
m_p(p)
{}
~auto_ptr_with_deleter(){
if (m_p)
boost::serialization::access::destroy(m_p);
}
T* get() const {
return m_p;
}
T* release() {
T* p = m_p;
m_p = NULL;
return p;
}
private:
T* m_p;
};
// note: BOOST_DLLEXPORT is so that code for polymorphic class // note: BOOST_DLLEXPORT is so that code for polymorphic class
// serialized only through base class won't get optimized out // serialized only through base class won't get optimized out
template<class Archive, class T> template<class Archive, class T>
BOOST_DLLEXPORT void pointer_iserializer<Archive, T>::load_object_ptr( BOOST_DLLEXPORT void pointer_iserializer<Archive, T>::load_object_ptr(
basic_iarchive & ar, basic_iarchive & ar,
void * & x, void * t,
const unsigned int file_version const unsigned int file_version
) const ) const
{ {
Archive & ar_impl = Archive & ar_impl =
boost::serialization::smart_cast_reference<Archive &>(ar); boost::serialization::smart_cast_reference<Archive &>(ar);
auto_ptr_with_deleter< T > ap(heap_allocator< T >::invoke()); // note that the above will throw std::bad_alloc if the allocation
if(NULL == ap.get()) // fails so we don't have to address this contingency here.
boost::serialization::throw_exception(std::bad_alloc()) ;
T * t = ap.get();
x = t;
// catch exception during load_construct_data so that we don't // catch exception during load_construct_data so that we don't
// automatically delete the t which is most likely not fully // automatically delete the t which is most likely not fully
// constructed // constructed
BOOST_TRY { BOOST_TRY {
// this addresses an obscure situtation that occurs when // this addresses an obscure situation that occurs when
// load_constructor de-serializes something through a pointer. // load_constructor de-serializes something through a pointer.
ar.next_object_pointer(t); ar.next_object_pointer(t);
boost::serialization::load_construct_data_adl<Archive, T>( boost::serialization::load_construct_data_adl<Archive, T>(
ar_impl, ar_impl,
t, static_cast<T *>(t),
file_version file_version
); );
} }
BOOST_CATCH(...){ BOOST_CATCH(...){
ap.release(); // if we get here the load_construct failed. The heap_allocation
// will be automatically deleted so we don't have to do anything
// special here.
BOOST_RETHROW; BOOST_RETHROW;
} }
BOOST_CATCH_END BOOST_CATCH_END
ar_impl >> boost::serialization::make_nvp(NULL, * t); ar_impl >> boost::serialization::make_nvp(NULL, * static_cast<T *>(t));
ap.release();
} }
template<class Archive, class T> template<class Archive, class T>
pointer_iserializer<Archive, T>::pointer_iserializer() : pointer_iserializer<Archive, T>::pointer_iserializer() :
basic_pointer_iserializer( basic_pointer_iserializer(
boost::serialization::singleton< boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME typename
boost::serialization::type_info_implementation< T >::type boost::serialization::type_info_implementation< T >::type
>::get_const_instance() >::get_const_instance()
) )
@@ -405,7 +428,7 @@ struct load_non_pointer_type {
template<class T> template<class T>
static void invoke(Archive & ar, T &t){ static void invoke(Archive & ar, T &t){
typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< typedef typename mpl::eval_if<
// if its primitive // if its primitive
mpl::equal_to< mpl::equal_to<
boost::serialization::implementation_level< T >, boost::serialization::implementation_level< T >,
@@ -413,7 +436,7 @@ struct load_non_pointer_type {
>, >,
mpl::identity<load_primitive>, mpl::identity<load_primitive>,
// else // else
BOOST_DEDUCED_TYPENAME mpl::eval_if< typename mpl::eval_if<
// class info / version // class info / version
mpl::greater_equal< mpl::greater_equal<
boost::serialization::implementation_level< T >, boost::serialization::implementation_level< T >,
@@ -422,7 +445,7 @@ struct load_non_pointer_type {
// do standard load // do standard load
mpl::identity<load_standard>, mpl::identity<load_standard>,
// else // else
BOOST_DEDUCED_TYPENAME mpl::eval_if< typename mpl::eval_if<
// no tracking // no tracking
mpl::equal_to< mpl::equal_to<
boost::serialization::tracking_level< T >, boost::serialization::tracking_level< T >,
@@ -466,7 +489,7 @@ struct load_pointer_type {
// class pointer. Inhibiting code generation for this // class pointer. Inhibiting code generation for this
// permits abstract base classes to be used - note: exception // permits abstract base classes to be used - note: exception
// virtual serialize functions used for plug-ins // virtual serialize functions used for plug-ins
typedef BOOST_DEDUCED_TYPENAME typedef typename
mpl::eval_if< mpl::eval_if<
boost::serialization::is_abstract<const T>, boost::serialization::is_abstract<const T>,
boost::mpl::identity<abstract>, boost::mpl::identity<abstract>,
@@ -482,18 +505,21 @@ struct load_pointer_type {
const T & const T &
) { ) {
// tweak the pointer back to the base class // tweak the pointer back to the base class
return static_cast<T *>( void * upcast = const_cast<void *>(
const_cast<void *>(
boost::serialization::void_upcast( boost::serialization::void_upcast(
eti, eti,
boost::serialization::singleton< boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME typename
boost::serialization::type_info_implementation< T >::type boost::serialization::type_info_implementation< T >::type
>::get_const_instance(), >::get_const_instance(),
t t
) )
)
); );
if(NULL == upcast)
boost::serialization::throw_exception(
archive_exception(archive_exception::unregistered_class)
);
return static_cast<T *>(upcast);
} }
template<class T> template<class T>
@@ -544,7 +570,7 @@ template<class Archive>
struct load_array_type { struct load_array_type {
template<class T> template<class T>
static void invoke(Archive &ar, T &t){ static void invoke(Archive &ar, T &t){
typedef BOOST_DEDUCED_TYPENAME remove_extent< T >::type value_type; typedef typename remove_extent< T >::type value_type;
// convert integers to correct enum to load // convert integers to correct enum to load
// determine number of elements in the array. Consider the // determine number of elements in the array. Consider the
@@ -576,13 +602,13 @@ inline void load(Archive & ar, T &t){
// handled below. // handled below.
detail::check_const_loading< T >(); detail::check_const_loading< T >();
typedef typedef
BOOST_DEDUCED_TYPENAME mpl::eval_if<is_pointer< T >, typename mpl::eval_if<is_pointer< T >,
mpl::identity<detail::load_pointer_type<Archive> > mpl::identity<detail::load_pointer_type<Archive> >
,//else ,//else
BOOST_DEDUCED_TYPENAME mpl::eval_if<is_array< T >, typename mpl::eval_if<is_array< T >,
mpl::identity<detail::load_array_type<Archive> > mpl::identity<detail::load_array_type<Archive> >
,//else ,//else
BOOST_DEDUCED_TYPENAME mpl::eval_if<is_enum< T >, typename mpl::eval_if<is_enum< T >,
mpl::identity<detail::load_enum_type<Archive> > mpl::identity<detail::load_enum_type<Archive> >
,//else ,//else
mpl::identity<detail::load_non_pointer_type<Archive> > mpl::identity<detail::load_non_pointer_type<Archive> >

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_OSERIALIZER_HPP #define BOOST_ARCHIVE_OSERIALIZER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#pragma inline_depth(511) #pragma inline_depth(511)
#pragma inline_recursion(on) #pragma inline_recursion(on)
@@ -106,7 +106,7 @@ public:
explicit BOOST_DLLEXPORT oserializer() : explicit BOOST_DLLEXPORT oserializer() :
basic_oserializer( basic_oserializer(
boost::serialization::singleton< boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME typename
boost::serialization::type_info_implementation< T >::type boost::serialization::type_info_implementation< T >::type
>::get_const_instance() >::get_const_instance()
) )
@@ -205,7 +205,7 @@ template<class Archive, class T>
pointer_oserializer<Archive, T>::pointer_oserializer() : pointer_oserializer<Archive, T>::pointer_oserializer() :
basic_pointer_oserializer( basic_pointer_oserializer(
boost::serialization::singleton< boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME typename
boost::serialization::type_info_implementation< T >::type boost::serialization::type_info_implementation< T >::type
>::get_const_instance() >::get_const_instance()
) )
@@ -275,7 +275,7 @@ struct save_non_pointer_type {
template<class T> template<class T>
static void invoke(Archive & ar, const T & t){ static void invoke(Archive & ar, const T & t){
typedef typedef
BOOST_DEDUCED_TYPENAME mpl::eval_if< typename mpl::eval_if<
// if its primitive // if its primitive
mpl::equal_to< mpl::equal_to<
boost::serialization::implementation_level< T >, boost::serialization::implementation_level< T >,
@@ -283,7 +283,7 @@ struct save_non_pointer_type {
>, >,
mpl::identity<save_primitive>, mpl::identity<save_primitive>,
// else // else
BOOST_DEDUCED_TYPENAME mpl::eval_if< typename mpl::eval_if<
// class info / version // class info / version
mpl::greater_equal< mpl::greater_equal<
boost::serialization::implementation_level< T >, boost::serialization::implementation_level< T >,
@@ -292,7 +292,7 @@ struct save_non_pointer_type {
// do standard save // do standard save
mpl::identity<save_standard>, mpl::identity<save_standard>,
// else // else
BOOST_DEDUCED_TYPENAME mpl::eval_if< typename mpl::eval_if<
// no tracking // no tracking
mpl::equal_to< mpl::equal_to<
boost::serialization::tracking_level< T >, boost::serialization::tracking_level< T >,
@@ -342,7 +342,7 @@ struct save_pointer_type {
// permits abstract base classes to be used - note: exception // permits abstract base classes to be used - note: exception
// virtual serialize functions used for plug-ins // virtual serialize functions used for plug-ins
typedef typedef
BOOST_DEDUCED_TYPENAME mpl::eval_if< typename mpl::eval_if<
boost::serialization::is_abstract< T >, boost::serialization::is_abstract< T >,
mpl::identity<abstract>, mpl::identity<abstract>,
mpl::identity<non_abstract> mpl::identity<non_abstract>
@@ -373,10 +373,10 @@ struct save_pointer_type {
Archive &ar, Archive &ar,
T & t T & t
){ ){
BOOST_DEDUCED_TYPENAME typename
boost::serialization::type_info_implementation< T >::type const boost::serialization::type_info_implementation< T >::type const
& i = boost::serialization::singleton< & i = boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME typename
boost::serialization::type_info_implementation< T >::type boost::serialization::type_info_implementation< T >::type
>::get_const_instance(); >::get_const_instance();
@@ -452,7 +452,7 @@ struct save_pointer_type {
){ ){
check_pointer_level< T >(); check_pointer_level< T >();
check_pointer_tracking< T >(); check_pointer_tracking< T >();
typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< typedef typename mpl::eval_if<
is_polymorphic< T >, is_polymorphic< T >,
mpl::identity<polymorphic>, mpl::identity<polymorphic>,
mpl::identity<non_polymorphic> mpl::identity<non_polymorphic>
@@ -490,7 +490,7 @@ struct save_array_type
{ {
template<class T> template<class T>
static void invoke(Archive &ar, const T &t){ static void invoke(Archive &ar, const T &t){
typedef BOOST_DEDUCED_TYPENAME boost::remove_extent< T >::type value_type; typedef typename boost::remove_extent< T >::type value_type;
save_access::end_preamble(ar); save_access::end_preamble(ar);
// consider alignment // consider alignment
@@ -509,13 +509,13 @@ struct save_array_type
template<class Archive, class T> template<class Archive, class T>
inline void save(Archive & ar, /*const*/ T &t){ inline void save(Archive & ar, /*const*/ T &t){
typedef typedef
BOOST_DEDUCED_TYPENAME mpl::eval_if<is_pointer< T >, typename mpl::eval_if<is_pointer< T >,
mpl::identity<detail::save_pointer_type<Archive> >, mpl::identity<detail::save_pointer_type<Archive> >,
//else //else
BOOST_DEDUCED_TYPENAME mpl::eval_if<is_enum< T >, typename mpl::eval_if<is_enum< T >,
mpl::identity<detail::save_enum_type<Archive> >, mpl::identity<detail::save_enum_type<Archive> >,
//else //else
BOOST_DEDUCED_TYPENAME mpl::eval_if<is_array< T >, typename mpl::eval_if<is_array< T >,
mpl::identity<detail::save_array_type<Archive> >, mpl::identity<detail::save_array_type<Archive> >,
//else //else
mpl::identity<detail::save_non_pointer_type<Archive> > mpl::identity<detail::save_non_pointer_type<Archive> >

View File

@@ -28,7 +28,7 @@ struct _ptr_serialization_support
typedef int type; typedef int type;
}; };
#ifdef __SUNPRO_CC #if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5130)
template<int N> template<int N>
struct counter : counter<N-1> {}; struct counter : counter<N-1> {};
@@ -81,7 +81,7 @@ void instantiate_ptr_serialization(Serializable*, int, adl_tag ) {}
namespace boost { namespace archive { namespace detail { \ namespace boost { namespace archive { namespace detail { \
\ \
template <class Serializable> \ template <class Serializable> \
BOOST_DEDUCED_TYPENAME _ptr_serialization_support<Archive, Serializable>::type \ typename _ptr_serialization_support<Archive, Serializable>::type \
instantiate_ptr_serialization( Serializable*, Archive*, adl_tag ); \ instantiate_ptr_serialization( Serializable*, Archive*, adl_tag ); \
\ \
}}} }}}

View File

@@ -7,15 +7,17 @@
#ifndef BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP #ifndef BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP
#define BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP #define BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP
#define BOOST_UTF8_BEGIN_NAMESPACE \ #ifdef BOOST_NO_CXX11_HDR_CODECVT
#define BOOST_UTF8_BEGIN_NAMESPACE \
namespace boost { namespace archive { namespace detail { namespace boost { namespace archive { namespace detail {
#define BOOST_UTF8_DECL #define BOOST_UTF8_DECL
#define BOOST_UTF8_END_NAMESPACE }}} #define BOOST_UTF8_END_NAMESPACE }}}
#include <boost/detail/utf8_codecvt_facet.hpp> #include <boost/detail/utf8_codecvt_facet.hpp>
#undef BOOST_UTF8_END_NAMESPACE
#undef BOOST_UTF8_DECL
#undef BOOST_UTF8_BEGIN_NAMESPACE
#undef BOOST_UTF8_END_NAMESPACE
#undef BOOST_UTF8_DECL
#undef BOOST_UTF8_BEGIN_NAMESPACE
#endif // BOOST_NO_CXX11_HDR_CODECVT
#endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP #endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_DINKUMWARE_HPP #define BOOST_ARCHIVE_DINKUMWARE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -12,7 +12,7 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::memcpy; using ::memcpy;
@@ -51,7 +51,9 @@ BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
basic_binary_iarchive<Archive>::init(){ basic_binary_iarchive<Archive>::init(){
// read signature in an archive version independent manner // read signature in an archive version independent manner
std::string file_signature; std::string file_signature;
try {
#if 0 // commented out since it interfers with derivation
BOOST_TRY {
std::size_t l; std::size_t l;
this->This()->load(l); this->This()->load(l);
if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) { if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) {
@@ -65,10 +67,16 @@ basic_binary_iarchive<Archive>::init(){
this->This()->load_binary(&(*file_signature.begin()), l); this->This()->load_binary(&(*file_signature.begin()), l);
} }
} }
catch(archive_exception const &) { // catch stream_error archive exceptions BOOST_CATCH(archive_exception const &) { // catch stream_error archive exceptions
// will cause invalid_signature archive exception to be thrown below // will cause invalid_signature archive exception to be thrown below
file_signature = ""; file_signature = "";
} }
BOOST_CATCH_END
#else
// https://svn.boost.org/trac/boost/ticket/7301
* this->This() >> file_signature;
#endif
if(file_signature != BOOST_ARCHIVE_SIGNATURE()) if(file_signature != BOOST_ARCHIVE_SIGNATURE())
boost::serialization::throw_exception( boost::serialization::throw_exception(
archive_exception(archive_exception::invalid_signature) archive_exception(archive_exception::invalid_signature)
@@ -113,10 +121,7 @@ basic_binary_iarchive<Archive>::init(){
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
this->set_library_version(input_library_version); this->set_library_version(input_library_version);
#else #else
#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200) detail::basic_iarchive::set_library_version(input_library_version);
detail::
#endif
basic_iarchive::set_library_version(input_library_version);
#endif #endif
if(BOOST_ARCHIVE_VERSION() < input_library_version) if(BOOST_ARCHIVE_VERSION() < input_library_version)

View File

@@ -23,11 +23,12 @@ namespace std{
#include <boost/detail/workaround.hpp> // fixup for RogueWave #include <boost/detail/workaround.hpp> // fixup for RogueWave
#include <boost/serialization/throw_exception.hpp> #include <boost/serialization/throw_exception.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/archive/archive_exception.hpp> #include <boost/archive/archive_exception.hpp>
#include <boost/archive/codecvt_null.hpp> #include <boost/archive/codecvt_null.hpp>
#include <boost/archive/add_facet.hpp> #include <boost/archive/add_facet.hpp>
#include <boost/archive/basic_binary_iprimitive.hpp>
namespace boost { namespace boost {
namespace archive { namespace archive {
@@ -151,17 +152,16 @@ basic_binary_iprimitive<Archive, Elem, Tr>::basic_binary_iprimitive(
) : ) :
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
m_sb(sb), m_sb(sb),
archive_locale(NULL),
locale_saver(m_sb) locale_saver(m_sb)
{ {
if(! no_codecvt){ if(! no_codecvt){
archive_locale.reset( archive_locale.reset(
boost::archive::add_facet( add_facet(
std::locale::classic(), std::locale::classic(),
new codecvt_null<Elem> new codecvt_null<Elem>
) )
); );
m_sb.pubimbue(* archive_locale); //m_sb.pubimbue(* archive_locale);
} }
} }
#else #else
@@ -198,11 +198,12 @@ BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_binary_iprimitive<Archive, Elem, Tr>::~basic_binary_iprimitive(){ basic_binary_iprimitive<Archive, Elem, Tr>::~basic_binary_iprimitive(){
// push back unread characters // push back unread characters
//destructor can't throw ! //destructor can't throw !
try{ BOOST_TRY{
static_cast<detail::input_streambuf_access<Elem, Tr> &>(m_sb).sync(); static_cast<detail::input_streambuf_access<Elem, Tr> &>(m_sb).sync();
} }
catch(...){ BOOST_CATCH(...){
} }
BOOST_CATCH_END
} }
} // namespace archive } // namespace archive

View File

@@ -12,7 +12,7 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::memcpy; using ::memcpy;

View File

@@ -31,6 +31,8 @@ namespace std{ using ::wcslen; }
#include <boost/archive/add_facet.hpp> #include <boost/archive/add_facet.hpp>
#include <boost/archive/codecvt_null.hpp> #include <boost/archive/codecvt_null.hpp>
#include <boost/archive/basic_binary_oprimitive.hpp>
#include <boost/core/no_exceptions_support.hpp>
namespace boost { namespace boost {
namespace archive { namespace archive {
@@ -102,7 +104,6 @@ basic_binary_oprimitive<Archive, Elem, Tr>::basic_binary_oprimitive(
) : ) :
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
m_sb(sb), m_sb(sb),
archive_locale(NULL),
locale_saver(m_sb) locale_saver(m_sb)
{ {
if(! no_codecvt){ if(! no_codecvt){
@@ -112,7 +113,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::basic_binary_oprimitive(
new codecvt_null<Elem> new codecvt_null<Elem>
) )
); );
m_sb.pubimbue(* archive_locale); //m_sb.pubimbue(* archive_locale);
} }
} }
#else #else
@@ -149,11 +150,12 @@ BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_binary_oprimitive<Archive, Elem, Tr>::~basic_binary_oprimitive(){ basic_binary_oprimitive<Archive, Elem, Tr>::~basic_binary_oprimitive(){
// flush buffer // flush buffer
//destructor can't throw //destructor can't throw
try{ BOOST_TRY{
static_cast<detail::output_streambuf_access<Elem, Tr> &>(m_sb).sync(); static_cast<detail::output_streambuf_access<Elem, Tr> &>(m_sb).sync();
} }
catch(...){ BOOST_CATCH(...){
} }
BOOST_CATCH_END
} }
} // namespace archive } // namespace archive

View File

@@ -11,7 +11,7 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::memcpy; using ::memcpy;
@@ -62,10 +62,7 @@ basic_text_iarchive<Archive>::init(void){
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
this->set_library_version(input_library_version); this->set_library_version(input_library_version);
#else #else
#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200) detail::basic_iarchive::set_library_version(input_library_version);
detail::
#endif
basic_iarchive::set_library_version(input_library_version);
#endif #endif
// extra little .t is to get around borland quirk // extra little .t is to get around borland quirk

View File

@@ -33,22 +33,22 @@ namespace std{
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace { namespace detail {
template<class CharType> template<class CharType>
bool is_whitespace(CharType c); static inline bool is_whitespace(CharType c);
template<> template<>
bool is_whitespace(char t){ inline bool is_whitespace(char t){
return 0 != std::isspace(t); return 0 != std::isspace(t);
} }
#ifndef BOOST_NO_CWCHAR #ifndef BOOST_NO_CWCHAR
template<> template<>
bool is_whitespace(wchar_t t){ inline bool is_whitespace(wchar_t t){
return 0 != std::iswspace(t); return 0 != std::iswspace(t);
} }
#endif #endif
} } // detail
// translate base64 text into binary and copy into buffer // translate base64 text into binary and copy into buffer
// until buffer is full. // until buffer is full.
@@ -58,7 +58,7 @@ basic_text_iprimitive<IStream>::load_binary(
void *address, void *address,
std::size_t count std::size_t count
){ ){
typedef BOOST_DEDUCED_TYPENAME IStream::char_type CharType; typedef typename IStream::char_type CharType;
if(0 == count) if(0 == count)
return; return;
@@ -73,7 +73,7 @@ basic_text_iprimitive<IStream>::load_binary(
archive_exception(archive_exception::input_stream_error) archive_exception(archive_exception::input_stream_error)
); );
// convert from base64 to binary // convert from base64 to binary
typedef BOOST_DEDUCED_TYPENAME typedef typename
iterators::transform_width< iterators::transform_width<
iterators::binary_from_base64< iterators::binary_from_base64<
iterators::remove_whitespace< iterators::remove_whitespace<
@@ -102,11 +102,11 @@ basic_text_iprimitive<IStream>::load_binary(
// skip over any excess input // skip over any excess input
for(;;){ for(;;){
BOOST_DEDUCED_TYPENAME IStream::int_type r; typename IStream::int_type r;
r = is.get(); r = is.get();
if(is.eof()) if(is.eof())
break; break;
if(is_whitespace(static_cast<CharType>(r))) if(detail::is_whitespace(static_cast<CharType>(r)))
break; break;
} }
} }
@@ -121,17 +121,16 @@ basic_text_iprimitive<IStream>::basic_text_iprimitive(
is(is_), is(is_),
flags_saver(is_), flags_saver(is_),
precision_saver(is_), precision_saver(is_),
archive_locale(NULL),
locale_saver(* is_.rdbuf()) locale_saver(* is_.rdbuf())
{ {
if(! no_codecvt){ if(! no_codecvt){
archive_locale.reset( archive_locale.reset(
add_facet( add_facet(
std::locale::classic(), std::locale::classic(),
new codecvt_null<BOOST_DEDUCED_TYPENAME IStream::char_type> new boost::archive::codecvt_null<typename IStream::char_type>
) )
); );
is.imbue(* archive_locale); //is.imbue(* archive_locale);
} }
is >> std::noboolalpha; is >> std::noboolalpha;
} }

View File

@@ -11,7 +11,7 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <cstring> #include <cstring>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::memcpy; using ::memcpy;

View File

@@ -9,6 +9,7 @@
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // NULL #include <cstddef> // NULL
#include <algorithm> // std::copy
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/archive/basic_text_oprimitive.hpp> #include <boost/archive/basic_text_oprimitive.hpp>
@@ -30,7 +31,7 @@ basic_text_oprimitive<OStream>::save_binary(
const void *address, const void *address,
std::size_t count std::size_t count
){ ){
typedef BOOST_DEDUCED_TYPENAME OStream::char_type CharType; typedef typename OStream::char_type CharType;
if(0 == count) if(0 == count)
return; return;
@@ -83,17 +84,16 @@ basic_text_oprimitive<OStream>::basic_text_oprimitive(
os(os_), os(os_),
flags_saver(os_), flags_saver(os_),
precision_saver(os_), precision_saver(os_),
archive_locale(NULL),
locale_saver(* os_.rdbuf()) locale_saver(* os_.rdbuf())
{ {
if(! no_codecvt){ if(! no_codecvt){
archive_locale.reset( archive_locale.reset(
add_facet( add_facet(
std::locale::classic(), std::locale::classic(),
new codecvt_null<BOOST_DEDUCED_TYPENAME OStream::char_type> new boost::archive::codecvt_null<typename OStream::char_type>
) )
); );
os.imbue(* archive_locale); //os.imbue(* archive_locale);
} }
os << std::noboolalpha; os << std::noboolalpha;
} }

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP #define BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -50,11 +50,6 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
// supress noise
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
# pragma warning (disable : 4786) // too long name, harmless warning
#endif
#include <boost/spirit/include/classic_rule.hpp> #include <boost/spirit/include/classic_rule.hpp>
#include <boost/spirit/include/classic_chset.hpp> #include <boost/spirit/include/classic_chset.hpp>

View File

@@ -20,7 +20,7 @@ namespace std{
#include <boost/archive/basic_xml_archive.hpp> #include <boost/archive/basic_xml_archive.hpp>
#include <boost/archive/basic_xml_oarchive.hpp> #include <boost/archive/basic_xml_oarchive.hpp>
#include <boost/archive/xml_archive_exception.hpp> #include <boost/archive/xml_archive_exception.hpp>
#include <boost/detail/no_exceptions_support.hpp> #include <boost/core/no_exceptions_support.hpp>
namespace boost { namespace boost {
namespace archive { namespace archive {

View File

@@ -31,7 +31,7 @@ namespace std{
#include <boost/archive/dinkumware.hpp> #include <boost/archive/dinkumware.hpp>
#endif #endif
#include <boost/detail/no_exceptions_support.hpp> #include <boost/core/no_exceptions_support.hpp>
#include <boost/archive/xml_archive_exception.hpp> #include <boost/archive/xml_archive_exception.hpp>
#include <boost/archive/iterators/dataflow_exception.hpp> #include <boost/archive/iterators/dataflow_exception.hpp>
@@ -98,9 +98,9 @@ xml_iarchive_impl<Archive>::load(wchar_t * ws){
const char * end = start + s.size(); const char * end = start + s.size();
while(start < end){ while(start < end){
wchar_t wc; wchar_t wc;
int result = std::mbtowc(&wc, start, end - start); int length = std::mbtowc(&wc, start, end - start);
if(0 < result){ if(0 < length){
start += result; start += length;
*ws++ = wc; *ws++ = wc;
continue; continue;
} }
@@ -174,18 +174,8 @@ xml_iarchive_impl<Archive>::xml_iarchive_impl(
basic_xml_iarchive<Archive>(flags), basic_xml_iarchive<Archive>(flags),
gimpl(new xml_grammar()) gimpl(new xml_grammar())
{ {
if(0 == (flags & no_header)){ if(0 == (flags & no_header))
BOOST_TRY{
init(); init();
}
BOOST_CATCH(...){
delete gimpl;
#ifndef BOOST_NO_EXCEPTIONS
throw; // re-throw
#endif
}
BOOST_CATCH_END
}
} }
template<class Archive> template<class Archive>
@@ -198,7 +188,6 @@ xml_iarchive_impl<Archive>::~xml_iarchive_impl(){
BOOST_CATCH(...){} BOOST_CATCH(...){}
BOOST_CATCH_END BOOST_CATCH_END
} }
delete gimpl;
} }
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost

View File

@@ -8,7 +8,7 @@
#include <ostream> #include <ostream>
#include <iomanip> #include <iomanip>
#include <algorithm> #include <algorithm> // std::copy
#include <string> #include <string>
#include <cstring> // strlen #include <cstring> // strlen

View File

@@ -1,5 +1,5 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// xml_wiprimitive.cpp: // xml_wiarchive_impl.ipp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0. (See
@@ -8,8 +8,6 @@
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
#include <cstring> #include <cstring>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
@@ -21,7 +19,7 @@ namespace std{
#ifndef BOOST_NO_STD_WSTREAMBUF #ifndef BOOST_NO_STD_WSTREAMBUF
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <algorithm> #include <algorithm> // std::copy
#include <boost/detail/workaround.hpp> // Dinkumware and RogueWave #include <boost/detail/workaround.hpp> // Dinkumware and RogueWave
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
@@ -29,19 +27,18 @@ namespace std{
#endif #endif
#include <boost/io/ios_state.hpp> #include <boost/io/ios_state.hpp>
#include <boost/detail/no_exceptions_support.hpp> #include <boost/core/no_exceptions_support.hpp>
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/serialization/string.hpp> #include <boost/serialization/string.hpp>
#include <boost/archive/add_facet.hpp>
#include <boost/archive/xml_archive_exception.hpp>
#include <boost/archive/detail/utf8_codecvt_facet.hpp>
#include <boost/archive/iterators/mb_from_wchar.hpp>
#include <boost/archive/basic_xml_archive.hpp> #include <boost/archive/basic_xml_archive.hpp>
#include <boost/archive/xml_wiarchive.hpp> #include <boost/archive/xml_wiarchive.hpp>
#include <boost/archive/add_facet.hpp>
#include <boost/archive/xml_archive_exception.hpp>
#include <boost/archive/iterators/mb_from_wchar.hpp>
#include "basic_xml_grammar.hpp" #include "basic_xml_grammar.hpp"
namespace boost { namespace boost {
@@ -165,26 +162,18 @@ xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
gimpl(new xml_wgrammar()) gimpl(new xml_wgrammar())
{ {
if(0 == (flags & no_codecvt)){ if(0 == (flags & no_codecvt)){
// note usage of argument "1" so that the locale isn't
// automatically delete the facet
archive_locale.reset( archive_locale.reset(
add_facet( add_facet(
std::locale::classic(), is_.getloc(),
new boost::archive::detail::utf8_codecvt_facet new boost::archive::detail::utf8_codecvt_facet
) )
); );
is.imbue(* archive_locale); //is.imbue(* archive_locale);
}
if(0 == (flags & no_header)){
BOOST_TRY{
this->init();
}
BOOST_CATCH(...){
delete gimpl;
#ifndef BOOST_NO_EXCEPTIONS
throw; // re-throw
#endif
}
BOOST_CATCH_END
} }
if(0 == (flags & no_header))
init();
} }
template<class Archive> template<class Archive>
@@ -197,7 +186,6 @@ xml_wiarchive_impl<Archive>::~xml_wiarchive_impl(){
BOOST_CATCH(...){} BOOST_CATCH(...){}
BOOST_CATCH_END BOOST_CATCH_END
} }
delete gimpl;
} }
} // namespace archive } // namespace archive

View File

@@ -11,15 +11,14 @@
#include <ostream> #include <ostream>
#include <string> #include <string>
#include <algorithm> #include <algorithm> // std::copy
#include <locale> #include <locale>
#include <boost/config.hpp> // msvc 6.0 needs this to suppress warnings
// for BOOST_DEDUCED_TYPENAME
#include <cstring> // strlen #include <cstring> // strlen
#include <cstdlib> // mbtowc #include <cstdlib> // mbtowc
#include <cwchar> // wcslen #include <cwchar> // wcslen
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::strlen; using ::strlen;
@@ -30,8 +29,8 @@ namespace std{
} // namespace std } // namespace std
#endif #endif
#include <boost/archive/xml_woarchive.hpp>
#include <boost/serialization/throw_exception.hpp> #include <boost/serialization/throw_exception.hpp>
#include <boost/serialization/pfto.hpp>
#include <boost/archive/iterators/xml_escape.hpp> #include <boost/archive/iterators/xml_escape.hpp>
#include <boost/archive/iterators/wchar_from_mb.hpp> #include <boost/archive/iterators/wchar_from_mb.hpp>
@@ -39,7 +38,6 @@ namespace std{
#include <boost/archive/iterators/dataflow_exception.hpp> #include <boost/archive/iterators/dataflow_exception.hpp>
#include <boost/archive/add_facet.hpp> #include <boost/archive/add_facet.hpp>
#include <boost/archive/detail/utf8_codecvt_facet.hpp>
namespace boost { namespace boost {
namespace archive { namespace archive {
@@ -128,32 +126,25 @@ xml_woarchive_impl<Archive>::xml_woarchive_impl(
// a) before output is invoked or // a) before output is invoked or
// b) after flush has been called. This prevents one-to-many // b) after flush has been called. This prevents one-to-many
// transforms (such as one to many transforms from getting // transforms (such as one to many transforms from getting
// mixed up. Unfortunately, STLPort doesn't respect b) above // mixed up.
// so the restoration of the original archive locale done by
// the locale_saver doesn't get processed,
// before the current one is destroyed.
// so the codecvt doesn't get replaced with the orginal
// so closing the stream invokes codecvt::do_unshift
// so it crashes because the corresponding locale that contained
// the codecvt isn't around any more.
// we can hack around this by using a static codecvt that never
// gets destroyed.
if(0 == (flags & no_codecvt)){ if(0 == (flags & no_codecvt)){
boost::archive::detail::utf8_codecvt_facet *pfacet; archive_locale.reset(
#if defined(__SGI_STL_PORT) add_facet(
static boost::archive::detail::utf8_codecvt_facet os_.getloc(),
facet(static_cast<size_t>(1)); new boost::archive::detail::utf8_codecvt_facet
pfacet = & facet; )
#else );
pfacet = new boost::archive::detail::utf8_codecvt_facet; //os.imbue(* archive_locale);
#endif
archive_locale.reset(add_facet(std::locale::classic(), pfacet));
os.imbue(* archive_locale);
} }
if(0 == (flags & no_header)) if(0 == (flags & no_header))
this->init(); this->init();
} }
template<class Archive>
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
xml_woarchive_impl<Archive>::~xml_woarchive_impl(){
}
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP #define BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -19,7 +19,6 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <cstddef> // size_t #include <cstddef> // size_t
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::size_t; using ::size_t;
@@ -57,7 +56,7 @@ struct from_6_bit {
} // namespace detail } // namespace detail
// note: what we would like to do is // note: what we would like to do is
// template<class Base, class CharType = BOOST_DEDUCED_TYPENAME Base::value_type> // template<class Base, class CharType = typename Base::value_type>
// typedef transform_iterator< // typedef transform_iterator<
// from_6_bit<CharType>, // from_6_bit<CharType>,
// transform_width<Base, 6, sizeof(Base::value_type) * 8, CharType> // transform_width<Base, 6, sizeof(Base::value_type) * 8, CharType>
@@ -69,10 +68,10 @@ struct from_6_bit {
// a templated constructor. This makes it incompatible with the dataflow // a templated constructor. This makes it incompatible with the dataflow
// ideal. This is also addressed here. // ideal. This is also addressed here.
//template<class Base, class CharType = BOOST_DEDUCED_TYPENAME Base::value_type> //template<class Base, class CharType = typename Base::value_type>
template< template<
class Base, class Base,
class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type class CharType = typename boost::iterator_value<Base>::type
> >
class base64_from_binary : class base64_from_binary :
public transform_iterator< public transform_iterator<
@@ -82,7 +81,7 @@ class base64_from_binary :
{ {
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef transform_iterator< typedef transform_iterator<
BOOST_DEDUCED_TYPENAME detail::from_6_bit<CharType>, typename detail::from_6_bit<CharType>,
Base Base
> super_t; > super_t;

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP #define BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -18,7 +18,6 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
#include <boost/serialization/throw_exception.hpp> #include <boost/serialization/throw_exception.hpp>
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
@@ -67,7 +66,7 @@ struct to_6_bit {
} // namespace detail } // namespace detail
// note: what we would like to do is // note: what we would like to do is
// template<class Base, class CharType = BOOST_DEDUCED_TYPENAME Base::value_type> // template<class Base, class CharType = typename Base::value_type>
// typedef transform_iterator< // typedef transform_iterator<
// from_6_bit<CharType>, // from_6_bit<CharType>,
// transform_width<Base, 6, sizeof(Base::value_type) * 8, CharType> // transform_width<Base, 6, sizeof(Base::value_type) * 8, CharType>
@@ -81,7 +80,7 @@ struct to_6_bit {
template< template<
class Base, class Base,
class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type class CharType = typename boost::iterator_value<Base>::type
> >
class binary_from_base64 : public class binary_from_base64 : public
transform_iterator< transform_iterator<

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP #define BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP #define BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -19,7 +19,6 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <cstddef> // NULL #include <cstddef> // NULL
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_traits.hpp> #include <boost/iterator/iterator_traits.hpp>
@@ -35,16 +34,16 @@ class escape :
public boost::iterator_adaptor< public boost::iterator_adaptor<
Derived, Derived,
Base, Base,
BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type, typename boost::iterator_value<Base>::type,
single_pass_traversal_tag, single_pass_traversal_tag,
BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type typename boost::iterator_value<Base>::type
> >
{ {
typedef BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type base_value_type; typedef typename boost::iterator_value<Base>::type base_value_type;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference<Base>::type reference_type; typedef typename boost::iterator_reference<Base>::type reference_type;
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< typedef typename boost::iterator_adaptor<
Derived, Derived,
Base, Base,
base_value_type, base_value_type,

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP #define BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -18,7 +18,7 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ using ::memcpy; } namespace std{ using ::memcpy; }
#endif #endif
@@ -37,7 +37,7 @@ namespace iterators {
template< template<
class Base, class Base,
int N, int N,
class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type class CharType = typename boost::iterator_value<Base>::type
> >
class insert_linebreaks : class insert_linebreaks :
public iterator_adaptor< public iterator_adaptor<

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP #define BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -41,13 +41,13 @@ class istream_iterator :
{ {
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef istream_iterator this_t ; typedef istream_iterator this_t ;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_facade< typedef typename boost::iterator_facade<
istream_iterator<Elem>, istream_iterator<Elem>,
Elem, Elem,
std::input_iterator_tag, std::input_iterator_tag,
Elem Elem
> super_t; > super_t;
typedef BOOST_DEDUCED_TYPENAME std::basic_istream<Elem> istream_type; typedef typename std::basic_istream<Elem> istream_type;
bool equal(const this_t & rhs) const { bool equal(const this_t & rhs) const {
// note: only works for comparison against end of stream // note: only works for comparison against end of stream

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP #define BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -20,7 +20,7 @@
#include <cstddef> // size_t #include <cstddef> // size_t
#include <cstdlib> // for wctomb() #include <cstdlib> // for wctomb()
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::size_t; using ::size_t;
@@ -50,7 +50,7 @@ class mb_from_wchar
{ {
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< typedef typename boost::iterator_adaptor<
mb_from_wchar<Base>, mb_from_wchar<Base>,
Base, Base,
wchar_t, wchar_t,

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP #define BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP #define BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -18,17 +18,12 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/filter_iterator.hpp> #include <boost/iterator/filter_iterator.hpp>
#include <boost/iterator/iterator_traits.hpp> #include <boost/iterator/iterator_traits.hpp>
//#include <boost/detail/workaround.hpp>
//#if ! BOOST_WORKAROUND(BOOST_MSVC, <=1300)
// here is the default standard implementation of the functor used // here is the default standard implementation of the functor used
// by the filter iterator to remove spaces. Unfortunately usage // by the filter iterator to remove spaces. Unfortunately usage
// of this implementation in combination with spirit trips a bug // of this implementation in combination with spirit trips a bug
@@ -53,8 +48,6 @@ namespace std{ using ::isspace; }
#undef iswspace #undef iswspace
#endif #endif
//#endif // BOOST_WORKAROUND
namespace { // anonymous namespace { // anonymous
template<class CharType> template<class CharType>
@@ -100,14 +93,14 @@ class filter_iterator
> >
{ {
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< typedef typename boost::iterator_adaptor<
filter_iterator<Predicate, Base>, filter_iterator<Predicate, Base>,
Base, Base,
use_default, use_default,
single_pass_traversal_tag single_pass_traversal_tag
> super_t; > super_t;
typedef filter_iterator<Predicate, Base> this_t; typedef filter_iterator<Predicate, Base> this_t;
typedef BOOST_DEDUCED_TYPENAME super_t::reference reference_type; typedef typename super_t::reference reference_type;
reference_type dereference_impl(){ reference_type dereference_impl(){
if(! m_full){ if(! m_full){
@@ -142,8 +135,8 @@ template<class Base>
class remove_whitespace : class remove_whitespace :
public filter_iterator< public filter_iterator<
remove_whitespace_predicate< remove_whitespace_predicate<
BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type typename boost::iterator_value<Base>::type
//BOOST_DEDUCED_TYPENAME Base::value_type //typename Base::value_type
>, >,
Base Base
> >
@@ -151,8 +144,8 @@ class remove_whitespace :
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef filter_iterator< typedef filter_iterator<
remove_whitespace_predicate< remove_whitespace_predicate<
BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type typename boost::iterator_value<Base>::type
//BOOST_DEDUCED_TYPENAME Base::value_type //typename Base::value_type
>, >,
Base Base
> super_t; > super_t;

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP #define BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -24,12 +24,13 @@
// character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters // character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters
// or 3 8 bit characters // or 3 8 bit characters
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME & PTFO
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_traits.hpp> #include <boost/iterator/iterator_traits.hpp>
#include <algorithm> // std::min
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace iterators { namespace iterators {
@@ -41,7 +42,7 @@ template<
class Base, class Base,
int BitsOut, int BitsOut,
int BitsIn, int BitsIn,
class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type // output character class CharType = typename boost::iterator_value<Base>::type // output character
> >
class transform_width : class transform_width :
public boost::iterator_adaptor< public boost::iterator_adaptor<
@@ -53,7 +54,7 @@ class transform_width :
> >
{ {
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< typedef typename boost::iterator_adaptor<
transform_width<Base, BitsOut, BitsIn, CharType>, transform_width<Base, BitsOut, BitsIn, CharType>,
Base, Base,
CharType, CharType,
@@ -62,7 +63,7 @@ class transform_width :
> super_t; > super_t;
typedef transform_width<Base, BitsOut, BitsIn, CharType> this_t; typedef transform_width<Base, BitsOut, BitsIn, CharType> this_t;
typedef BOOST_DEDUCED_TYPENAME iterator_value<Base>::type base_value_type; typedef typename iterator_value<Base>::type base_value_type;
void fill(); void fill();
@@ -112,6 +113,10 @@ public:
transform_width(BOOST_PFTO_WRAPPER(T) start) : transform_width(BOOST_PFTO_WRAPPER(T) start) :
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
m_buffer_out_full(false), m_buffer_out_full(false),
// To disable GCC warning, but not truly necessary
//(m_buffer_in will be initialized later before being
//used because m_remaining_bits == 0)
m_buffer_in(0),
m_remaining_bits(0), m_remaining_bits(0),
m_end_of_sequence(false) m_end_of_sequence(false)
{} {}
@@ -119,8 +124,9 @@ public:
transform_width(const transform_width & rhs) : transform_width(const transform_width & rhs) :
super_t(rhs.base_reference()), super_t(rhs.base_reference()),
m_buffer_out_full(rhs.m_buffer_out_full), m_buffer_out_full(rhs.m_buffer_out_full),
m_remaining_bits(rhs.m_remaining_bits), m_buffer_out(rhs.m_buffer_out),
m_buffer_in(rhs.m_buffer_in), m_buffer_in(rhs.m_buffer_in),
m_remaining_bits(rhs.m_remaining_bits),
m_end_of_sequence(false) m_end_of_sequence(false)
{} {}
}; };

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP #define BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -18,9 +18,7 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
//#include <boost/iterator/iterator_traits.hpp>
#include <boost/pointee.hpp> #include <boost/pointee.hpp>
namespace boost { namespace boost {
@@ -35,24 +33,24 @@ class unescape
: public boost::iterator_adaptor< : public boost::iterator_adaptor<
unescape<Derived, Base>, unescape<Derived, Base>,
Base, Base,
BOOST_DEDUCED_TYPENAME pointee<Base>::type, typename pointee<Base>::type,
single_pass_traversal_tag, single_pass_traversal_tag,
BOOST_DEDUCED_TYPENAME pointee<Base>::type typename pointee<Base>::type
> >
{ {
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< typedef typename boost::iterator_adaptor<
unescape<Derived, Base>, unescape<Derived, Base>,
Base, Base,
BOOST_DEDUCED_TYPENAME pointee<Base>::type, typename pointee<Base>::type,
single_pass_traversal_tag, single_pass_traversal_tag,
BOOST_DEDUCED_TYPENAME pointee<Base>::type typename pointee<Base>::type
> super_t; > super_t;
typedef unescape<Derived, Base> this_t; typedef unescape<Derived, Base> this_t;
public: public:
typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type; typedef typename this_t::value_type value_type;
typedef BOOST_DEDUCED_TYPENAME this_t::reference reference; typedef typename this_t::reference reference;
private: private:
value_type dereference_impl() { value_type dereference_impl() {
if(! m_full){ if(! m_full){

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP #define BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -21,7 +21,7 @@
#include <cstddef> // size_t #include <cstddef> // size_t
#include <cstdlib> // mblen #include <cstdlib> // mblen
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::mblen; using ::mblen;
@@ -53,7 +53,7 @@ class wchar_from_mb
> >
{ {
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< typedef typename boost::iterator_adaptor<
wchar_from_mb<Base>, wchar_from_mb<Base>,
Base, Base,
wchar_t, wchar_t,

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP #define BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -17,10 +17,7 @@
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/archive/iterators/escape.hpp> #include <boost/archive/iterators/escape.hpp>
namespace boost { namespace boost {

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP #define BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -18,8 +18,6 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
#include <boost/serialization/throw_exception.hpp> #include <boost/serialization/throw_exception.hpp>
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
@@ -39,7 +37,7 @@ class xml_unescape
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
typedef xml_unescape<Base> this_t; typedef xml_unescape<Base> this_t;
typedef unescape<this_t, Base> super_t; typedef unescape<this_t, Base> super_t;
typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference<this_t> reference_type; typedef typename boost::iterator_reference<this_t> reference_type;
reference_type dereference() const { reference_type dereference() const {
return unescape<xml_unescape<Base>, Base>::dereference(); return unescape<xml_unescape<Base>, Base>::dereference();
@@ -49,7 +47,7 @@ public:
#if defined(BOOST_MSVC) #if defined(BOOST_MSVC)
typedef int value_type; typedef int value_type;
#else #else
typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type; typedef typename this_t::value_type value_type;
#endif #endif
void drain_residue(const char *literal); void drain_residue(const char *literal);
@@ -83,7 +81,7 @@ void xml_unescape<Base>::drain_residue(const char * literal){
// iterator refenence which would make subsequent iterator comparisons // iterator refenence which would make subsequent iterator comparisons
// incorrect and thereby break the composiblity of iterators. // incorrect and thereby break the composiblity of iterators.
template<class Base> template<class Base>
BOOST_DEDUCED_TYPENAME xml_unescape<Base>::value_type typename xml_unescape<Base>::value_type
//int //int
xml_unescape<Base>::drain(){ xml_unescape<Base>::drain(){
value_type retval = * this->base_reference(); value_type retval = * this->base_reference();

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP #define BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -39,8 +39,6 @@ namespace std{
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost { namespace boost {
template<class T>
class shared_ptr;
namespace serialization { namespace serialization {
class extended_type_info; class extended_type_info;
} // namespace serialization } // namespace serialization
@@ -155,18 +153,11 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// 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 boost {
namespace archive { namespace archive {
class polymorphic_iarchive : class polymorphic_iarchive :
public polymorphic_iarchive_impl, public polymorphic_iarchive_impl
public detail::shared_ptr_helper
{ {
public: public:
virtual ~polymorphic_iarchive(){}; virtual ~polymorphic_iarchive(){};

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP #define BOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -38,8 +38,6 @@ namespace std{
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost { namespace boost {
template<class T>
class shared_ptr;
namespace serialization { namespace serialization {
class extended_type_info; class extended_type_info;
} // namespace serialization } // namespace serialization

View File

@@ -1,219 +0,0 @@
#ifndef BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP
#define BOOST_ARCHIVE_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 pointern
// (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo
// 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 <list>
#include <utility>
#include <cstddef> // NULL
#include <boost/config.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/type_traits/is_polymorphic.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>
#include <boost/archive/detail/decl.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last headern
namespace boost_132 {
template<class T> class shared_ptr;
}
namespace boost {
template<class T> class shared_ptr;
namespace serialization {
class extended_type_info;
template<class Archive, class T>
inline void load(
Archive & ar,
boost::shared_ptr< T > &t,
const unsigned int file_version
);
}
namespace archive{
namespace detail {
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// a common class for holding various types of shared pointers
class shared_ptr_helper {
struct collection_type_compare {
bool operator()(
const shared_ptr<const void> &lhs,
const shared_ptr<const void> &rhs
)const{
return lhs.get() < rhs.get();
}
};
typedef std::set<
boost::shared_ptr<const void>,
collection_type_compare
> 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. Note, we delay construction until
// it is actually used since this is by default included as
// a "mix-in" even if shared_ptr isn't used.
collection_type * m_pointers;
struct null_deleter {
void operator()(void const *) const {}
};
struct void_deleter {
const boost::serialization::extended_type_info * m_eti;
void_deleter(const boost::serialization::extended_type_info *eti) :
m_eti(eti)
{}
void operator()(void *vp) const {
m_eti->destroy(vp);
}
};
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public:
#else
template<class Archive, class T>
friend inline void boost::serialization::load(
Archive & ar,
boost::shared_ptr< T > &t,
const unsigned int file_version
);
#endif
// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
// 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<const void> > * m_pointers_132;
// #endif
// returns pointer to object and an indicator whether this is a
// new entry (true) or a previous one (false)
BOOST_ARCHIVE_DECL(shared_ptr<void>)
get_od(
const void * od,
const boost::serialization::extended_type_info * true_type,
const boost::serialization::extended_type_info * this_type
);
BOOST_ARCHIVE_DECL(void)
append(const boost::shared_ptr<const void> &);
template<class T>
struct non_polymorphic {
static const boost::serialization::extended_type_info *
get_object_identifier(T &){
return & boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME
boost::serialization::type_info_implementation< T >::type
>::get_const_instance();
}
};
template<class T>
struct polymorphic {
static const boost::serialization::extended_type_info *
get_object_identifier(T & t){
return boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME
boost::serialization::type_info_implementation< T >::type
>::get_const_instance().get_derived_extended_type_info(t);
}
};
public:
template<class T>
void reset(shared_ptr< T > & s, T * t){
if(NULL == t){
s.reset();
return;
}
const boost::serialization::extended_type_info * this_type
= & boost::serialization::type_info_implementation< T >::type
::get_const_instance();
// get pointer to the most derived object. This is effectively
// the object identifern
typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
is_polymorphic< T >,
mpl::identity<polymorphic< T > >,
mpl::identity<non_polymorphic< T > >
>::type type;
const boost::serialization::extended_type_info * true_type
= type::get_object_identifier(*t);
// note:if this exception is thrown, be sure that derived pointern
// is either registered or exported.
if(NULL == true_type)
boost::serialization::throw_exception(
archive_exception(
archive_exception::unregistered_class,
this_type->get_debug_info()
)
);
shared_ptr<void> r =
get_od(
static_cast<const void *>(t),
true_type,
this_type
);
if(!r){
s.reset(t);
const void * od = void_downcast(
*true_type,
*this_type,
static_cast<const void *>(t)
);
shared_ptr<const void> sp(s, od);
append(sp);
}
else{
s = shared_ptr< T >(
r,
static_cast<T *>(r.get())
);
}
}
// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
BOOST_ARCHIVE_DECL(void)
append(const boost_132::shared_ptr<const void> & t);
// #endif
public:
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
shared_ptr_helper();
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
~shared_ptr_helper();
};
} // namespace detail
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_TEXT_IARCHIVE_HPP #define BOOST_ARCHIVE_TEXT_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -35,6 +35,10 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_iarchive;
} // namespace detail
template<class Archive> template<class Archive>
class text_iarchive_impl : class text_iarchive_impl :
public basic_text_iprimitive<std::istream>, public basic_text_iprimitive<std::istream>,
@@ -43,10 +47,16 @@ class text_iarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
friend class detail::interface_iarchive<Archive>;
friend class basic_text_iarchive<Archive>;
friend class load_access;
protected: protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_iarchive<Archive>;
friend load_access;
#else
friend class detail::interface_iarchive<Archive>;
friend class load_access;
#endif
#endif #endif
template<class T> template<class T>
void load(T & t){ void load(T & t){
@@ -92,22 +102,6 @@ protected:
~text_iarchive_impl(){}; ~text_iarchive_impl(){};
}; };
// do not derive from the classes below. If you want to extend this functionality
// via inhertance, derived from text_iarchive_impl instead. This will
// preserve correct static polymorphism.
// same as text_iarchive below - without the shared_ptr_helper
class naked_text_iarchive :
public text_iarchive_impl<naked_text_iarchive>
{
public:
naked_text_iarchive(std::istream & is_, unsigned int flags = 0) :
// note: added _ to suppress useless gcc warning
text_iarchive_impl<naked_text_iarchive>(is_, flags)
{}
~naked_text_iarchive(){}
};
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
@@ -117,12 +111,6 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// 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>
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
@@ -132,9 +120,7 @@ namespace boost {
namespace archive { namespace archive {
class text_iarchive : class text_iarchive :
public text_iarchive_impl<text_iarchive>, public text_iarchive_impl<text_iarchive>{
public detail::shared_ptr_helper
{
public: public:
text_iarchive(std::istream & is_, unsigned int flags = 0) : text_iarchive(std::istream & is_, unsigned int flags = 0) :
// note: added _ to suppress useless gcc warning // note: added _ to suppress useless gcc warning

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_TEXT_OARCHIVE_HPP #define BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -42,6 +42,10 @@ namespace std{
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
template<class Archive> template<class Archive>
class text_oarchive_impl : class text_oarchive_impl :
/* protected ? */ public basic_text_oprimitive<std::ostream>, /* protected ? */ public basic_text_oprimitive<std::ostream>,
@@ -50,10 +54,18 @@ class text_oarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
friend basic_text_oarchive<Archive>;
friend save_access;
#else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
friend class basic_text_oarchive<Archive>; friend class basic_text_oarchive<Archive>;
friend class save_access; friend class save_access;
protected: #endif
#endif #endif
template<class T> template<class T>
void save(const T & t){ void save(const T & t){
@@ -102,8 +114,6 @@ public:
~text_oarchive(){} ~text_oarchive(){}
}; };
typedef text_oarchive naked_text_oarchive;
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP #define BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -39,6 +39,10 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_iarchive;
} // namespace detail
template<class Archive> template<class Archive>
class text_wiarchive_impl : class text_wiarchive_impl :
public basic_text_iprimitive<std::wistream>, public basic_text_iprimitive<std::wistream>,
@@ -47,10 +51,16 @@ class text_wiarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
friend class detail::interface_iarchive<Archive>;
friend class basic_text_iarchive<Archive>;
friend class load_access;
protected: protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_iarchive<Archive>;
friend load_access;
#else
friend class detail::interface_iarchive<Archive>;
friend class load_access;
#endif
#endif #endif
template<class T> template<class T>
void load(T & t){ void load(T & t){
@@ -89,21 +99,6 @@ protected:
~text_wiarchive_impl(){}; ~text_wiarchive_impl(){};
}; };
// do not derive from the classes below. If you want to extend this functionality
// via inhertance, derived from text_iarchive_impl instead. This will
// preserve correct static polymorphism.
// same as text_wiarchive below - without the shared_ptr_helper
class naked_text_wiarchive :
public text_wiarchive_impl<naked_text_wiarchive>
{
public:
naked_text_wiarchive(std::wistream & is, unsigned int flags = 0) :
text_wiarchive_impl<naked_text_wiarchive>(is, flags)
{}
~naked_text_wiarchive(){}
};
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
@@ -113,12 +108,6 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// 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>
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
@@ -128,9 +117,7 @@ namespace boost {
namespace archive { namespace archive {
class text_wiarchive : class text_wiarchive :
public text_wiarchive_impl<text_wiarchive>, public text_wiarchive_impl<text_wiarchive>{
public detail::shared_ptr_helper
{
public: public:
text_wiarchive(std::wistream & is, unsigned int flags = 0) : text_wiarchive(std::wistream & is, unsigned int flags = 0) :
text_wiarchive_impl<text_wiarchive>(is, flags) text_wiarchive_impl<text_wiarchive>(is, flags)

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP #define BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -47,6 +47,10 @@ namespace std{
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
template<class Archive> template<class Archive>
class text_woarchive_impl : class text_woarchive_impl :
public basic_text_oprimitive<std::wostream>, public basic_text_oprimitive<std::wostream>,
@@ -55,10 +59,18 @@ class text_woarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
friend basic_text_oarchive<Archive>;
friend save_access;
#else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
friend class basic_text_oarchive<Archive>; friend class basic_text_oarchive<Archive>;
friend class save_access; friend class save_access;
protected: #endif
#endif #endif
template<class T> template<class T>
void save(const T & t){ void save(const T & t){
@@ -127,8 +139,6 @@ public:
~text_woarchive(){} ~text_woarchive(){}
}; };
typedef text_woarchive naked_text_woarchive;
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_WCSLEN_HPP #define BOOST_ARCHIVE_WCSLEN_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP #define BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_XML_IARCHIVE_HPP #define BOOST_ARCHIVE_XML_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -18,7 +18,7 @@
#include <istream> #include <istream>
//#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/archive/detail/auto_link_archive.hpp> #include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/basic_text_iprimitive.hpp> #include <boost/archive/basic_text_iprimitive.hpp>
#include <boost/archive/basic_xml_iarchive.hpp> #include <boost/archive/basic_xml_iarchive.hpp>
@@ -35,6 +35,10 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_iarchive;
} // namespace detail
template<class CharType> template<class CharType>
class basic_xml_grammar; class basic_xml_grammar;
typedef basic_xml_grammar<char> xml_grammar; typedef basic_xml_grammar<char> xml_grammar;
@@ -47,15 +51,21 @@ class xml_iarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_iarchive<Archive>;
friend basic_xml_iarchive<Archive>;
friend load_access;
#else
friend class detail::interface_iarchive<Archive>; friend class detail::interface_iarchive<Archive>;
friend class basic_xml_iarchive<Archive>; friend class basic_xml_iarchive<Archive>;
friend class load_access; friend class load_access;
protected: #endif
#endif #endif
// instances of micro xml parser to parse start preambles // use boost:scoped_ptr to implement automatic deletion;
// scoped_ptr doesn't play nice with borland - so use a naked pointer boost::scoped_ptr<xml_grammar> gimpl;
// scoped_ptr<xml_grammar> gimpl;
xml_grammar *gimpl;
std::istream & get_is(){ std::istream & get_is(){
return is; return is;
@@ -102,21 +112,6 @@ protected:
~xml_iarchive_impl(); ~xml_iarchive_impl();
}; };
// do not derive from the classes below. If you want to extend this functionality
// via inhertance, derived from text_iarchive_impl instead. This will
// preserve correct static polymorphism.
// same as xml_iarchive below - without the shared_ptr_helper
class naked_xml_iarchive :
public xml_iarchive_impl<naked_xml_iarchive>
{
public:
naked_xml_iarchive(std::istream & is, unsigned int flags = 0) :
xml_iarchive_impl<naked_xml_iarchive>(is, flags)
{}
~naked_xml_iarchive(){}
};
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
@@ -125,13 +120,6 @@ public:
#endif #endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// 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>
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
@@ -141,9 +129,7 @@ namespace boost {
namespace archive { namespace archive {
class xml_iarchive : class xml_iarchive :
public xml_iarchive_impl<xml_iarchive>, public xml_iarchive_impl<xml_iarchive>{
public detail::shared_ptr_helper
{
public: public:
xml_iarchive(std::istream & is, unsigned int flags = 0) : xml_iarchive(std::istream & is, unsigned int flags = 0) :
xml_iarchive_impl<xml_iarchive>(is, flags) xml_iarchive_impl<xml_iarchive>(is, flags)

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_XML_OARCHIVE_HPP #define BOOST_ARCHIVE_XML_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -42,6 +42,10 @@ namespace std{
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
template<class Archive> template<class Archive>
class xml_oarchive_impl : class xml_oarchive_impl :
public basic_text_oprimitive<std::ostream>, public basic_text_oprimitive<std::ostream>,
@@ -50,10 +54,18 @@ class xml_oarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
friend basic_xml_oarchive<Archive>;
friend save_access;
#else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
friend class basic_xml_oarchive<Archive>; friend class basic_xml_oarchive<Archive>;
friend class save_access; friend class save_access;
protected: #endif
#endif #endif
//void end_preamble(){ //void end_preamble(){
// basic_xml_oarchive<Archive>::end_preamble(); // basic_xml_oarchive<Archive>::end_preamble();
@@ -116,8 +128,6 @@ public:
~xml_oarchive(){} ~xml_oarchive(){}
}; };
typedef xml_oarchive naked_xml_oarchive;
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_XML_WIARCHIVE_HPP #define BOOST_ARCHIVE_XML_WIARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -23,13 +23,22 @@
#include <istream> #include <istream>
//#include <boost/scoped_ptr.hpp> #include <boost/smart_ptr/scoped_ptr.hpp>
#include <boost/archive/detail/auto_link_warchive.hpp> #include <boost/archive/detail/auto_link_warchive.hpp>
#include <boost/archive/basic_text_iprimitive.hpp> #include <boost/archive/basic_text_iprimitive.hpp>
#include <boost/archive/basic_xml_iarchive.hpp> #include <boost/archive/basic_xml_iarchive.hpp>
#include <boost/archive/detail/register_archive.hpp> #include <boost/archive/detail/register_archive.hpp>
#include <boost/serialization/item_version_type.hpp> #include <boost/serialization/item_version_type.hpp>
#ifdef BOOST_NO_CXX11_HDR_CODECVT
#include <boost/archive/detail/utf8_codecvt_facet.hpp>
#else
#include <codecvt>
namespace boost { namespace archive { namespace detail {
typedef std::codecvt_utf8<wchar_t> utf8_codecvt_facet;
} } }
#endif
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
@@ -40,6 +49,10 @@
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_iarchive;
} // namespace detail
template<class CharType> template<class CharType>
class basic_xml_grammar; class basic_xml_grammar;
typedef basic_xml_grammar<wchar_t> xml_wgrammar; typedef basic_xml_grammar<wchar_t> xml_wgrammar;
@@ -52,15 +65,20 @@ class xml_wiarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_iarchive<Archive>;
friend basic_xml_iarchive<Archive>;
friend load_access;
#else
friend class detail::interface_iarchive<Archive>; friend class detail::interface_iarchive<Archive>;
friend class basic_xml_iarchive<Archive>; friend class basic_xml_iarchive<Archive>;
friend class load_access; friend class load_access;
protected: #endif
#endif #endif
// instances of micro xml parser to parse start preambles boost::scoped_ptr<xml_wgrammar> gimpl;
// scoped_ptr doesn't play nice with borland - so use a naked pointer
// scoped_ptr<xml_wgrammar> gimpl;
xml_wgrammar *gimpl;
std::wistream & get_is(){ std::wistream & get_is(){
return is; return is;
} }
@@ -107,21 +125,6 @@ protected:
~xml_wiarchive_impl(); ~xml_wiarchive_impl();
}; };
// do not derive from the classes below. If you want to extend this functionality
// via inhertance, derived from xml_wiarchive_impl instead. This will
// preserve correct static polymorphism.
// same as xml_wiarchive below - without the shared_ptr_helper
class naked_xml_wiarchive :
public xml_wiarchive_impl<naked_xml_wiarchive>
{
public:
naked_xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
xml_wiarchive_impl<naked_xml_wiarchive>(is, flags)
{}
~naked_xml_wiarchive(){}
};
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
@@ -131,12 +134,6 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// 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>
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
@@ -146,9 +143,7 @@ namespace boost {
namespace archive { namespace archive {
class xml_wiarchive : class xml_wiarchive :
public xml_wiarchive_impl<xml_wiarchive>, public xml_wiarchive_impl<xml_wiarchive>{
public detail::shared_ptr_helper
{
public: public:
xml_wiarchive(std::wistream & is, unsigned int flags = 0) : xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
xml_wiarchive_impl<xml_wiarchive>(is, flags) xml_wiarchive_impl<xml_wiarchive>(is, flags)

View File

@@ -2,7 +2,7 @@
#define BOOST_ARCHIVE_XML_WOARCHIVE_HPP #define BOOST_ARCHIVE_XML_WOARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER)
# pragma once # pragma once
#endif #endif
@@ -30,12 +30,22 @@ namespace std{
#include <ostream> #include <ostream>
#include <boost/smart_ptr/scoped_ptr.hpp>
#include <boost/archive/detail/auto_link_warchive.hpp> #include <boost/archive/detail/auto_link_warchive.hpp>
#include <boost/archive/basic_text_oprimitive.hpp> #include <boost/archive/basic_text_oprimitive.hpp>
#include <boost/archive/basic_xml_oarchive.hpp> #include <boost/archive/basic_xml_oarchive.hpp>
#include <boost/archive/detail/register_archive.hpp> #include <boost/archive/detail/register_archive.hpp>
#include <boost/serialization/item_version_type.hpp> #include <boost/serialization/item_version_type.hpp>
#ifdef BOOST_NO_CXX11_HDR_CODECVT
#include <boost/archive/detail/utf8_codecvt_facet.hpp>
#else
#include <codecvt>
namespace boost { namespace archive { namespace detail {
typedef std::codecvt_utf8<wchar_t> utf8_codecvt_facet;
} } }
#endif
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
@@ -46,6 +56,10 @@ namespace std{
namespace boost { namespace boost {
namespace archive { namespace archive {
namespace detail {
template<class Archive> class interface_oarchive;
} // namespace detail
template<class Archive> template<class Archive>
class xml_woarchive_impl : class xml_woarchive_impl :
public basic_text_oprimitive<std::wostream>, public basic_text_oprimitive<std::wostream>,
@@ -54,10 +68,18 @@ class xml_woarchive_impl :
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public: public:
#else #else
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
friend basic_xml_oarchive<Archive>;
friend save_access;
#else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
friend class basic_xml_oarchive<Archive>; friend class basic_xml_oarchive<Archive>;
friend class save_access; friend class save_access;
protected: #endif
#endif #endif
//void end_preamble(){ //void end_preamble(){
// basic_xml_oarchive<Archive>::end_preamble(); // basic_xml_oarchive<Archive>::end_preamble();
@@ -89,7 +111,8 @@ protected:
#endif #endif
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
xml_woarchive_impl(std::wostream & os, unsigned int flags); xml_woarchive_impl(std::wostream & os, unsigned int flags);
~xml_woarchive_impl(){} BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
~xml_woarchive_impl();
public: public:
void void
save_binary(const void *address, std::size_t count){ save_binary(const void *address, std::size_t count){
@@ -122,8 +145,6 @@ public:
~xml_woarchive(){} ~xml_woarchive(){}
}; };
typedef xml_woarchive naked_xml_woarchive;
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost

View File

@@ -2,18 +2,19 @@
// boost/assert.hpp - BOOST_ASSERT(expr) // boost/assert.hpp - BOOST_ASSERT(expr)
// BOOST_ASSERT_MSG(expr, msg) // BOOST_ASSERT_MSG(expr, msg)
// BOOST_VERIFY(expr) // BOOST_VERIFY(expr)
// BOOST_VERIFY_MSG(expr, msg)
// //
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2007 Peter Dimov // Copyright (c) 2007, 2014 Peter Dimov
// Copyright (c) Beman Dawes 2011 // Copyright (c) Beman Dawes 2011
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0.
// accompanying file LICENSE_1_0.txt or copy at // See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt
// //
// Note: There are no include guards. This is intentional. // Note: There are no include guards. This is intentional.
// //
// See http://www.boost.org/libs/utility/assert.html for documentation. // See http://www.boost.org/libs/assert/assert.html for documentation.
// //
// //
@@ -22,120 +23,56 @@
// boostinspect:naassert_macro // boostinspect:naassert_macro
// //
//--------------------------------------------------------------------------------------// //
// BOOST_ASSERT // // BOOST_ASSERT, BOOST_ASSERT_MSG
//--------------------------------------------------------------------------------------// //
#undef BOOST_ASSERT #undef BOOST_ASSERT
#undef BOOST_ASSERT_MSG
#if defined(BOOST_DISABLE_ASSERTS) #if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) )
# define BOOST_ASSERT(expr) ((void)0) # define BOOST_ASSERT(expr) ((void)0)
# define BOOST_ASSERT_MSG(expr, msg) ((void)0)
#elif defined(BOOST_ENABLE_ASSERT_HANDLER) #elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) )
#include <boost/config.hpp> #include <boost/config.hpp> // for BOOST_LIKELY
#include <boost/current_function.hpp> #include <boost/current_function.hpp>
namespace boost namespace boost
{ {
void assertion_failed(char const * expr, void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
char const * function, char const * file, long line); // user defined void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); // user defined
} // namespace boost } // namespace boost
#define BOOST_ASSERT(expr) (BOOST_LIKELY(!!(expr)) \ #define BOOST_ASSERT(expr) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
? ((void)0) \ #define BOOST_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
: ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#else #else
# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same # include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
# define BOOST_ASSERT(expr) assert(expr) # define BOOST_ASSERT(expr) assert(expr)
# define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
#endif #endif
//--------------------------------------------------------------------------------------// //
// BOOST_ASSERT_MSG // // BOOST_VERIFY, BOOST_VERIFY_MSG
//--------------------------------------------------------------------------------------// //
# undef BOOST_ASSERT_MSG
#if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG)
#define BOOST_ASSERT_MSG(expr, msg) ((void)0)
#elif defined(BOOST_ENABLE_ASSERT_HANDLER)
#include <boost/config.hpp>
#include <boost/current_function.hpp>
namespace boost
{
void assertion_failed_msg(char const * expr, char const * msg,
char const * function, char const * file, long line); // user defined
} // namespace boost
#define BOOST_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr)) \
? ((void)0) \
: ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#else
#ifndef BOOST_ASSERT_HPP
#define BOOST_ASSERT_HPP
#include <cstdlib>
#include <iostream>
#include <boost/config.hpp>
#include <boost/current_function.hpp>
// IDE's like Visual Studio perform better if output goes to std::cout or
// some other stream, so allow user to configure output stream:
#ifndef BOOST_ASSERT_MSG_OSTREAM
# define BOOST_ASSERT_MSG_OSTREAM std::cerr
#endif
namespace boost
{
namespace assertion
{
namespace detail
{
// Note: The template is needed to make the function non-inline and avoid linking errors
template< typename CharT >
BOOST_NOINLINE void assertion_failed_msg(CharT const * expr, char const * msg, char const * function,
char const * file, long line)
{
BOOST_ASSERT_MSG_OSTREAM
<< "***** Internal Program Error - assertion (" << expr << ") failed in "
<< function << ":\n"
<< file << '(' << line << "): " << msg << std::endl;
#ifdef UNDER_CE
// The Windows CE CRT library does not have abort() so use exit(-1) instead.
std::exit(-1);
#else
std::abort();
#endif
}
} // detail
} // assertion
} // detail
#endif
#define BOOST_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr)) \
? ((void)0) \
: ::boost::assertion::detail::assertion_failed_msg(#expr, msg, \
BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#endif
//--------------------------------------------------------------------------------------//
// BOOST_VERIFY //
//--------------------------------------------------------------------------------------//
#undef BOOST_VERIFY #undef BOOST_VERIFY
#undef BOOST_VERIFY_MSG
#if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) ) #if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )
# define BOOST_VERIFY(expr) ((void)(expr)) # define BOOST_VERIFY(expr) ((void)(expr))
# define BOOST_VERIFY_MSG(expr, msg) ((void)(expr))
#else #else
# define BOOST_VERIFY(expr) BOOST_ASSERT(expr) # define BOOST_VERIFY(expr) BOOST_ASSERT(expr)
# define BOOST_VERIFY_MSG(expr, msg) BOOST_ASSERT_MSG(expr,msg)
#endif #endif

View File

@@ -1,18 +0,0 @@
#ifndef BOOST_ATOMIC_HPP
#define BOOST_ATOMIC_HPP
// Copyright (c) 2011 Helge Bahmann
//
// Distributed under 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)
// This header includes all Boost.Atomic public headers
#include <boost/atomic/atomic.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#endif

View File

@@ -1,232 +0,0 @@
#ifndef BOOST_ATOMIC_ATOMIC_HPP
#define BOOST_ATOMIC_ATOMIC_HPP
// Copyright (c) 2011 Helge Bahmann
// Copyright (c) 2013 Tim Blechmann
//
// Distributed under 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)
#include <cstddef>
#include <boost/cstdint.hpp>
#include <boost/memory_order.hpp>
#include <boost/atomic/detail/config.hpp>
#include <boost/atomic/detail/platform.hpp>
#include <boost/atomic/detail/type-classification.hpp>
#include <boost/type_traits/is_signed.hpp>
#if defined(BOOST_MSVC) && BOOST_MSVC < 1400
#include <boost/type_traits/is_integral.hpp>
#include <boost/mpl/and.hpp>
#endif
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
#ifndef BOOST_ATOMIC_CHAR_LOCK_FREE
#define BOOST_ATOMIC_CHAR_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_CHAR16_T_LOCK_FREE
#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_CHAR32_T_LOCK_FREE
#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_WCHAR_T_LOCK_FREE
#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_SHORT_LOCK_FREE
#define BOOST_ATOMIC_SHORT_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_INT_LOCK_FREE
#define BOOST_ATOMIC_INT_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_LONG_LOCK_FREE
#define BOOST_ATOMIC_LONG_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_LLONG_LOCK_FREE
#define BOOST_ATOMIC_LLONG_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_INT128_LOCK_FREE
#define BOOST_ATOMIC_INT128_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_POINTER_LOCK_FREE
#define BOOST_ATOMIC_POINTER_LOCK_FREE 0
#endif
#define BOOST_ATOMIC_ADDRESS_LOCK_FREE BOOST_ATOMIC_POINTER_LOCK_FREE
#ifndef BOOST_ATOMIC_BOOL_LOCK_FREE
#define BOOST_ATOMIC_BOOL_LOCK_FREE 0
#endif
#ifndef BOOST_ATOMIC_THREAD_FENCE
#define BOOST_ATOMIC_THREAD_FENCE 0
inline void atomic_thread_fence(memory_order)
{
}
#endif
#ifndef BOOST_ATOMIC_SIGNAL_FENCE
#define BOOST_ATOMIC_SIGNAL_FENCE 0
inline void atomic_signal_fence(memory_order order)
{
atomic_thread_fence(order);
}
#endif
template<typename T>
class atomic :
public atomics::detail::base_atomic<
T,
typename atomics::detail::classify<T>::type,
atomics::detail::storage_size_of<T>::value,
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1400
boost::is_signed<T>::value
#else
// MSVC 2003 has problems instantiating is_signed on non-integral types
mpl::and_< boost::is_integral<T>, boost::is_signed<T> >::value
#endif
>
{
private:
typedef T value_type;
typedef atomics::detail::base_atomic<
T,
typename atomics::detail::classify<T>::type,
atomics::detail::storage_size_of<T>::value,
#if !defined(BOOST_MSVC) || BOOST_MSVC >= 1400
boost::is_signed<T>::value
#else
// MSVC 2003 has problems instantiating is_signed on non-itegral types
mpl::and_< boost::is_integral<T>, boost::is_signed<T> >::value
#endif
> super;
typedef typename super::value_arg_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(atomic(void), BOOST_NOEXCEPT {})
// NOTE: The constructor is made explicit because gcc 4.7 complains that
// operator=(value_arg_type) is considered ambiguous with operator=(atomic const&)
// in assignment expressions, even though conversion to atomic<> is less preferred
// than conversion to value_arg_type.
explicit BOOST_CONSTEXPR atomic(value_arg_type v) BOOST_NOEXCEPT : super(v) {}
value_type operator=(value_arg_type v) volatile BOOST_NOEXCEPT
{
this->store(v);
return v;
}
operator value_type(void) volatile const BOOST_NOEXCEPT
{
return this->load();
}
BOOST_DELETED_FUNCTION(atomic(atomic const&))
BOOST_DELETED_FUNCTION(atomic& operator=(atomic const&) volatile)
};
typedef atomic<char> atomic_char;
typedef atomic<unsigned char> atomic_uchar;
typedef atomic<signed char> atomic_schar;
typedef atomic<uint8_t> atomic_uint8_t;
typedef atomic<int8_t> atomic_int8_t;
typedef atomic<unsigned short> atomic_ushort;
typedef atomic<short> atomic_short;
typedef atomic<uint16_t> atomic_uint16_t;
typedef atomic<int16_t> atomic_int16_t;
typedef atomic<unsigned int> atomic_uint;
typedef atomic<int> atomic_int;
typedef atomic<uint32_t> atomic_uint32_t;
typedef atomic<int32_t> atomic_int32_t;
typedef atomic<unsigned long> atomic_ulong;
typedef atomic<long> atomic_long;
typedef atomic<uint64_t> atomic_uint64_t;
typedef atomic<int64_t> atomic_int64_t;
#ifdef BOOST_HAS_LONG_LONG
typedef atomic<boost::ulong_long_type> atomic_ullong;
typedef atomic<boost::long_long_type> atomic_llong;
#endif
typedef atomic<void*> atomic_address;
typedef atomic<bool> atomic_bool;
typedef atomic<wchar_t> atomic_wchar_t;
#if !defined(BOOST_NO_CXX11_CHAR16_T)
typedef atomic<char16_t> atomic_char16_t;
#endif
#if !defined(BOOST_NO_CXX11_CHAR32_T)
typedef atomic<char32_t> atomic_char32_t;
#endif
typedef atomic<int_least8_t> atomic_int_least8_t;
typedef atomic<uint_least8_t> atomic_uint_least8_t;
typedef atomic<int_least16_t> atomic_int_least16_t;
typedef atomic<uint_least16_t> atomic_uint_least16_t;
typedef atomic<int_least32_t> atomic_int_least32_t;
typedef atomic<uint_least32_t> atomic_uint_least32_t;
typedef atomic<int_least64_t> atomic_int_least64_t;
typedef atomic<uint_least64_t> atomic_uint_least64_t;
typedef atomic<int_fast8_t> atomic_int_fast8_t;
typedef atomic<uint_fast8_t> atomic_uint_fast8_t;
typedef atomic<int_fast16_t> atomic_int_fast16_t;
typedef atomic<uint_fast16_t> atomic_uint_fast16_t;
typedef atomic<int_fast32_t> atomic_int_fast32_t;
typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
typedef atomic<int_fast64_t> atomic_int_fast64_t;
typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
typedef atomic<intmax_t> atomic_intmax_t;
typedef atomic<uintmax_t> atomic_uintmax_t;
typedef atomic<std::size_t> atomic_size_t;
typedef atomic<std::ptrdiff_t> atomic_ptrdiff_t;
#if defined(BOOST_HAS_INTPTR_T)
typedef atomic<intptr_t> atomic_intptr_t;
typedef atomic<uintptr_t> atomic_uintptr_t;
#endif
#ifndef BOOST_ATOMIC_FLAG_LOCK_FREE
#define BOOST_ATOMIC_FLAG_LOCK_FREE 0
class atomic_flag
{
public:
BOOST_CONSTEXPR atomic_flag(void) BOOST_NOEXCEPT : v_(false) {}
bool
test_and_set(memory_order order = memory_order_seq_cst) BOOST_NOEXCEPT
{
return v_.exchange(true, order);
}
void
clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
v_.store(false, order);
}
BOOST_DELETED_FUNCTION(atomic_flag(atomic_flag const&))
BOOST_DELETED_FUNCTION(atomic_flag& operator=(atomic_flag const&))
private:
atomic<bool> v_;
};
#endif
}
#endif

View File

@@ -1,605 +0,0 @@
#ifndef BOOST_ATOMIC_DETAIL_BASE_HPP
#define BOOST_ATOMIC_DETAIL_BASE_HPP
// Copyright (c) 2009 Helge Bahmann
// Copyright (c) 2013 Tim Blechmann
//
// Distributed under 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)
// Base class definition and fallback implementation.
// To be overridden (through partial specialization) by
// platform implementations.
#include <string.h>
#include <cstddef>
#include <boost/cstdint.hpp>
#include <boost/atomic/detail/config.hpp>
#include <boost/atomic/detail/lockpool.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#define BOOST_ATOMIC_DECLARE_BASE_OPERATORS \
bool \
compare_exchange_strong( \
value_type & expected, \
value_type desired, \
memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT \
{ \
return compare_exchange_strong(expected, desired, order, calculate_failure_order(order)); \
} \
\
bool \
compare_exchange_weak( \
value_type & expected, \
value_type desired, \
memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT \
{ \
return compare_exchange_weak(expected, desired, order, calculate_failure_order(order)); \
} \
#define BOOST_ATOMIC_DECLARE_ADDITIVE_OPERATORS \
value_type \
operator++(int) volatile BOOST_NOEXCEPT \
{ \
return fetch_add(1); \
} \
\
value_type \
operator++(void) volatile BOOST_NOEXCEPT \
{ \
return fetch_add(1) + 1; \
} \
\
value_type \
operator--(int) volatile BOOST_NOEXCEPT \
{ \
return fetch_sub(1); \
} \
\
value_type \
operator--(void) volatile BOOST_NOEXCEPT \
{ \
return fetch_sub(1) - 1; \
} \
\
value_type \
operator+=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return fetch_add(v) + v; \
} \
\
value_type \
operator-=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return fetch_sub(v) - v; \
} \
#define BOOST_ATOMIC_DECLARE_VOID_POINTER_ADDITIVE_OPERATORS \
value_type \
operator++(int) volatile BOOST_NOEXCEPT \
{ \
return fetch_add(1); \
} \
\
value_type \
operator++(void) volatile BOOST_NOEXCEPT \
{ \
return (char*)fetch_add(1) + 1; \
} \
\
value_type \
operator--(int) volatile BOOST_NOEXCEPT \
{ \
return fetch_sub(1); \
} \
\
value_type \
operator--(void) volatile BOOST_NOEXCEPT \
{ \
return (char*)fetch_sub(1) - 1; \
} \
\
value_type \
operator+=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return (char*)fetch_add(v) + v; \
} \
\
value_type \
operator-=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return (char*)fetch_sub(v) - v; \
} \
#define BOOST_ATOMIC_DECLARE_BIT_OPERATORS \
value_type \
operator&=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return fetch_and(v) & v; \
} \
\
value_type \
operator|=(difference_type v) volatile BOOST_NOEXCEPT \
{ \
return fetch_or(v) | v; \
} \
\
value_type \
operator^=(difference_type v) volatile BOOST_NOEXCEPT\
{ \
return fetch_xor(v) ^ v; \
} \
#define BOOST_ATOMIC_DECLARE_POINTER_OPERATORS \
BOOST_ATOMIC_DECLARE_BASE_OPERATORS \
BOOST_ATOMIC_DECLARE_ADDITIVE_OPERATORS \
#define BOOST_ATOMIC_DECLARE_VOID_POINTER_OPERATORS \
BOOST_ATOMIC_DECLARE_BASE_OPERATORS \
BOOST_ATOMIC_DECLARE_VOID_POINTER_ADDITIVE_OPERATORS \
#define BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS \
BOOST_ATOMIC_DECLARE_BASE_OPERATORS \
BOOST_ATOMIC_DECLARE_ADDITIVE_OPERATORS \
BOOST_ATOMIC_DECLARE_BIT_OPERATORS \
namespace boost {
namespace atomics {
namespace detail {
inline memory_order
calculate_failure_order(memory_order order)
{
switch(order)
{
case memory_order_acq_rel:
return memory_order_acquire;
case memory_order_release:
return memory_order_relaxed;
default:
return order;
}
}
template<typename T, typename C, unsigned int Size, bool Sign>
class base_atomic
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef lockpool::scoped_lock guard_type;
protected:
typedef value_type const& value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(v)
{}
void
store(value_type const& v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
char * storage = storage_ptr();
guard_type guard(storage);
memcpy(storage, &v, sizeof(value_type));
}
value_type
load(memory_order /*order*/ = memory_order_seq_cst) volatile const BOOST_NOEXCEPT
{
char * storage = storage_ptr();
guard_type guard(storage);
value_type v;
memcpy(&v, storage, sizeof(value_type));
return v;
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order /*success_order*/,
memory_order /*failure_order*/) volatile BOOST_NOEXCEPT
{
char * storage = storage_ptr();
guard_type guard(storage);
if (memcmp(storage, &expected, sizeof(value_type)) == 0) {
memcpy(storage, &desired, sizeof(value_type));
return true;
} else {
memcpy(&expected, storage, sizeof(value_type));
return false;
}
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
exchange(value_type const& v, memory_order /*order*/=memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
char * storage = storage_ptr();
guard_type guard(storage);
value_type tmp;
memcpy(&tmp, storage, sizeof(value_type));
memcpy(storage, &v, sizeof(value_type));
return tmp;
}
bool
is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return false;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
char * storage_ptr() volatile const BOOST_NOEXCEPT
{
return const_cast<char *>(&reinterpret_cast<char const volatile &>(v_));
}
T v_;
};
template<typename T, unsigned int Size, bool Sign>
class base_atomic<T, int, Size, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
typedef lockpool::scoped_lock guard_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
v_ = v;
}
value_type
load(memory_order /*order*/ = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type v = const_cast<const volatile value_type &>(v_);
return v;
}
value_type
exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ = v;
return old;
}
bool
compare_exchange_strong(value_type & expected, value_type desired,
memory_order /*success_order*/,
memory_order /*failure_order*/) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
if (v_ == expected) {
v_ = desired;
return true;
} else {
expected = v_;
return false;
}
}
bool
compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type
fetch_add(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ += v;
return old;
}
value_type
fetch_sub(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ -= v;
return old;
}
value_type
fetch_and(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ &= v;
return old;
}
value_type
fetch_or(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ |= v;
return old;
}
value_type
fetch_xor(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ ^= v;
return old;
}
bool
is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return false;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
value_type v_;
};
template<typename T, unsigned int Size, bool Sign>
class base_atomic<T *, void *, Size, Sign>
{
private:
typedef base_atomic this_type;
typedef T * value_type;
typedef std::ptrdiff_t difference_type;
typedef lockpool::scoped_lock guard_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
v_ = v;
}
value_type
load(memory_order /*order*/ = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type v = const_cast<const volatile value_type &>(v_);
return v;
}
value_type
exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ = v;
return old;
}
bool
compare_exchange_strong(value_type & expected, value_type desired,
memory_order /*success_order*/,
memory_order /*failure_order*/) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
if (v_ == expected) {
v_ = desired;
return true;
} else {
expected = v_;
return false;
}
}
bool
compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
value_type fetch_add(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ += v;
return old;
}
value_type fetch_sub(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ -= v;
return old;
}
bool
is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return false;
}
BOOST_ATOMIC_DECLARE_POINTER_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
value_type v_;
};
template<unsigned int Size, bool Sign>
class base_atomic<void *, void *, Size, Sign>
{
private:
typedef base_atomic this_type;
typedef std::ptrdiff_t difference_type;
typedef void * value_type;
typedef lockpool::scoped_lock guard_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
v_ = v;
}
value_type
load(memory_order /*order*/ = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type v = const_cast<const volatile value_type &>(v_);
return v;
}
value_type
exchange(value_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
v_ = v;
return old;
}
bool
compare_exchange_strong(value_type & expected, value_type desired,
memory_order /*success_order*/,
memory_order /*failure_order*/) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
if (v_ == expected) {
v_ = desired;
return true;
} else {
expected = v_;
return false;
}
}
bool
compare_exchange_weak(value_type & expected, value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return false;
}
value_type fetch_add(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
char * cv = reinterpret_cast<char*>(old);
cv += v;
v_ = cv;
return old;
}
value_type fetch_sub(difference_type v, memory_order /*order*/ = memory_order_seq_cst) volatile
{
guard_type guard(const_cast<value_type *>(&v_));
value_type old = v_;
char * cv = reinterpret_cast<char*>(old);
cv -= v;
v_ = cv;
return old;
}
BOOST_ATOMIC_DECLARE_VOID_POINTER_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
value_type v_;
};
}
}
}
#endif

View File

@@ -1,290 +0,0 @@
#ifndef BOOST_ATOMIC_DETAIL_CAS128STRONG_HPP
#define BOOST_ATOMIC_DETAIL_CAS128STRONG_HPP
// Distributed under 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)
//
// Copyright (c) 2011 Helge Bahmann
// Copyright (c) 2013 Tim Blechmann, Andrey Semashev
// Build 128-bit atomic operation on integers/UDTs from platform_cmpxchg128_strong
// primitive. It is assumed that 128-bit loads/stores are not
// atomic, so they are implemented through platform_load128/platform_store128.
#include <string.h>
#include <cstddef>
#include <boost/cstdint.hpp>
#include <boost/memory_order.hpp>
#include <boost/atomic/detail/config.hpp>
#include <boost/atomic/detail/base.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
namespace atomics {
namespace detail {
/* integral types */
template<typename T, bool Sign>
class base_atomic<T, int, 16, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
platform_store128(v, &v_);
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = platform_load128(&v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
bool success = platform_cmpxchg128_strong(expected, desired, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
}
return success;
}
value_type
fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
value_type
fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
return original;
}
value_type
fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
return original;
}
value_type
fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
value_type v_;
};
/* generic types */
#if defined(BOOST_HAS_INT128)
typedef boost::uint128_type storage128_type;
#else // defined(BOOST_HAS_INT128)
struct BOOST_ALIGNMENT(16) storage128_type
{
uint64_t data[2];
};
inline bool operator== (storage128_type const& left, storage128_type const& right)
{
return left.data[0] == right.data[0] && left.data[1] == right.data[1];
}
inline bool operator!= (storage128_type const& left, storage128_type const& right)
{
return !(left == right);
}
#endif // defined(BOOST_HAS_INT128)
template<typename T, bool Sign>
class base_atomic<T, void, 16, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef storage128_type storage_type;
protected:
typedef value_type const& value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
{
memset(&v_, 0, sizeof(v_));
memcpy(&v_, &v, sizeof(value_type));
}
void
store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type value_s;
memset(&value_s, 0, sizeof(value_s));
memcpy(&value_s, &value, sizeof(value_type));
platform_fence_before_store(order);
platform_store128(value_s, &v_);
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type value_s = platform_load128(&v_);
platform_fence_after_load(order);
value_type value;
memcpy(&value, &value_s, sizeof(value_type));
return value;
}
value_type
exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s, desired_s;
memset(&expected_s, 0, sizeof(expected_s));
memset(&desired_s, 0, sizeof(desired_s));
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
platform_fence_before(success_order);
bool success = platform_cmpxchg128_strong(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
memcpy(&expected, &expected_s, sizeof(value_type));
}
return success;
}
bool
is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
storage_type v_;
};
}
}
}
#endif

View File

@@ -1,939 +0,0 @@
#ifndef BOOST_ATOMIC_DETAIL_CAS32STRONG_HPP
#define BOOST_ATOMIC_DETAIL_CAS32STRONG_HPP
// Distributed under 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)
//
// Copyright (c) 2011 Helge Bahmann
// Copyright (c) 2013 Tim Blechmann
// Build 8-, 16- and 32-bit atomic operations from
// a platform_cmpxchg32_strong primitive.
#include <string.h>
#include <cstddef>
#include <boost/cstdint.hpp>
#include <boost/memory_order.hpp>
#include <boost/atomic/detail/config.hpp>
#include <boost/atomic/detail/base.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
namespace atomics {
namespace detail {
/* integral types */
template<typename T, bool Sign>
class base_atomic<T, int, 1, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
typedef uint32_t storage_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
storage_type expected_s = (storage_type) expected;
storage_type desired_s = (storage_type) desired;
bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
expected = (value_type) expected_s;
}
return success;
}
value_type
fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
value_type
fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
return original;
}
value_type
fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
return original;
}
value_type
fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
storage_type v_;
};
template<typename T, bool Sign>
class base_atomic<T, int, 2, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
typedef uint32_t storage_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
storage_type expected_s = (storage_type) expected;
storage_type desired_s = (storage_type) desired;
bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
expected = (value_type) expected_s;
}
return success;
}
value_type
fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
value_type
fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
return original;
}
value_type
fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
return original;
}
value_type
fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
storage_type v_;
};
template<typename T, bool Sign>
class base_atomic<T, int, 4, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
bool success = platform_cmpxchg32_strong(expected, desired, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
}
return success;
}
value_type
fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
value_type
fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
return original;
}
value_type
fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
return original;
}
value_type
fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
value_type v_;
};
/* pointer types */
template<bool Sign>
class base_atomic<void *, void *, 4, Sign>
{
private:
typedef base_atomic this_type;
typedef void * value_type;
typedef std::ptrdiff_t difference_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
bool success = platform_cmpxchg32_strong(expected, desired, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
}
return success;
}
value_type
fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, (char*)original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, (char*)original - v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_VOID_POINTER_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
value_type v_;
};
template<typename T, bool Sign>
class base_atomic<T *, void *, 4, Sign>
{
private:
typedef base_atomic this_type;
typedef T * value_type;
typedef std::ptrdiff_t difference_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
const_cast<volatile value_type &>(v_) = v;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
value_type v = const_cast<const volatile value_type &>(v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
bool success = platform_cmpxchg32_strong(expected, desired, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
}
return success;
}
value_type
fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_POINTER_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
value_type v_;
};
/* generic types */
template<typename T, bool Sign>
class base_atomic<T, void, 1, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef uint32_t storage_type;
protected:
typedef value_type const& value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
void
store(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = tmp;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
value_type v;
memcpy(&v, &tmp, sizeof(value_type));
return v;
}
value_type
exchange(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) ) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) ) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
platform_fence_before(success_order);
bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
memcpy(&expected, &expected_s, sizeof(value_type));
}
return success;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
storage_type v_;
};
template<typename T, bool Sign>
class base_atomic<T, void, 2, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef uint32_t storage_type;
protected:
typedef value_type const& value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
void
store(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = tmp;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
value_type v;
memcpy(&v, &tmp, sizeof(value_type));
return v;
}
value_type
exchange(value_type const& v, memory_order order = memory_order_seq_cst) ) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
platform_fence_before(success_order);
bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
memcpy(&expected, &expected_s, sizeof(value_type));
}
return success;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
storage_type v_;
};
template<typename T, bool Sign>
class base_atomic<T, void, 4, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef uint32_t storage_type;
protected:
typedef value_type const& value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
void
store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type tmp = 0;
memcpy(&tmp, &v, sizeof(value_type));
platform_fence_before_store(order);
const_cast<volatile storage_type &>(v_) = tmp;
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile
{
storage_type tmp = const_cast<const volatile storage_type &>(v_);
platform_fence_after_load(order);
value_type v;
memcpy(&v, &tmp, sizeof(value_type));
return v;
}
value_type
exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
platform_fence_before(success_order);
bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
memcpy(&expected, &expected_s, sizeof(value_type));
}
return success;
}
bool
is_lock_free(void) const volatile
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
storage_type v_;
};
}
}
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,264 +0,0 @@
#ifndef BOOST_ATOMIC_DETAIL_CAS64STRONG_HPP
#define BOOST_ATOMIC_DETAIL_CAS64STRONG_HPP
// Distributed under 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)
//
// Copyright (c) 2011 Helge Bahmann
// Copyright (c) 2013 Tim Blechmann
// Build 64-bit atomic operation on integers/UDTs from platform_cmpxchg64_strong
// primitive. It is assumed that 64-bit loads/stores are not
// atomic, so they are implemented through platform_load64/platform_store64.
#include <string.h>
#include <cstddef>
#include <boost/cstdint.hpp>
#include <boost/memory_order.hpp>
#include <boost/atomic/detail/config.hpp>
#include <boost/atomic/detail/base.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
namespace atomics {
namespace detail {
/* integral types */
template<typename T, bool Sign>
class base_atomic<T, int, 8, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef T difference_type;
protected:
typedef value_type value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
BOOST_CONSTEXPR explicit base_atomic(value_type v) BOOST_NOEXCEPT : v_(v) {}
void
store(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
platform_fence_before_store(order);
platform_store64(v, &v_);
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
value_type v = platform_load64(&v_);
platform_fence_after_load(order);
return v;
}
value_type
exchange(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
platform_fence_before(success_order);
bool success = platform_cmpxchg64_strong(expected, desired, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
}
return success;
}
value_type
fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
return original;
}
value_type
fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
return original;
}
value_type
fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
return original;
}
value_type
fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
return original;
}
value_type
fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
return original;
}
bool
is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
value_type v_;
};
/* generic types */
template<typename T, bool Sign>
class base_atomic<T, void, 8, Sign>
{
private:
typedef base_atomic this_type;
typedef T value_type;
typedef uint64_t storage_type;
protected:
typedef value_type const& value_arg_type;
public:
BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
{
memcpy(&v_, &v, sizeof(value_type));
}
void
store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
storage_type value_s = 0;
memcpy(&value_s, &value, sizeof(value_type));
platform_fence_before_store(order);
platform_store64(value_s, &v_);
platform_fence_after_store(order);
}
value_type
load(memory_order order = memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
storage_type value_s = platform_load64(&v_);
platform_fence_after_load(order);
value_type value;
memcpy(&value, &value_s, sizeof(value_type));
return value;
}
value_type
exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
value_type original = load(memory_order_relaxed);
do {
} while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
return original;
}
bool
compare_exchange_weak(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
return compare_exchange_strong(expected, desired, success_order, failure_order);
}
bool
compare_exchange_strong(
value_type & expected,
value_type const& desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
storage_type expected_s = 0, desired_s = 0;
memcpy(&expected_s, &expected, sizeof(value_type));
memcpy(&desired_s, &desired, sizeof(value_type));
platform_fence_before(success_order);
bool success = platform_cmpxchg64_strong(expected_s, desired_s, &v_);
if (success) {
platform_fence_after(success_order);
} else {
platform_fence_after(failure_order);
memcpy(&expected, &expected_s, sizeof(value_type));
}
return success;
}
bool
is_lock_free(void) const volatile BOOST_NOEXCEPT
{
return true;
}
BOOST_ATOMIC_DECLARE_BASE_OPERATORS
BOOST_DELETED_FUNCTION(base_atomic(base_atomic const&))
BOOST_DELETED_FUNCTION(base_atomic& operator=(base_atomic const&))
private:
storage_type v_;
};
}
}
}
#endif

View File

@@ -1,16 +0,0 @@
#ifndef BOOST_ATOMIC_DETAIL_CONFIG_HPP
#define BOOST_ATOMIC_DETAIL_CONFIG_HPP
// Copyright (c) 2012 Hartmut Kaiser
//
// Distributed under 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)
#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#endif

View File

@@ -1,368 +0,0 @@
#ifndef BOOST_ATOMIC_DETAIL_GCC_ALPHA_HPP
#define BOOST_ATOMIC_DETAIL_GCC_ALPHA_HPP
// Copyright (c) 2009 Helge Bahmann
// Copyright (c) 2013 Tim Blechmann
//
// Distributed under 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)
#include <boost/atomic/detail/config.hpp>
#include <boost/atomic/detail/base.hpp>
#include <boost/atomic/detail/builder.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
/*
Refer to http://h71000.www7.hp.com/doc/82final/5601/5601pro_004.html
(HP OpenVMS systems documentation) and the alpha reference manual.
*/
/*
NB: The most natural thing would be to write the increment/decrement
operators along the following lines:
__asm__ __volatile__(
"1: ldl_l %0,%1 \n"
"addl %0,1,%0 \n"
"stl_c %0,%1 \n"
"beq %0,1b\n"
: "=&b" (tmp)
: "m" (value)
: "cc"
);
However according to the comments on the HP website and matching
comments in the Linux kernel sources this defies branch prediction,
as the cpu assumes that backward branches are always taken; so
instead copy the trick from the Linux kernel, introduce a forward
branch and back again.
I have, however, had a hard time measuring the difference between
the two versions in microbenchmarks -- I am leaving it in nevertheless
as it apparently does not hurt either.
*/
namespace boost {
namespace atomics {
namespace detail {
inline void fence_before(memory_order order)
{
switch(order) {
case memory_order_consume:
case memory_order_release:
case memory_order_acq_rel:
case memory_order_seq_cst:
__asm__ __volatile__ ("mb" ::: "memory");
default:;
}
}
inline void fence_after(memory_order order)
{
switch(order) {
case memory_order_acquire:
case memory_order_acq_rel:
case memory_order_seq_cst:
__asm__ __volatile__ ("mb" ::: "memory");
default:;
}
}
template<>
inline void platform_atomic_thread_fence(memory_order order)
{
switch(order) {
case memory_order_acquire:
case memory_order_consume:
case memory_order_release:
case memory_order_acq_rel:
case memory_order_seq_cst:
__asm__ __volatile__ ("mb" ::: "memory");
default:;
}
}
template<typename T>
class atomic_alpha_32
{
public:
typedef T integral_type;
BOOST_CONSTEXPR atomic_alpha_32(T v) BOOST_NOEXCEPT: i(v) {}
atomic_alpha_32() {}
T load(memory_order order=memory_order_seq_cst) const volatile BOOST_NOEXCEPT
{
T v=*reinterpret_cast<volatile const int *>(&i);
fence_after(order);
return v;
}
void store(T v, memory_order order=memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
fence_before(order);
*reinterpret_cast<volatile int *>(&i)=(int)v;
}
bool compare_exchange_weak(
T &expected,
T desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
fence_before(success_order);
int current, success;
__asm__ __volatile__(
"1: ldl_l %2, %4\n"
"cmpeq %2, %0, %3\n"
"mov %2, %0\n"
"beq %3, 3f\n"
"stl_c %1, %4\n"
"2:\n"
".subsection 2\n"
"3: mov %3, %1\n"
"br 2b\n"
".previous\n"
: "+&r" (expected), "+&r" (desired), "=&r"(current), "=&r"(success)
: "m" (i)
:
);
if (desired) fence_after(success_order);
else fence_after(failure_order);
return desired;
}
bool is_lock_free(void) const volatile BOOST_NOEXCEPT {return true;}
protected:
inline T fetch_add_var(T c, memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
T original, modified;
__asm__ __volatile__(
"1: ldl_l %0, %2\n"
"addl %0, %3, %1\n"
"stl_c %1, %2\n"
"beq %1, 2f\n"
".subsection 2\n"
"2: br 1b\n"
".previous\n"
: "=&r" (original), "=&r" (modified)
: "m" (i), "r" (c)
:
);
fence_after(order);
return original;
}
inline T fetch_inc(memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
int original, modified;
__asm__ __volatile__(
"1: ldl_l %0, %2\n"
"addl %0, 1, %1\n"
"stl_c %1, %2\n"
"beq %1, 2f\n"
".subsection 2\n"
"2: br 1b\n"
".previous\n"
: "=&r" (original), "=&r" (modified)
: "m" (i)
:
);
fence_after(order);
return original;
}
inline T fetch_dec(memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
int original, modified;
__asm__ __volatile__(
"1: ldl_l %0, %2\n"
"subl %0, 1, %1\n"
"stl_c %1, %2\n"
"beq %1, 2f\n"
".subsection 2\n"
"2: br 1b\n"
".previous\n"
: "=&r" (original), "=&r" (modified)
: "m" (i)
:
);
fence_after(order);
return original;
}
private:
T i;
};
template<typename T>
class atomic_alpha_64
{
public:
typedef T integral_type;
BOOST_CONSTEXPR atomic_alpha_64(T v) BOOST_NOEXCEPT: i(v) {}
atomic_alpha_64() {}
T load(memory_order order=memory_order_seq_cst) const volatile
{
T v=*reinterpret_cast<volatile const T *>(&i);
fence_after(order);
return v;
}
void store(T v, memory_order order=memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
fence_before(order);
*reinterpret_cast<volatile T *>(&i)=v;
}
bool compare_exchange_weak(
T &expected,
T desired,
memory_order success_order,
memory_order failure_order) volatile BOOST_NOEXCEPT
{
fence_before(success_order);
int current, success;
__asm__ __volatile__(
"1: ldq_l %2, %4\n"
"cmpeq %2, %0, %3\n"
"mov %2, %0\n"
"beq %3, 3f\n"
"stq_c %1, %4\n"
"2:\n"
".subsection 2\n"
"3: mov %3, %1\n"
"br 2b\n"
".previous\n"
: "+&r" (expected), "+&r" (desired), "=&r"(current), "=&r"(success)
: "m" (i)
:
);
if (desired) fence_after(success_order);
else fence_after(failure_order);
return desired;
}
bool is_lock_free(void) const volatile BOOST_NOEXCEPT {return true;}
protected:
inline T fetch_add_var(T c, memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
T original, modified;
__asm__ __volatile__(
"1: ldq_l %0, %2\n"
"addq %0, %3, %1\n"
"stq_c %1, %2\n"
"beq %1, 2f\n"
".subsection 2\n"
"2: br 1b\n"
".previous\n"
: "=&r" (original), "=&r" (modified)
: "m" (i), "r" (c)
:
);
fence_after(order);
return original;
}
inline T fetch_inc(memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
T original, modified;
__asm__ __volatile__(
"1: ldq_l %0, %2\n"
"addq %0, 1, %1\n"
"stq_c %1, %2\n"
"beq %1, 2f\n"
".subsection 2\n"
"2: br 1b\n"
".previous\n"
: "=&r" (original), "=&r" (modified)
: "m" (i)
:
);
fence_after(order);
return original;
}
inline T fetch_dec(memory_order order) volatile BOOST_NOEXCEPT
{
fence_before(order);
T original, modified;
__asm__ __volatile__(
"1: ldq_l %0, %2\n"
"subq %0, 1, %1\n"
"stq_c %1, %2\n"
"beq %1, 2f\n"
".subsection 2\n"
"2: br 1b\n"
".previous\n"
: "=&r" (original), "=&r" (modified)
: "m" (i)
:
);
fence_after(order);
return original;
}
private:
T i;
};
template<typename T>
class platform_atomic_integral<T, 4> :
public build_atomic_from_typical<build_exchange<atomic_alpha_32<T> > >
{
public:
typedef build_atomic_from_typical<build_exchange<atomic_alpha_32<T> > > super;
BOOST_CONSTEXPR platform_atomic_integral(T v) BOOST_NOEXCEPT: super(v) {}
platform_atomic_integral(void) {}
};
template<typename T>
class platform_atomic_integral<T, 8> :
public build_atomic_from_typical<build_exchange<atomic_alpha_64<T> > >
{
public:
typedef build_atomic_from_typical<build_exchange<atomic_alpha_64<T> > > super;
BOOST_CONSTEXPR platform_atomic_integral(T v) BOOST_NOEXCEPT: super(v) {}
platform_atomic_integral(void) {}
};
template<typename T>
class platform_atomic_integral<T, 1> :
public build_atomic_from_larger_type<atomic_alpha_32<uint32_t>, T>
{
public:
typedef build_atomic_from_larger_type<atomic_alpha_32<uint32_t>, T> super;
BOOST_CONSTEXPR platform_atomic_integral(T v) BOOST_NOEXCEPT: super(v) {}
platform_atomic_integral(void) {}
};
template<typename T>
class platform_atomic_integral<T, 2> :
public build_atomic_from_larger_type<atomic_alpha_32<uint32_t>, T>
{
public:
typedef build_atomic_from_larger_type<atomic_alpha_32<uint32_t>, T> super;
BOOST_CONSTEXPR platform_atomic_integral(T v) BOOST_NOEXCEPT: super(v) {}
platform_atomic_integral(void) {}
};
}
}
}
#endif

View File

@@ -1,255 +0,0 @@
#ifndef BOOST_ATOMIC_DETAIL_GCC_ARMV6PLUS_HPP
#define BOOST_ATOMIC_DETAIL_GCC_ARMV6PLUS_HPP
// Distributed under 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)
//
// Copyright (c) 2009 Helge Bahmann
// Copyright (c) 2009 Phil Endecott
// Copyright (c) 2013 Tim Blechmann
// ARM Code by Phil Endecott, based on other architectures.
#include <boost/cstdint.hpp>
#include <boost/atomic/detail/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
// From the ARM Architecture Reference Manual for architecture v6:
//
// LDREX{<cond>} <Rd>, [<Rn>]
// <Rd> Specifies the destination register for the memory word addressed by <Rd>
// <Rn> Specifies the register containing the address.
//
// STREX{<cond>} <Rd>, <Rm>, [<Rn>]
// <Rd> Specifies the destination register for the returned status value.
// 0 if the operation updates memory
// 1 if the operation fails to update memory
// <Rm> Specifies the register containing the word to be stored to memory.
// <Rn> Specifies the register containing the address.
// Rd must not be the same register as Rm or Rn.
//
// ARM v7 is like ARM v6 plus:
// There are half-word and byte versions of the LDREX and STREX instructions,
// LDREXH, LDREXB, STREXH and STREXB.
// There are also double-word versions, LDREXD and STREXD.
// (Actually it looks like these are available from version 6k onwards.)
// FIXME these are not yet used; should be mostly a matter of copy-and-paste.
// I think you can supply an immediate offset to the address.
//
// A memory barrier is effected using a "co-processor 15" instruction,
// though a separate assembler mnemonic is available for it in v7.
namespace boost {
namespace atomics {
namespace detail {
// "Thumb 1" is a subset of the ARM instruction set that uses a 16-bit encoding. It
// doesn't include all instructions and in particular it doesn't include the co-processor
// instruction used for the memory barrier or the load-locked/store-conditional
// instructions. So, if we're compiling in "Thumb 1" mode, we need to wrap all of our
// asm blocks with code to temporarily change to ARM mode.
//
// You can only change between ARM and Thumb modes when branching using the bx instruction.
// bx takes an address specified in a register. The least significant bit of the address
// indicates the mode, so 1 is added to indicate that the destination code is Thumb.
// A temporary register is needed for the address and is passed as an argument to these
// macros. It must be one of the "low" registers accessible to Thumb code, specified
// using the "l" attribute in the asm symbolic_expressionexpression.
//
// Architecture v7 introduces "Thumb 2", which does include (almost?) all of the ARM
// instruction set. So in v7 we don't need to change to ARM mode; we can write "universal
// assembler" which will assemble to Thumb 2 or ARM code as appropriate. The only thing
// we need to do to make this "universal" assembler mode work is to insert "IT" instructions
// to annotate the conditional instructions. These are ignored in other modes (e.g. v6),
// so they can always be present.
#if defined(__thumb__) && !defined(__thumb2__)
#define BOOST_ATOMIC_ARM_ASM_START(TMPREG) "adr " #TMPREG ", 1f\n" "bx " #TMPREG "\n" ".arm\n" ".align 4\n" "1: "
#define BOOST_ATOMIC_ARM_ASM_END(TMPREG) "adr " #TMPREG ", 1f + 1\n" "bx " #TMPREG "\n" ".thumb\n" ".align 2\n" "1: "
#else
// The tmpreg is wasted in this case, which is non-optimal.
#define BOOST_ATOMIC_ARM_ASM_START(TMPREG)
#define BOOST_ATOMIC_ARM_ASM_END(TMPREG)
#endif
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__)
#define BOOST_ATOMIC_ARM_DMB "dmb\n"
#else
#define BOOST_ATOMIC_ARM_DMB "mcr\tp15, 0, r0, c7, c10, 5\n"
#endif
inline void
arm_barrier(void) BOOST_NOEXCEPT
{
int brtmp;
__asm__ __volatile__
(
BOOST_ATOMIC_ARM_ASM_START(%0)
BOOST_ATOMIC_ARM_DMB
BOOST_ATOMIC_ARM_ASM_END(%0)
: "=&l" (brtmp) :: "memory"
);
}
inline void
platform_fence_before(memory_order order) BOOST_NOEXCEPT
{
switch(order)
{
case memory_order_release:
case memory_order_acq_rel:
case memory_order_seq_cst:
arm_barrier();
case memory_order_consume:
default:;
}
}
inline void
platform_fence_after(memory_order order) BOOST_NOEXCEPT
{
switch(order)
{
case memory_order_acquire:
case memory_order_acq_rel:
case memory_order_seq_cst:
arm_barrier();
default:;
}
}
inline void
platform_fence_before_store(memory_order order) BOOST_NOEXCEPT
{
platform_fence_before(order);
}
inline void
platform_fence_after_store(memory_order order) BOOST_NOEXCEPT
{
if (order == memory_order_seq_cst)
arm_barrier();
}
inline void
platform_fence_after_load(memory_order order) BOOST_NOEXCEPT
{
platform_fence_after(order);
}
template<typename T>
inline bool
platform_cmpxchg32(T & expected, T desired, volatile T * ptr) BOOST_NOEXCEPT
{
int success;
int tmp;
__asm__ __volatile__
(
BOOST_ATOMIC_ARM_ASM_START(%2)
"mov %1, #0\n" // success = 0
"ldrex %0, %3\n" // expected' = *(&i)
"teq %0, %4\n" // flags = expected'==expected
"ittt eq\n"
"strexeq %2, %5, %3\n" // if (flags.equal) *(&i) = desired, tmp = !OK
"teqeq %2, #0\n" // if (flags.equal) flags = tmp==0
"moveq %1, #1\n" // if (flags.equal) success = 1
BOOST_ATOMIC_ARM_ASM_END(%2)
: "=&r" (expected), // %0
"=&r" (success), // %1
"=&l" (tmp), // %2
"+Q" (*ptr) // %3
: "r" (expected), // %4
"r" (desired) // %5
: "cc"
);
return success;
}
}
}
#define BOOST_ATOMIC_THREAD_FENCE 2
inline void
atomic_thread_fence(memory_order order)
{
switch(order)
{
case memory_order_acquire:
case memory_order_release:
case memory_order_acq_rel:
case memory_order_seq_cst:
atomics::detail::arm_barrier();
default:;
}
}
#define BOOST_ATOMIC_SIGNAL_FENCE 2
inline void
atomic_signal_fence(memory_order)
{
__asm__ __volatile__ ("" ::: "memory");
}
class atomic_flag
{
private:
uint32_t v_;
public:
BOOST_CONSTEXPR atomic_flag(void) BOOST_NOEXCEPT : v_(0) {}
void
clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before_store(order);
const_cast<volatile uint32_t &>(v_) = 0;
atomics::detail::platform_fence_after_store(order);
}
bool
test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before(order);
uint32_t expected = v_;
do {
if (expected == 1)
break;
} while (!atomics::detail::platform_cmpxchg32(expected, (uint32_t)1, &v_));
atomics::detail::platform_fence_after(order);
return expected;
}
BOOST_DELETED_FUNCTION(atomic_flag(const atomic_flag &))
BOOST_DELETED_FUNCTION(atomic_flag& operator=(const atomic_flag &))
};
#define BOOST_ATOMIC_FLAG_LOCK_FREE 2
}
#undef BOOST_ATOMIC_ARM_ASM_START
#undef BOOST_ATOMIC_ARM_ASM_END
#include <boost/atomic/detail/base.hpp>
#if !defined(BOOST_ATOMIC_FORCE_FALLBACK)
#define BOOST_ATOMIC_CHAR_LOCK_FREE 2
#define BOOST_ATOMIC_CHAR16_T_LOCK_FREE 2
#define BOOST_ATOMIC_CHAR32_T_LOCK_FREE 2
#define BOOST_ATOMIC_WCHAR_T_LOCK_FREE 2
#define BOOST_ATOMIC_SHORT_LOCK_FREE 2
#define BOOST_ATOMIC_INT_LOCK_FREE 2
#define BOOST_ATOMIC_LONG_LOCK_FREE 2
#define BOOST_ATOMIC_LLONG_LOCK_FREE 0
#define BOOST_ATOMIC_POINTER_LOCK_FREE 2
#define BOOST_ATOMIC_BOOL_LOCK_FREE 2
#include <boost/atomic/detail/cas32weak.hpp>
#endif /* !defined(BOOST_ATOMIC_FORCE_FALLBACK) */
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,160 +0,0 @@
// Copyright (c) 2011 Helge Bahmann
// Copyright (c) 2013 Tim Blechmann
//
// Distributed under 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)
// Use the gnu builtin __sync_val_compare_and_swap to build
// atomic operations for 32 bit and smaller.
#ifndef BOOST_ATOMIC_DETAIL_GENERIC_CAS_HPP
#define BOOST_ATOMIC_DETAIL_GENERIC_CAS_HPP
#include <boost/cstdint.hpp>
#include <boost/atomic/detail/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
namespace boost {
#define BOOST_ATOMIC_THREAD_FENCE 2
inline void
atomic_thread_fence(memory_order order)
{
switch(order)
{
case memory_order_relaxed:
break;
case memory_order_release:
case memory_order_consume:
case memory_order_acquire:
case memory_order_acq_rel:
case memory_order_seq_cst:
__sync_synchronize();
break;
}
}
namespace atomics {
namespace detail {
inline void
platform_fence_before(memory_order)
{
/* empty, as compare_and_swap is synchronizing already */
}
inline void
platform_fence_after(memory_order)
{
/* empty, as compare_and_swap is synchronizing already */
}
inline void
platform_fence_before_store(memory_order order)
{
switch(order)
{
case memory_order_relaxed:
case memory_order_acquire:
case memory_order_consume:
break;
case memory_order_release:
case memory_order_acq_rel:
case memory_order_seq_cst:
__sync_synchronize();
break;
}
}
inline void
platform_fence_after_store(memory_order order)
{
if (order == memory_order_seq_cst)
__sync_synchronize();
}
inline void
platform_fence_after_load(memory_order order)
{
switch(order)
{
case memory_order_relaxed:
case memory_order_release:
break;
case memory_order_consume:
case memory_order_acquire:
case memory_order_acq_rel:
case memory_order_seq_cst:
__sync_synchronize();
break;
}
}
template<typename T>
inline bool
platform_cmpxchg32_strong(T & expected, T desired, volatile T * ptr)
{
T found = __sync_val_compare_and_swap(ptr, expected, desired);
bool success = (found == expected);
expected = found;
return success;
}
class atomic_flag
{
private:
atomic_flag(const atomic_flag &) /* = delete */ ;
atomic_flag & operator=(const atomic_flag &) /* = delete */ ;
uint32_t v_;
public:
BOOST_CONSTEXPR atomic_flag(void) BOOST_NOEXCEPT : v_(0) {}
void
clear(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before_store(order);
const_cast<volatile uint32_t &>(v_) = 0;
atomics::detail::platform_fence_after_store(order);
}
bool
test_and_set(memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
{
atomics::detail::platform_fence_before(order);
uint32_t expected = v_;
do {
if (expected == 1)
break;
} while (!atomics::detail::platform_cmpxchg32(expected, (uint32_t)1, &v_));
atomics::detail::platform_fence_after(order);
return expected;
}
};
#define BOOST_ATOMIC_FLAG_LOCK_FREE 2
}
}
}
#include <boost/atomic/detail/base.hpp>
#if !defined(BOOST_ATOMIC_FORCE_FALLBACK)
#define BOOST_ATOMIC_CHAR_LOCK_FREE 2
#define BOOST_ATOMIC_SHORT_LOCK_FREE 2
#define BOOST_ATOMIC_INT_LOCK_FREE 2
#define BOOST_ATOMIC_LONG_LOCK_FREE (sizeof(long) <= 4 ? 2 : 0)
#define BOOST_ATOMIC_LLONG_LOCK_FREE (sizeof(long long) <= 4 ? 2 : 0)
#define BOOST_ATOMIC_POINTER_LOCK_FREE (sizeof(void *) <= 4 ? 2 : 0)
#define BOOST_ATOMIC_BOOL_LOCK_FREE 2
#include <boost/atomic/detail/cas32strong.hpp>
#endif /* !defined(BOOST_ATOMIC_FORCE_FALLBACK) */
#endif

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More