Squashed 'third_party/boostorg/serialization/' content from commit 738695b
Change-Id: I48528198ad1f62b90288d249eb2243d4db02fd5d
git-subtree-dir: third_party/boostorg/serialization
git-subtree-split: 738695b70733f9d592a570fb17a505d6a029b48a
diff --git a/include/boost/serialization/access.hpp b/include/boost/serialization/access.hpp
new file mode 100644
index 0000000..f6581ac
--- /dev/null
+++ b/include/boost/serialization/access.hpp
@@ -0,0 +1,145 @@
+#ifndef BOOST_SERIALIZATION_ACCESS_HPP
+#define BOOST_SERIALIZATION_ACCESS_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// access.hpp: interface for serialization system.
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+
+namespace boost {
+
+namespace archive {
+namespace detail {
+ template<class Archive, class T>
+ class iserializer;
+ template<class Archive, class T>
+ class oserializer;
+} // namespace detail
+} // namespace archive
+
+namespace serialization {
+
+// forward declarations
+template<class Archive, class T>
+inline void serialize_adl(Archive &, T &, const unsigned int);
+namespace detail {
+ template<class Archive, class T>
+ struct member_saver;
+ template<class Archive, class T>
+ struct member_loader;
+} // namespace detail
+
+// use an "accessor class so that we can use:
+// "friend class boost::serialization::access;"
+// in any serialized class to permit clean, safe access to private class members
+// by the serialization system
+
+class access {
+public:
+ // grant access to "real" serialization defaults
+#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+public:
+#else
+ template<class Archive, class T>
+ friend struct detail::member_saver;
+ template<class Archive, class T>
+ friend struct detail::member_loader;
+ template<class Archive, class T>
+ friend class archive::detail::iserializer;
+ template<class Archive, class T>
+ friend class archive::detail::oserializer;
+ template<class Archive, class T>
+ friend inline void serialize(
+ Archive & ar,
+ T & t,
+ const unsigned int file_version
+ );
+ template<class Archive, class T>
+ friend inline void save_construct_data(
+ Archive & ar,
+ const T * t,
+ const unsigned int file_version
+ );
+ template<class Archive, class T>
+ friend inline void load_construct_data(
+ Archive & ar,
+ T * t,
+ const unsigned int file_version
+ );
+#endif
+
+ // pass calls to users's class implementation
+ template<class Archive, class T>
+ static void member_save(
+ Archive & ar,
+ //const T & t,
+ T & t,
+ const unsigned int file_version
+ ){
+ t.save(ar, file_version);
+ }
+ template<class Archive, class T>
+ static void member_load(
+ Archive & ar,
+ T & t,
+ const unsigned int file_version
+ ){
+ t.load(ar, file_version);
+ }
+ template<class Archive, class T>
+ static void serialize(
+ Archive & ar,
+ T & t,
+ const unsigned int file_version
+ ){
+ // note: if you get a compile time error here with a
+ // message something like:
+ // cannot convert parameter 1 from <file type 1> to <file type 2 &>
+ // a likely possible cause is that the class T contains a
+ // serialize function - but that serialize function isn't
+ // a template and corresponds to a file type different than
+ // the class Archive. To resolve this, don't include an
+ // archive type other than that for which the serialization
+ // function is defined!!!
+ t.serialize(ar, file_version);
+ }
+ template<class T>
+ static void destroy( const T * t) // const appropriate here?
+ {
+ // the const business is an MSVC 6.0 hack that should be
+ // benign on everything else
+ delete const_cast<T *>(t);
+ }
+ template<class T>
+ static void construct(T * t){
+ // default is inplace invocation of default constructor
+ // Note the :: before the placement new. Required if the
+ // class doesn't have a class-specific placement new defined.
+ ::new(t)T;
+ }
+ template<class T, class U>
+ static T & cast_reference(U & u){
+ return static_cast<T &>(u);
+ }
+ template<class T, class U>
+ static T * cast_pointer(U * u){
+ return static_cast<T *>(u);
+ }
+};
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_ACCESS_HPP
diff --git a/include/boost/serialization/archive_input_unordered_map.hpp b/include/boost/serialization/archive_input_unordered_map.hpp
new file mode 100644
index 0000000..ccf806b
--- /dev/null
+++ b/include/boost/serialization/archive_input_unordered_map.hpp
@@ -0,0 +1,85 @@
+#ifndef BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_MAP_HPP
+#define BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_MAP_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
+// serialization/unordered_map.hpp:
+// serialization for stl unordered_map templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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 <boost/config.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+#include <boost/serialization/utility.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+namespace serialization {
+namespace stl {
+
+// map input
+template<class Archive, class Container>
+struct archive_input_unordered_map
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ std::pair<typename Container::const_iterator, bool> result =
+ s.insert(boost::move(t.reference()));
+ // note: the following presumes that the map::value_type was NOT tracked
+ // in the archive. This is the usual case, but here there is no way
+ // to determine that.
+ if(result.second){
+ ar.reset_object_address(
+ & (result.first->second),
+ & t.reference().second
+ );
+ }
+ }
+};
+
+// multimap input
+template<class Archive, class Container>
+struct archive_input_unordered_multimap
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ typename Container::const_iterator result =
+ s.insert(t.reference());
+ // note: the following presumes that the map::value_type was NOT tracked
+ // in the archive. This is the usual case, but here there is no way
+ // to determine that.
+ ar.reset_object_address(
+ & result->second,
+ & t.reference()
+ );
+ }
+};
+
+} // stl
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_MAP_HPP
diff --git a/include/boost/serialization/archive_input_unordered_set.hpp b/include/boost/serialization/archive_input_unordered_set.hpp
new file mode 100644
index 0000000..7f0003c
--- /dev/null
+++ b/include/boost/serialization/archive_input_unordered_set.hpp
@@ -0,0 +1,72 @@
+#ifndef BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_HPP
+#define BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_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
+// archive_input_unordered_set.hpp
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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 <utility>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+namespace serialization {
+
+namespace stl {
+
+// unordered_set input
+template<class Archive, class Container>
+struct archive_input_unordered_set
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ std::pair<typename Container::const_iterator, bool> result =
+ s.insert(boost::move(t.reference()));
+ if(result.second)
+ ar.reset_object_address(& (* result.first), & t.reference());
+ }
+};
+
+// unordered_multiset input
+template<class Archive, class Container>
+struct archive_input_unordered_multiset
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ typename Container::const_iterator result =
+ s.insert(boost::move(t.reference()));
+ ar.reset_object_address(& (* result), & t.reference());
+ }
+};
+
+} // stl
+} // serialization
+} // boost
+
+#endif // BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_SET_HPP
diff --git a/include/boost/serialization/array.hpp b/include/boost/serialization/array.hpp
new file mode 100644
index 0000000..612d1a6
--- /dev/null
+++ b/include/boost/serialization/array.hpp
@@ -0,0 +1,48 @@
+#ifndef BOOST_SERIALIZATION_ARRAY_HPP
+#define BOOST_SERIALIZATION_ARRAY_HPP
+
+// (C) Copyright 2005 Matthias Troyer and Dave Abrahams
+// 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)
+
+// for serialization of <array>. If <array> not supported by the standard
+// library - this file becomes empty. This is to avoid breaking backward
+// compatibiliy for applications which used this header to support
+// serialization of native arrays. Code to serialize native arrays is
+// now always include by default. RR
+
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+
+#if defined(BOOST_NO_STDC_NAMESPACE)
+
+#include <iostream>
+#include <cstddef> // std::size_t
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+
+#include <boost/serialization/array_wrapper.hpp>
+
+#ifndef BOOST_NO_CXX11_HDR_ARRAY
+
+#include <array>
+#include <boost/serialization/nvp.hpp>
+
+namespace boost { namespace serialization {
+
+template <class Archive, class T, std::size_t N>
+void serialize(Archive& ar, std::array<T,N>& a, const unsigned int /* version */)
+{
+ ar & boost::serialization::make_nvp(
+ "elems",
+ *static_cast<T (*)[N]>(static_cast<void *>(a.data()))
+ );
+
+}
+} } // end namespace boost::serialization
+
+#endif // BOOST_NO_CXX11_HDR_ARRAY
+
+#endif //BOOST_SERIALIZATION_ARRAY_HPP
diff --git a/include/boost/serialization/array_optimization.hpp b/include/boost/serialization/array_optimization.hpp
new file mode 100644
index 0000000..40dffba
--- /dev/null
+++ b/include/boost/serialization/array_optimization.hpp
@@ -0,0 +1,37 @@
+#ifndef BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP
+#define BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP
+
+// (C) Copyright 2005 Matthias Troyer and Dave Abrahams
+// 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)
+
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+
+#include <boost/mpl/always.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/type_traits/remove_const.hpp>
+
+namespace boost { namespace serialization {
+
+template <class Archive>
+struct use_array_optimization : boost::mpl::always<boost::mpl::false_> {};
+
+} } // end namespace boost::serialization
+
+#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) \
+namespace boost { namespace serialization { \
+template <> struct use_array_optimization<Archive> { \
+ template <class ValueType> \
+ struct apply : boost::mpl::apply1<Archive::use_array_optimization \
+ , typename boost::remove_const<ValueType>::type \
+ >::type {}; \
+}; }}
+
+#endif //BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP
diff --git a/include/boost/serialization/array_wrapper.hpp b/include/boost/serialization/array_wrapper.hpp
new file mode 100644
index 0000000..adf436e
--- /dev/null
+++ b/include/boost/serialization/array_wrapper.hpp
@@ -0,0 +1,121 @@
+#ifndef BOOST_SERIALIZATION_ARRAY_WRAPPER_HPP
+#define BOOST_SERIALIZATION_ARRAY_WRAPPER_HPP
+
+// (C) Copyright 2005 Matthias Troyer and Dave Abrahams
+// 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)
+
+//#include <iostream>
+
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/split_member.hpp>
+#include <boost/serialization/wrapper.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/array_optimization.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/bool_fwd.hpp>
+#include <boost/type_traits/remove_const.hpp>
+
+namespace boost { namespace serialization {
+
+template<class T>
+class array_wrapper :
+ public wrapper_traits<const array_wrapper< T > >
+{
+private:
+ array_wrapper & operator=(const array_wrapper & rhs);
+ // note: I would like to make the copy constructor private but this breaks
+ // make_array. So I make make_array a friend
+ template<class Tx, class S>
+ friend const boost::serialization::array_wrapper<Tx> make_array(Tx * t, S s);
+public:
+
+ array_wrapper(const array_wrapper & rhs) :
+ m_t(rhs.m_t),
+ m_element_count(rhs.m_element_count)
+ {}
+public:
+ array_wrapper(T * t, std::size_t s) :
+ m_t(t),
+ m_element_count(s)
+ {}
+
+ // default implementation
+ template<class Archive>
+ void serialize_optimized(Archive &ar, const unsigned int, mpl::false_ ) const
+ {
+ // default implemention does the loop
+ std::size_t c = count();
+ T * t = address();
+ while(0 < c--)
+ ar & boost::serialization::make_nvp("item", *t++);
+ }
+
+ // optimized implementation
+ template<class Archive>
+ void serialize_optimized(Archive &ar, const unsigned int version, mpl::true_ )
+ {
+ boost::serialization::split_member(ar, *this, version);
+ }
+
+ // default implementation
+ template<class Archive>
+ void save(Archive &ar, const unsigned int version) const
+ {
+ ar.save_array(*this,version);
+ }
+
+ // default implementation
+ template<class Archive>
+ void load(Archive &ar, const unsigned int version)
+ {
+ ar.load_array(*this,version);
+ }
+
+ // default implementation
+ template<class Archive>
+ void serialize(Archive &ar, const unsigned int version)
+ {
+ typedef typename
+ boost::serialization::use_array_optimization<Archive>::template apply<
+ typename remove_const< T >::type
+ >::type use_optimized;
+ serialize_optimized(ar,version,use_optimized());
+ }
+
+ T * address() const
+ {
+ return m_t;
+ }
+
+ std::size_t count() const
+ {
+ return m_element_count;
+ }
+
+private:
+ T * const m_t;
+ const std::size_t m_element_count;
+};
+
+template<class T, class S>
+inline
+const array_wrapper< T > make_array(T* t, S s){
+ const array_wrapper< T > a(t, s);
+ return a;
+}
+
+} } // end namespace boost::serialization
+
+
+#endif //BOOST_SERIALIZATION_ARRAY_WRAPPER_HPP
diff --git a/include/boost/serialization/assume_abstract.hpp b/include/boost/serialization/assume_abstract.hpp
new file mode 100644
index 0000000..632f931
--- /dev/null
+++ b/include/boost/serialization/assume_abstract.hpp
@@ -0,0 +1,60 @@
+#ifndef BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
+#define BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// assume_abstract_class.hpp:
+
+// (C) Copyright 2008 Robert Ramey
+// 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.
+
+// this is useful for compilers which don't support the boost::is_abstract
+
+#include <boost/type_traits/is_abstract.hpp>
+#include <boost/mpl/bool_fwd.hpp>
+
+#ifndef BOOST_NO_IS_ABSTRACT
+
+// if there is an intrinsic is_abstract defined, we don't have to do anything
+#define BOOST_SERIALIZATION_ASSUME_ABSTRACT(T)
+
+// but forward to the "official" is_abstract
+namespace boost {
+namespace serialization {
+ template<class T>
+ struct is_abstract : boost::is_abstract< T > {} ;
+} // namespace serialization
+} // namespace boost
+
+#else
+// we have to "make" one
+
+namespace boost {
+namespace serialization {
+ template<class T>
+ struct is_abstract : boost::false_type {};
+} // namespace serialization
+} // namespace boost
+
+// define a macro to make explicit designation of this more transparent
+#define BOOST_SERIALIZATION_ASSUME_ABSTRACT(T) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct is_abstract< T > : boost::true_type {}; \
+template<> \
+struct is_abstract< const T > : boost::true_type {}; \
+}} \
+/**/
+
+#endif // BOOST_NO_IS_ABSTRACT
+
+#endif //BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
diff --git a/include/boost/serialization/base_object.hpp b/include/boost/serialization/base_object.hpp
new file mode 100644
index 0000000..1a82cec
--- /dev/null
+++ b/include/boost/serialization/base_object.hpp
@@ -0,0 +1,100 @@
+#ifndef BOOST_SERIALIZATION_BASE_OBJECT_HPP
+#define BOOST_SERIALIZATION_BASE_OBJECT_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// base_object.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// if no archive headers have been included this is a no op
+// this is to permit BOOST_EXPORT etc to be included in a
+// file declaration header
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/identity.hpp>
+
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+
+#include <boost/static_assert.hpp>
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/force_include.hpp>
+#include <boost/serialization/void_cast_fwd.hpp>
+
+namespace boost {
+namespace serialization {
+
+namespace detail
+{
+ // get the base type for a given derived type
+ // preserving the const-ness
+ template<class B, class D>
+ struct base_cast
+ {
+ typedef typename
+ mpl::if_<
+ is_const<D>,
+ const B,
+ B
+ >::type type;
+ BOOST_STATIC_ASSERT(is_const<type>::value == is_const<D>::value);
+ };
+
+ // only register void casts if the types are polymorphic
+ template<class Base, class Derived>
+ struct base_register
+ {
+ struct polymorphic {
+ static void const * invoke(){
+ Base const * const b = 0;
+ Derived const * const d = 0;
+ return & void_cast_register(d, b);
+ }
+ };
+ struct non_polymorphic {
+ static void const * invoke(){
+ return 0;
+ }
+ };
+ static void const * invoke(){
+ typedef typename mpl::eval_if<
+ is_polymorphic<Base>,
+ mpl::identity<polymorphic>,
+ mpl::identity<non_polymorphic>
+ >::type type;
+ return type::invoke();
+ }
+ };
+
+} // namespace detail
+template<class Base, class Derived>
+typename detail::base_cast<Base, Derived>::type &
+base_object(Derived &d)
+{
+ BOOST_STATIC_ASSERT(( is_base_and_derived<Base,Derived>::value));
+ BOOST_STATIC_ASSERT(! is_pointer<Derived>::value);
+ typedef typename detail::base_cast<Base, Derived>::type type;
+ detail::base_register<type, Derived>::invoke();
+ return access::cast_reference<type, Derived>(d);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_BASE_OBJECT_HPP
diff --git a/include/boost/serialization/binary_object.hpp b/include/boost/serialization/binary_object.hpp
new file mode 100644
index 0000000..5c9038e
--- /dev/null
+++ b/include/boost/serialization/binary_object.hpp
@@ -0,0 +1,79 @@
+#ifndef BOOST_SERIALIZATION_BINARY_OBJECT_HPP
+#define BOOST_SERIALIZATION_BINARY_OBJECT_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// nvp.hpp: interface for serialization system.
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/assert.hpp>
+
+#include <cstddef> // std::size_t
+#include <boost/config.hpp>
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+
+#include <boost/preprocessor/stringize.hpp>
+#include <boost/serialization/tracking.hpp>
+#include <boost/serialization/level.hpp>
+#include <boost/serialization/split_member.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/wrapper.hpp>
+
+namespace boost {
+namespace serialization {
+
+struct binary_object :
+ public wrapper_traits<nvp<const binary_object> >
+{
+ void const * m_t;
+ std::size_t m_size;
+ template<class Archive>
+ void save(Archive & ar, const unsigned int /* file_version */) const {
+ ar.save_binary(m_t, m_size);
+ }
+ template<class Archive>
+ void load(Archive & ar, const unsigned int /* file_version */) const {
+ ar.load_binary(const_cast<void *>(m_t), m_size);
+ }
+ BOOST_SERIALIZATION_SPLIT_MEMBER()
+ binary_object & operator=(const binary_object & rhs) {
+ m_t = rhs.m_t;
+ m_size = rhs.m_size;
+ return *this;
+ }
+ binary_object(const void * const t, std::size_t size) :
+ m_t(t),
+ m_size(size)
+ {}
+ binary_object(const binary_object & rhs) :
+ m_t(rhs.m_t),
+ m_size(rhs.m_size)
+ {}
+};
+
+// just a little helper to support the convention that all serialization
+// wrappers follow the naming convention make_xxxxx
+inline
+const binary_object
+make_binary_object(const void * t, std::size_t size){
+ return binary_object(t, size);
+}
+
+} // namespace serialization
+} // boost
+
+#endif // BOOST_SERIALIZATION_BINARY_OBJECT_HPP
diff --git a/include/boost/serialization/bitset.hpp b/include/boost/serialization/bitset.hpp
new file mode 100644
index 0000000..78f9bd7
--- /dev/null
+++ b/include/boost/serialization/bitset.hpp
@@ -0,0 +1,75 @@
+/*!
+ * \file bitset.hpp
+ * \brief Provides Boost.Serialization support for std::bitset
+ * \author Brian Ravnsgaard Riis
+ * \author Kenneth Riddile
+ * \date 16.09.2004, updated 04.03.2009
+ * \copyright 2004 Brian Ravnsgaard Riis
+ * \license Boost Software License 1.0
+ */
+#ifndef BOOST_SERIALIZATION_BITSET_HPP
+#define BOOST_SERIALIZATION_BITSET_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#include <bitset>
+#include <cstddef> // size_t
+
+#include <boost/config.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/string.hpp>
+#include <boost/serialization/nvp.hpp>
+
+namespace boost{
+namespace serialization{
+
+template <class Archive, std::size_t size>
+inline void save(
+ Archive & ar,
+ std::bitset<size> const & t,
+ const unsigned int /* version */
+){
+ const std::string bits = t.template to_string<
+ std::string::value_type,
+ std::string::traits_type,
+ std::string::allocator_type
+ >();
+ ar << BOOST_SERIALIZATION_NVP( bits );
+}
+
+template <class Archive, std::size_t size>
+inline void load(
+ Archive & ar,
+ std::bitset<size> & t,
+ const unsigned int /* version */
+){
+ std::string bits;
+ ar >> BOOST_SERIALIZATION_NVP( bits );
+ t = std::bitset<size>(bits);
+}
+
+template <class Archive, std::size_t size>
+inline void serialize(
+ Archive & ar,
+ std::bitset<size> & t,
+ const unsigned int version
+){
+ boost::serialization::split_free( ar, t, version );
+}
+
+// don't track bitsets since that would trigger tracking
+// all over the program - which probably would be a surprise.
+// also, tracking would be hard to implement since, we're
+// serialization a representation of the data rather than
+// the data itself.
+template <std::size_t size>
+struct tracking_level<std::bitset<size> >
+ : mpl::int_<track_never> {} ;
+
+} //serialization
+} //boost
+
+#endif // BOOST_SERIALIZATION_BITSET_HPP
diff --git a/include/boost/serialization/boost_array.hpp b/include/boost/serialization/boost_array.hpp
new file mode 100644
index 0000000..9e3e220
--- /dev/null
+++ b/include/boost/serialization/boost_array.hpp
@@ -0,0 +1,33 @@
+#ifndef BOOST_SERIALIZATION_BOOST_ARRAY_HPP
+#define BOOST_SERIALIZATION_BOOST_ARRAY_HPP
+
+// (C) Copyright 2005 Matthias Troyer and Dave Abrahams
+// 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)
+
+//#include <iostream>
+
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+
+#include <boost/serialization/nvp.hpp>
+#include <boost/array.hpp>
+
+namespace boost { namespace serialization {
+// implement serialization for boost::array
+template <class Archive, class T, std::size_t N>
+void serialize(Archive& ar, boost::array<T,N>& a, const unsigned int /* version */)
+{
+ ar & boost::serialization::make_nvp("elems", a.elems);
+}
+
+} } // end namespace boost::serialization
+
+
+#endif //BOOST_SERIALIZATION_BOOST_ARRAY_HPP
diff --git a/include/boost/serialization/boost_unordered_map.hpp b/include/boost/serialization/boost_unordered_map.hpp
new file mode 100644
index 0000000..8913b31
--- /dev/null
+++ b/include/boost/serialization/boost_unordered_map.hpp
@@ -0,0 +1,154 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_MAP_HPP
+#define BOOST_SERIALIZATION_UNORDERED_MAP_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
+// serialization/unordered_map.hpp:
+// serialization for stl unordered_map templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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 <boost/config.hpp>
+
+#include <boost/unordered_map.hpp>
+
+#include <boost/serialization/utility.hpp>
+#include <boost/serialization/unordered_collections_save_imp.hpp>
+#include <boost/serialization/unordered_collections_load_imp.hpp>
+#include <boost/serialization/archive_input_unordered_map.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const boost::unordered_map<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ boost::unordered_map<Key, HashFcn, EqualKey, Allocator>
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ boost::unordered_map<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ boost::unordered_map<Key, HashFcn, EqualKey, Allocator>,
+ boost::serialization::stl::archive_input_unordered_map<
+ Archive,
+ boost::unordered_map<Key, HashFcn, EqualKey, Allocator>
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ boost::unordered_map<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// unordered_multimap
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const boost::unordered_multimap<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ boost::unordered_multimap<Key, HashFcn, EqualKey, Allocator>
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ boost::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ boost::unordered_multimap<Key, HashFcn, EqualKey, Allocator>,
+ boost::serialization::stl::archive_input_unordered_multimap<
+ Archive,
+ boost::unordered_multimap<Key, HashFcn, EqualKey, Allocator>
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ boost::unordered_multimap<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_UNORDERED_MAP_HPP
diff --git a/include/boost/serialization/boost_unordered_set.hpp b/include/boost/serialization/boost_unordered_set.hpp
new file mode 100644
index 0000000..307c781
--- /dev/null
+++ b/include/boost/serialization/boost_unordered_set.hpp
@@ -0,0 +1,150 @@
+#ifndef BOOST_SERIALIZATION_BOOST_UNORDERED_SET_HPP
+#define BOOST_SERIALIZATION_BOOST_UNORDERED_SET_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
+// unordered_set.hpp: serialization for boost unordered_set templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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 <boost/config.hpp>
+
+#include <boost/unordered_set.hpp>
+
+#include <boost/serialization/unordered_collections_save_imp.hpp>
+#include <boost/serialization/unordered_collections_load_imp.hpp>
+#include <boost/serialization/archive_input_unordered_set.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const boost::unordered_set<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ boost::unordered_set<Key, HashFcn, EqualKey, Allocator>
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ boost::unordered_set<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ boost::unordered_set<Key, HashFcn, EqualKey, Allocator>,
+ boost::serialization::stl::archive_input_unordered_set<
+ Archive,
+ boost::unordered_set<Key, HashFcn, EqualKey, Allocator>
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ boost::unordered_set<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// unordered_multiset
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator>
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator>,
+ boost::serialization::stl::archive_input_unordered_multiset<
+ Archive,
+ boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator>
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ boost::unordered_multiset<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_BOOST_UNORDERED_SET_HPP
diff --git a/include/boost/serialization/collection_size_type.hpp b/include/boost/serialization/collection_size_type.hpp
new file mode 100644
index 0000000..2dd8fa7
--- /dev/null
+++ b/include/boost/serialization/collection_size_type.hpp
@@ -0,0 +1,62 @@
+#ifndef BOOST_SERIALIZATION_COLLECTION_SIZE_TYPE_HPP
+#define BOOST_SERIALIZATION_COLLECTION_SIZE_TYPE_HPP
+
+// (C) Copyright 2005 Matthias Troyer
+// 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)
+
+#include <cstddef> // size_t
+#include <boost/serialization/strong_typedef.hpp>
+#include <boost/serialization/level.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/is_bitwise_serializable.hpp>
+
+namespace boost {
+namespace serialization {
+
+//BOOST_STRONG_TYPEDEF(std::size_t, collection_size_type)
+
+class collection_size_type {
+private:
+ typedef std::size_t base_type;
+ base_type t;
+public:
+ collection_size_type(): t(0) {};
+ explicit collection_size_type(const std::size_t & t_) :
+ t(t_)
+ {}
+ collection_size_type(const collection_size_type & t_) :
+ t(t_.t)
+ {}
+ collection_size_type & operator=(const collection_size_type & rhs){
+ t = rhs.t;
+ return *this;
+ }
+ collection_size_type & operator=(const unsigned int & rhs){
+ t = rhs;
+ return *this;
+ }
+ // used for text output
+ operator base_type () const {
+ return t;
+ }
+ // used for text input
+ operator base_type & () {
+ return t;
+ }
+ bool operator==(const collection_size_type & rhs) const {
+ return t == rhs.t;
+ }
+ bool operator<(const collection_size_type & rhs) const {
+ return t < rhs.t;
+ }
+};
+
+
+} } // end namespace boost::serialization
+
+BOOST_CLASS_IMPLEMENTATION(collection_size_type, primitive_type)
+BOOST_IS_BITWISE_SERIALIZABLE(collection_size_type)
+
+#endif //BOOST_SERIALIZATION_COLLECTION_SIZE_TYPE_HPP
diff --git a/include/boost/serialization/collection_traits.hpp b/include/boost/serialization/collection_traits.hpp
new file mode 100644
index 0000000..3ec9401
--- /dev/null
+++ b/include/boost/serialization/collection_traits.hpp
@@ -0,0 +1,79 @@
+#ifndef BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP
+#define BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// collection_traits.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// This header assigns a level implemenation trait to a collection type
+// for all primitives. It is needed so that archives which are meant to be
+// portable don't write class information in the archive. Since, not all
+// compiles recognize the same set of primitive types, the possibility
+// exists for archives to be non-portable if class information for primitive
+// types is included. This is addressed by the following macros.
+#include <boost/config.hpp>
+//#include <boost/mpl/integral_c.hpp>
+#include <boost/mpl/integral_c_tag.hpp>
+
+#include <boost/cstdint.hpp>
+#include <boost/integer_traits.hpp>
+#include <climits> // ULONG_MAX
+#include <boost/serialization/level.hpp>
+
+#define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(T, C) \
+template<> \
+struct implementation_level< C < T > > { \
+ typedef mpl::integral_c_tag tag; \
+ typedef mpl::int_<object_serializable> type; \
+ BOOST_STATIC_CONSTANT(int, value = object_serializable); \
+}; \
+/**/
+
+#if defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_INTRINSIC_WCHAR_T)
+ #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C)
+#else
+ #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(wchar_t, C) \
+ /**/
+#endif
+
+#if defined(BOOST_HAS_LONG_LONG)
+ #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::long_long_type, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::ulong_long_type, C) \
+ /**/
+#else
+ #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C)
+#endif
+
+#define BOOST_SERIALIZATION_COLLECTION_TRAITS(C) \
+ namespace boost { namespace serialization { \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(bool, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(char, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed char, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned char, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed int, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned int, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed long, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned long, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(float, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(double, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned short, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed short, C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \
+ BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) \
+ } } \
+ /**/
+
+#endif // BOOST_SERIALIZATION_COLLECTION_TRAITS
diff --git a/include/boost/serialization/collections_load_imp.hpp b/include/boost/serialization/collections_load_imp.hpp
new file mode 100644
index 0000000..e042c0c
--- /dev/null
+++ b/include/boost/serialization/collections_load_imp.hpp
@@ -0,0 +1,106 @@
+#ifndef BOOST_SERIALIZATION_COLLECTIONS_LOAD_IMP_HPP
+#define BOOST_SERIALIZATION_COLLECTIONS_LOAD_IMP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#if defined(_MSC_VER) && (_MSC_VER <= 1020)
+# pragma warning (disable : 4786) // too long name, harmless warning
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// collections_load_imp.hpp: serialization for loading stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// helper function templates for serialization of collections
+
+#include <boost/assert.hpp>
+#include <cstddef> // size_t
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+#include <boost/detail/workaround.hpp>
+
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+#include <boost/serialization/detail/is_default_constructible.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost{
+namespace serialization {
+namespace stl {
+
+//////////////////////////////////////////////////////////////////////
+// implementation of serialization for STL containers
+//
+
+template<
+ class Archive,
+ class T
+>
+typename boost::enable_if<
+ typename detail::is_default_constructible<
+ typename T::value_type
+ >,
+ void
+>::type
+collection_load_impl(
+ Archive & ar,
+ T & t,
+ collection_size_type count,
+ item_version_type /*item_version*/
+){
+ t.resize(count);
+ typename T::iterator hint;
+ hint = t.begin();
+ while(count-- > 0){
+ ar >> boost::serialization::make_nvp("item", *hint++);
+ }
+}
+
+template<
+ class Archive,
+ class T
+>
+typename boost::disable_if<
+ typename detail::is_default_constructible<
+ typename T::value_type
+ >,
+ void
+>::type
+collection_load_impl(
+ Archive & ar,
+ T & t,
+ collection_size_type count,
+ item_version_type item_version
+){
+ t.clear();
+ while(count-- > 0){
+ detail::stack_construct<Archive, typename T::value_type> u(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ t.push_back(boost::move(u.reference()));
+ ar.reset_object_address(& t.back() , & u.reference());
+ }
+}
+
+} // namespace stl
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_COLLECTIONS_LOAD_IMP_HPP
diff --git a/include/boost/serialization/collections_save_imp.hpp b/include/boost/serialization/collections_save_imp.hpp
new file mode 100644
index 0000000..5ada155
--- /dev/null
+++ b/include/boost/serialization/collections_save_imp.hpp
@@ -0,0 +1,83 @@
+#ifndef BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP
+#define BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// collections_save_imp.hpp: serialization for stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// helper function templates for serialization of collections
+
+#include <boost/config.hpp>
+#include <boost/core/addressof.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/serialization.hpp>
+#include <boost/serialization/version.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+namespace boost{
+namespace serialization {
+namespace stl {
+
+//////////////////////////////////////////////////////////////////////
+// implementation of serialization for STL containers
+//
+
+template<class Archive, class Container>
+inline void save_collection(
+ Archive & ar,
+ const Container &s,
+ collection_size_type count)
+{
+ ar << BOOST_SERIALIZATION_NVP(count);
+ // record number of elements
+ const item_version_type item_version(
+ version<typename Container::value_type>::value
+ );
+ #if 0
+ boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ if(boost::archive::library_version_type(3) < library_version){
+ ar << BOOST_SERIALIZATION_NVP(item_version);
+ }
+ #else
+ ar << BOOST_SERIALIZATION_NVP(item_version);
+ #endif
+
+ typename Container::const_iterator it = s.begin();
+ while(count-- > 0){
+ // note borland emits a no-op without the explicit namespace
+ boost::serialization::save_construct_data_adl(
+ ar,
+ boost::addressof(*it),
+ item_version
+ );
+ ar << boost::serialization::make_nvp("item", *it++);
+ }
+}
+
+template<class Archive, class Container>
+inline void save_collection(Archive & ar, const Container &s)
+{
+ // record number of elements
+ collection_size_type count(s.size());
+ save_collection(ar, s, count);
+}
+
+} // namespace stl
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP
diff --git a/include/boost/serialization/complex.hpp b/include/boost/serialization/complex.hpp
new file mode 100644
index 0000000..b4ef44c
--- /dev/null
+++ b/include/boost/serialization/complex.hpp
@@ -0,0 +1,81 @@
+#ifndef BOOST_SERIALIZATION_COMPLEX_HPP
+#define BOOST_SERIALIZATION_COMPLEX_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization/utility.hpp:
+// serialization for stl utility templates
+
+// (C) Copyright 2007 Matthias Troyer .
+// 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 <complex>
+#include <boost/config.hpp>
+
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/is_bitwise_serializable.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ std::complex< T > & t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ std::complex< T > const & t,
+ const unsigned int /* file_version */
+){
+ const T re = t.real();
+ const T im = t.imag();
+ ar << boost::serialization::make_nvp("real", re);
+ ar << boost::serialization::make_nvp("imag", im);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ std::complex< T >& t,
+ const unsigned int /* file_version */
+){
+ T re;
+ T im;
+ ar >> boost::serialization::make_nvp("real", re);
+ ar >> boost::serialization::make_nvp("imag", im);
+ t = std::complex< T >(re,im);
+}
+
+// specialization of serialization traits for complex
+template <class T>
+struct is_bitwise_serializable<std::complex< T > >
+ : public is_bitwise_serializable< T > {};
+
+template <class T>
+struct implementation_level<std::complex< T > >
+ : mpl::int_<object_serializable> {} ;
+
+// treat complex just like builtin arithmetic types for tracking
+template <class T>
+struct tracking_level<std::complex< T > >
+ : mpl::int_<track_never> {} ;
+
+} // serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_COMPLEX_HPP
diff --git a/include/boost/serialization/config.hpp b/include/boost/serialization/config.hpp
new file mode 100644
index 0000000..ea8cb92
--- /dev/null
+++ b/include/boost/serialization/config.hpp
@@ -0,0 +1,74 @@
+#ifndef BOOST_SERIALIZATION_CONFIG_HPP
+#define BOOST_SERIALIZATION_CONFIG_HPP
+
+// config.hpp ---------------------------------------------//
+
+// (c) Copyright Robert Ramey 2004
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See library home page at http://www.boost.org/libs/serialization
+
+//----------------------------------------------------------------------------//
+
+// This header implements separate compilation features as described in
+// http://www.boost.org/more/separate_compilation.html
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+// note: this version incorporates the related code into the the
+// the same library as BOOST_ARCHIVE. This could change some day in the
+// future
+
+// if BOOST_SERIALIZATION_DECL is defined undefine it now:
+#ifdef BOOST_SERIALIZATION_DECL
+ #undef BOOST_SERIALIZATION_DECL
+#endif
+
+// we need to import/export our code only if the user has specifically
+// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
+// libraries to be dynamically linked, or BOOST_SERIALIZATION_DYN_LINK
+// if they want just this one to be dynamically liked:
+#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
+ #if !defined(BOOST_DYN_LINK)
+ #define BOOST_DYN_LINK
+ #endif
+ // export if this is our own source, otherwise import:
+ #if defined(BOOST_SERIALIZATION_SOURCE)
+ #define BOOST_SERIALIZATION_DECL BOOST_SYMBOL_EXPORT
+ #else
+ #define BOOST_SERIALIZATION_DECL BOOST_SYMBOL_IMPORT
+ #endif // defined(BOOST_SERIALIZATION_SOURCE)
+#endif // defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
+
+// if BOOST_SERIALIZATION_DECL isn't defined yet define it now:
+#ifndef BOOST_SERIALIZATION_DECL
+ #define BOOST_SERIALIZATION_DECL
+#endif
+
+// enable automatic library variant selection ------------------------------//
+
+#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SERIALIZATION_NO_LIB) \
+&& !defined(BOOST_ARCHIVE_SOURCE) && !defined(BOOST_WARCHIVE_SOURCE) \
+&& !defined(BOOST_SERIALIZATION_SOURCE)
+ //
+ // Set the name of our library, this will get undef'ed by auto_link.hpp
+ // once it's done with it:
+ //
+ #define BOOST_LIB_NAME boost_serialization
+ //
+ // If we're importing code from a dll, then tell auto_link.hpp about it:
+ //
+ #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
+ # define BOOST_DYN_LINK
+ #endif
+ //
+ // And include the header that does the work:
+ //
+ #include <boost/config/auto_link.hpp>
+
+#endif
+
+#endif // BOOST_SERIALIZATION_CONFIG_HPP
diff --git a/include/boost/serialization/deque.hpp b/include/boost/serialization/deque.hpp
new file mode 100644
index 0000000..bba8136
--- /dev/null
+++ b/include/boost/serialization/deque.hpp
@@ -0,0 +1,80 @@
+#ifndef BOOST_SERIALIZATION_DEQUE_HPP
+#define BOOST_SERIALIZATION_DEQUE_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// deque.hpp
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <deque>
+
+#include <boost/config.hpp>
+
+#include <boost/archive/basic_archive.hpp>
+
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/collections_load_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class U, class Allocator>
+inline void save(
+ Archive & ar,
+ const std::deque<U, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ boost::serialization::stl::save_collection<
+ Archive, std::deque<U, Allocator>
+ >(ar, t);
+}
+
+template<class Archive, class U, class Allocator>
+inline void load(
+ Archive & ar,
+ std::deque<U, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ const boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ item_version_type item_version(0);
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ stl::collection_load_impl(ar, t, count, item_version);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class U, class Allocator>
+inline void serialize(
+ Archive & ar,
+ std::deque<U, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(std::deque)
+
+#endif // BOOST_SERIALIZATION_DEQUE_HPP
diff --git a/include/boost/serialization/detail/is_default_constructible.hpp b/include/boost/serialization/detail/is_default_constructible.hpp
new file mode 100644
index 0000000..4d20b13
--- /dev/null
+++ b/include/boost/serialization/detail/is_default_constructible.hpp
@@ -0,0 +1,54 @@
+#ifndef BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP
+#define BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// is_default_constructible.hpp: serialization for loading stl collections
+//
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+
+#if ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
+ #include <type_traits>
+ namespace boost{
+ namespace serialization {
+ namespace detail {
+
+ template<typename T>
+ struct is_default_constructible : public std::is_default_constructible<T> {};
+
+ } // detail
+ } // serializaition
+ } // boost
+#else
+ // we don't have standard library support for is_default_constructible
+ // so we fake it by using boost::has_trivial_construtor. But this is not
+ // actually correct because it's possible that a default constructor
+ // to be non trivial. So when using this, make sure you're not using your
+ // own definition of of T() but are using the actual default one!
+ #include <boost/type_traits/has_trivial_constructor.hpp>
+ namespace boost{
+ namespace serialization {
+ namespace detail {
+
+ template<typename T>
+ struct is_default_constructible : public boost::has_trivial_constructor<T> {};
+
+ } // detail
+ } // serializaition
+ } // boost
+
+#endif
+
+
+#endif // BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP
diff --git a/include/boost/serialization/detail/shared_count_132.hpp b/include/boost/serialization/detail/shared_count_132.hpp
new file mode 100644
index 0000000..a587255
--- /dev/null
+++ b/include/boost/serialization/detail/shared_count_132.hpp
@@ -0,0 +1,551 @@
+#ifndef BOOST_DETAIL_SHARED_COUNT_132_HPP_INCLUDED
+#define BOOST_DETAIL_SHARED_COUNT_132_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+//
+// detail/shared_count.hpp
+//
+// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd.
+//
+// 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>
+
+#if defined(BOOST_SP_USE_STD_ALLOCATOR) && defined(BOOST_SP_USE_QUICK_ALLOCATOR)
+# error BOOST_SP_USE_STD_ALLOCATOR and BOOST_SP_USE_QUICK_ALLOCATOR are incompatible.
+#endif
+
+#include <boost/checked_delete.hpp>
+#include <boost/serialization/throw_exception.hpp>
+#include <boost/detail/lightweight_mutex.hpp>
+
+#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
+#include <boost/detail/quick_allocator.hpp>
+#endif
+
+#include <memory> // std::auto_ptr, std::allocator
+#include <functional> // std::less
+#include <exception> // std::exception
+#include <new> // std::bad_alloc
+#include <typeinfo> // std::type_info in get_deleter
+#include <cstddef> // std::size_t
+
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+
+namespace boost_132 {
+
+// Debug hooks
+
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+
+void sp_scalar_constructor_hook(void * px, std::size_t size, void * pn);
+void sp_array_constructor_hook(void * px);
+void sp_scalar_destructor_hook(void * px, std::size_t size, void * pn);
+void sp_array_destructor_hook(void * px);
+
+#endif
+
+
+// The standard library that comes with Borland C++ 5.5.1
+// defines std::exception and its members as having C calling
+// convention (-pc). When the definition of bad_weak_ptr
+// is compiled with -ps, the compiler issues an error.
+// Hence, the temporary #pragma option -pc below. The version
+// check is deliberately conservative.
+
+class bad_weak_ptr: public std::exception
+{
+public:
+
+ virtual char const * what() const throw()
+ {
+ return "boost::bad_weak_ptr";
+ }
+};
+
+namespace detail{
+
+class sp_counted_base
+{
+//private:
+
+ typedef boost::detail::lightweight_mutex mutex_type;
+
+public:
+
+ sp_counted_base(): use_count_(1), weak_count_(1)
+ {
+ }
+
+ virtual ~sp_counted_base() // nothrow
+ {
+ }
+
+ // dispose() is called when use_count_ drops to zero, to release
+ // the resources managed by *this.
+
+ virtual void dispose() = 0; // nothrow
+
+ // destruct() is called when weak_count_ drops to zero.
+
+ virtual void destruct() // nothrow
+ {
+ delete this;
+ }
+
+ virtual void * get_deleter(std::type_info const & ti) = 0;
+
+ void add_ref_copy()
+ {
+#if defined(BOOST_HAS_THREADS)
+ mutex_type::scoped_lock lock(mtx_);
+#endif
+ ++use_count_;
+ }
+
+ void add_ref_lock()
+ {
+#if defined(BOOST_HAS_THREADS)
+ mutex_type::scoped_lock lock(mtx_);
+#endif
+ if(use_count_ == 0) boost::serialization::throw_exception(bad_weak_ptr());
+ ++use_count_;
+ }
+
+ void release() // nothrow
+ {
+ {
+#if defined(BOOST_HAS_THREADS)
+ mutex_type::scoped_lock lock(mtx_);
+#endif
+ long new_use_count = --use_count_;
+
+ if(new_use_count != 0) return;
+ }
+
+ dispose();
+ weak_release();
+ }
+
+ void weak_add_ref() // nothrow
+ {
+#if defined(BOOST_HAS_THREADS)
+ mutex_type::scoped_lock lock(mtx_);
+#endif
+ ++weak_count_;
+ }
+
+ void weak_release() // nothrow
+ {
+ long new_weak_count;
+
+ {
+#if defined(BOOST_HAS_THREADS)
+ mutex_type::scoped_lock lock(mtx_);
+#endif
+ new_weak_count = --weak_count_;
+ }
+
+ if(new_weak_count == 0)
+ {
+ destruct();
+ }
+ }
+
+ long use_count() const // nothrow
+ {
+#if defined(BOOST_HAS_THREADS)
+ mutex_type::scoped_lock lock(mtx_);
+#endif
+ return use_count_;
+ }
+
+//private:
+public:
+ sp_counted_base(sp_counted_base const &);
+ sp_counted_base & operator= (sp_counted_base const &);
+
+ long use_count_; // #shared
+ long weak_count_; // #weak + (#shared != 0)
+
+#if defined(BOOST_HAS_THREADS) || defined(BOOST_LWM_WIN32)
+ mutable mutex_type mtx_;
+#endif
+};
+
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+
+template<class T> void cbi_call_constructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &)
+{
+ boost::sp_scalar_constructor_hook(px, sizeof(T), pn);
+}
+
+template<class T> void cbi_call_constructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &)
+{
+ boost::sp_array_constructor_hook(px);
+}
+
+template<class P, class D> void cbi_call_constructor_hook(sp_counted_base *, P const &, D const &, long)
+{
+}
+
+template<class T> void cbi_call_destructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &)
+{
+ boost::sp_scalar_destructor_hook(px, sizeof(T), pn);
+}
+
+template<class T> void cbi_call_destructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &)
+{
+ boost::sp_array_destructor_hook(px);
+}
+
+template<class P, class D> void cbi_call_destructor_hook(sp_counted_base *, P const &, D const &, long)
+{
+}
+
+#endif
+
+//
+// Borland's Codeguard trips up over the -Vx- option here:
+//
+#ifdef __CODEGUARD__
+# pragma option push -Vx-
+#endif
+
+template<class P, class D> class sp_counted_base_impl: public sp_counted_base
+{
+//private:
+public:
+ P ptr; // copy constructor must not throw
+ D del; // copy constructor must not throw
+
+ sp_counted_base_impl(sp_counted_base_impl const &);
+ sp_counted_base_impl & operator= (sp_counted_base_impl const &);
+
+ typedef sp_counted_base_impl<P, D> this_type;
+
+public:
+
+ // pre: initial_use_count <= initial_weak_count, d(p) must not throw
+
+ sp_counted_base_impl(P p, D d): ptr(p), del(d)
+ {
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ detail::cbi_call_constructor_hook(this, p, d, 0);
+#endif
+ }
+
+ virtual void dispose() // nothrow
+ {
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ detail::cbi_call_destructor_hook(this, ptr, del, 0);
+#endif
+ del(ptr);
+ }
+
+ virtual void * get_deleter(std::type_info const & ti)
+ {
+ return ti == typeid(D)? &del: 0;
+ }
+
+#if defined(BOOST_SP_USE_STD_ALLOCATOR)
+
+ void * operator new(std::size_t)
+ {
+ return std::allocator<this_type>().allocate(1, static_cast<this_type *>(0));
+ }
+
+ void operator delete(void * p)
+ {
+ std::allocator<this_type>().deallocate(static_cast<this_type *>(p), 1);
+ }
+
+#endif
+
+#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
+
+ void * operator new(std::size_t)
+ {
+ return boost::detail::quick_allocator<this_type>::alloc();
+ }
+
+ void operator delete(void * p)
+ {
+ boost::detail::quick_allocator<this_type>::dealloc(p);
+ }
+
+#endif
+};
+
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+
+int const shared_count_id = 0x2C35F101;
+int const weak_count_id = 0x298C38A4;
+
+#endif
+
+class weak_count;
+
+class shared_count
+{
+//private:
+public:
+ sp_counted_base * pi_;
+
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ int id_;
+#endif
+
+ friend class weak_count;
+
+public:
+
+ shared_count(): pi_(0) // nothrow
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(shared_count_id)
+#endif
+ {
+ }
+
+ template<class P, class D> shared_count(P p, D d): pi_(0)
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(shared_count_id)
+#endif
+ {
+#ifndef BOOST_NO_EXCEPTIONS
+
+ try
+ {
+ pi_ = new sp_counted_base_impl<P, D>(p, d);
+ }
+ catch(...)
+ {
+ d(p); // delete p
+ throw;
+ }
+
+#else
+
+ pi_ = new sp_counted_base_impl<P, D>(p, d);
+
+ if(pi_ == 0)
+ {
+ d(p); // delete p
+ boost::serialization::throw_exception(std::bad_alloc());
+ }
+
+#endif
+ }
+
+#ifndef BOOST_NO_AUTO_PTR
+
+ // auto_ptr<Y> is special cased to provide the strong guarantee
+
+ template<class Y>
+ explicit shared_count(std::auto_ptr<Y> & r): pi_(
+ new sp_counted_base_impl<
+ Y *,
+ boost::checked_deleter<Y>
+ >(r.get(), boost::checked_deleter<Y>()))
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(shared_count_id)
+#endif
+ {
+ r.release();
+ }
+
+#endif
+
+ ~shared_count() // nothrow
+ {
+ if(pi_ != 0) pi_->release();
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ id_ = 0;
+#endif
+ }
+
+ shared_count(shared_count const & r): pi_(r.pi_) // nothrow
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(shared_count_id)
+#endif
+ {
+ if(pi_ != 0) pi_->add_ref_copy();
+ }
+
+ explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
+
+ shared_count & operator= (shared_count const & r) // nothrow
+ {
+ sp_counted_base * tmp = r.pi_;
+
+ if(tmp != pi_)
+ {
+ if(tmp != 0) tmp->add_ref_copy();
+ if(pi_ != 0) pi_->release();
+ pi_ = tmp;
+ }
+
+ return *this;
+ }
+
+ void swap(shared_count & r) // nothrow
+ {
+ sp_counted_base * tmp = r.pi_;
+ r.pi_ = pi_;
+ pi_ = tmp;
+ }
+
+ long use_count() const // nothrow
+ {
+ return pi_ != 0? pi_->use_count(): 0;
+ }
+
+ bool unique() const // nothrow
+ {
+ return use_count() == 1;
+ }
+
+ friend inline bool operator==(shared_count const & a, shared_count const & b)
+ {
+ return a.pi_ == b.pi_;
+ }
+
+ friend inline bool operator<(shared_count const & a, shared_count const & b)
+ {
+ return std::less<sp_counted_base *>()(a.pi_, b.pi_);
+ }
+
+ void * get_deleter(std::type_info const & ti) const
+ {
+ return pi_? pi_->get_deleter(ti): 0;
+ }
+};
+
+#ifdef __CODEGUARD__
+# pragma option pop
+#endif
+
+
+class weak_count
+{
+private:
+
+ sp_counted_base * pi_;
+
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ int id_;
+#endif
+
+ friend class shared_count;
+
+public:
+
+ weak_count(): pi_(0) // nothrow
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(weak_count_id)
+#endif
+ {
+ }
+
+ weak_count(shared_count const & r): pi_(r.pi_) // nothrow
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(shared_count_id)
+#endif
+ {
+ if(pi_ != 0) pi_->weak_add_ref();
+ }
+
+ weak_count(weak_count const & r): pi_(r.pi_) // nothrow
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(shared_count_id)
+#endif
+ {
+ if(pi_ != 0) pi_->weak_add_ref();
+ }
+
+ ~weak_count() // nothrow
+ {
+ if(pi_ != 0) pi_->weak_release();
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ id_ = 0;
+#endif
+ }
+
+ weak_count & operator= (shared_count const & r) // nothrow
+ {
+ sp_counted_base * tmp = r.pi_;
+ if(tmp != 0) tmp->weak_add_ref();
+ if(pi_ != 0) pi_->weak_release();
+ pi_ = tmp;
+
+ return *this;
+ }
+
+ weak_count & operator= (weak_count const & r) // nothrow
+ {
+ sp_counted_base * tmp = r.pi_;
+ if(tmp != 0) tmp->weak_add_ref();
+ if(pi_ != 0) pi_->weak_release();
+ pi_ = tmp;
+
+ return *this;
+ }
+
+ void swap(weak_count & r) // nothrow
+ {
+ sp_counted_base * tmp = r.pi_;
+ r.pi_ = pi_;
+ pi_ = tmp;
+ }
+
+ long use_count() const // nothrow
+ {
+ return pi_ != 0? pi_->use_count(): 0;
+ }
+
+ friend inline bool operator==(weak_count const & a, weak_count const & b)
+ {
+ return a.pi_ == b.pi_;
+ }
+
+ friend inline bool operator<(weak_count const & a, weak_count const & b)
+ {
+ return std::less<sp_counted_base *>()(a.pi_, b.pi_);
+ }
+};
+
+inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(shared_count_id)
+#endif
+{
+ if(pi_ != 0)
+ {
+ pi_->add_ref_lock();
+ }
+ else
+ {
+ boost::serialization::throw_exception(bad_weak_ptr());
+ }
+}
+
+} // namespace detail
+
+} // namespace boost
+
+BOOST_SERIALIZATION_ASSUME_ABSTRACT(boost_132::detail::sp_counted_base)
+
+#endif // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
diff --git a/include/boost/serialization/detail/shared_ptr_132.hpp b/include/boost/serialization/detail/shared_ptr_132.hpp
new file mode 100644
index 0000000..ee98b7b
--- /dev/null
+++ b/include/boost/serialization/detail/shared_ptr_132.hpp
@@ -0,0 +1,443 @@
+#ifndef BOOST_SHARED_PTR_132_HPP_INCLUDED
+#define BOOST_SHARED_PTR_132_HPP_INCLUDED
+
+//
+// shared_ptr.hpp
+//
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002, 2003 Peter Dimov
+//
+// 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)
+//
+// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
+//
+
+#include <boost/config.hpp> // for broken compiler workarounds
+
+#if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
+#include <boost/serialization/detail/shared_ptr_nmt_132.hpp>
+#else
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+#include <boost/serialization/throw_exception.hpp>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/detail/shared_count_132.hpp>
+
+#include <memory> // for std::auto_ptr
+#include <algorithm> // for std::swap
+#include <functional> // for std::less
+#include <typeinfo> // for std::bad_cast
+#include <iosfwd> // for std::basic_ostream
+
+#ifdef BOOST_MSVC // moved here to work around VC++ compiler crash
+# pragma warning(push)
+# pragma warning(disable:4284) // odd return type for operator->
+#endif
+
+namespace boost_132 {
+
+template<class T> class weak_ptr;
+template<class T> class enable_shared_from_this;
+
+namespace detail
+{
+
+struct static_cast_tag {};
+struct const_cast_tag {};
+struct dynamic_cast_tag {};
+struct polymorphic_cast_tag {};
+
+template<class T> struct shared_ptr_traits
+{
+ typedef T & reference;
+};
+
+template<> struct shared_ptr_traits<void>
+{
+ typedef void reference;
+};
+
+#if !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
+
+template<> struct shared_ptr_traits<void const>
+{
+ typedef void reference;
+};
+
+template<> struct shared_ptr_traits<void volatile>
+{
+ typedef void reference;
+};
+
+template<> struct shared_ptr_traits<void const volatile>
+{
+ typedef void reference;
+};
+
+#endif
+
+// enable_shared_from_this support
+
+template<class T, class Y> void sp_enable_shared_from_this( shared_count const & pn, enable_shared_from_this< T > const * pe, Y const * px )
+{
+ if(pe != 0) pe->_internal_weak_this._internal_assign(const_cast<Y*>(px), pn);
+}
+
+inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... )
+{
+}
+
+} // namespace detail
+
+
+//
+// shared_ptr
+//
+// An enhanced relative of scoped_ptr with reference counted copy semantics.
+// The object pointed to is deleted when the last shared_ptr pointing to it
+// is destroyed or reset.
+//
+
+template<class T> class shared_ptr
+{
+private:
+ // Borland 5.5.1 specific workaround
+ typedef shared_ptr< T > this_type;
+
+public:
+
+ typedef T element_type;
+ typedef T value_type;
+ typedef T * pointer;
+ typedef typename detail::shared_ptr_traits< T >::reference reference;
+
+ shared_ptr(): px(0), pn() // never throws in 1.30+
+ {
+ }
+
+ template<class Y>
+ explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter<Y>()) // Y must be complete
+ {
+ detail::sp_enable_shared_from_this( pn, p, p );
+ }
+
+ //
+ // Requirements: D's copy constructor must not throw
+ //
+ // shared_ptr will release p by calling d(p)
+ //
+
+ template<class Y, class D> shared_ptr(Y * p, D d): px(p), pn(p, d)
+ {
+ detail::sp_enable_shared_from_this( pn, p, p );
+ }
+
+// generated copy constructor, assignment, destructor are fine...
+
+// except that Borland C++ has a bug, and g++ with -Wsynth warns
+#if defined(__GNUC__)
+ shared_ptr & operator=(shared_ptr const & r) // never throws
+ {
+ px = r.px;
+ pn = r.pn; // shared_count::op= doesn't throw
+ return *this;
+ }
+#endif
+
+ template<class Y>
+ explicit shared_ptr(weak_ptr<Y> const & r): pn(r.pn) // may throw
+ {
+ // it is now safe to copy r.px, as pn(r.pn) did not throw
+ px = r.px;
+ }
+
+ template<class Y>
+ shared_ptr(shared_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
+ {
+ }
+
+ template<class Y>
+ shared_ptr(shared_ptr<Y> const & r, detail::static_cast_tag): px(static_cast<element_type *>(r.px)), pn(r.pn)
+ {
+ }
+
+ template<class Y>
+ shared_ptr(shared_ptr<Y> const & r, detail::const_cast_tag): px(const_cast<element_type *>(r.px)), pn(r.pn)
+ {
+ }
+
+ template<class Y>
+ shared_ptr(shared_ptr<Y> const & r, detail::dynamic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
+ {
+ if(px == 0) // need to allocate new counter -- the cast failed
+ {
+ pn = detail::shared_count();
+ }
+ }
+
+ template<class Y>
+ shared_ptr(shared_ptr<Y> const & r, detail::polymorphic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
+ {
+ if(px == 0)
+ {
+ boost::serialization::throw_exception(std::bad_cast());
+ }
+ }
+
+#ifndef BOOST_NO_AUTO_PTR
+
+ template<class Y>
+ explicit shared_ptr(std::auto_ptr<Y> & r): px(r.get()), pn()
+ {
+ Y * tmp = r.get();
+ pn = detail::shared_count(r);
+ detail::sp_enable_shared_from_this( pn, tmp, tmp );
+ }
+
+#endif
+
+#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200)
+
+ template<class Y>
+ shared_ptr & operator=(shared_ptr<Y> const & r) // never throws
+ {
+ px = r.px;
+ pn = r.pn; // shared_count::op= doesn't throw
+ return *this;
+ }
+
+#endif
+
+#ifndef BOOST_NO_AUTO_PTR
+
+ template<class Y>
+ shared_ptr & operator=(std::auto_ptr<Y> & r)
+ {
+ this_type(r).swap(*this);
+ return *this;
+ }
+
+#endif
+
+ void reset() // never throws in 1.30+
+ {
+ this_type().swap(*this);
+ }
+
+ template<class Y> void reset(Y * p) // Y must be complete
+ {
+ BOOST_ASSERT(p == 0 || p != px); // catch self-reset errors
+ this_type(p).swap(*this);
+ }
+
+ template<class Y, class D> void reset(Y * p, D d)
+ {
+ this_type(p, d).swap(*this);
+ }
+
+ reference operator* () const // never throws
+ {
+ BOOST_ASSERT(px != 0);
+ return *px;
+ }
+
+ T * operator-> () const // never throws
+ {
+ BOOST_ASSERT(px != 0);
+ return px;
+ }
+
+ T * get() const // never throws
+ {
+ return px;
+ }
+
+ // implicit conversion to "bool"
+
+#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
+
+ operator bool () const
+ {
+ return px != 0;
+ }
+
+#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ typedef T * (this_type::*unspecified_bool_type)() const;
+
+ operator unspecified_bool_type() const // never throws
+ {
+ return px == 0? 0: &this_type::get;
+ }
+
+#else
+
+ typedef T * this_type::*unspecified_bool_type;
+
+ operator unspecified_bool_type() const // never throws
+ {
+ return px == 0? 0: &this_type::px;
+ }
+
+#endif
+
+ // operator! is redundant, but some compilers need it
+
+ bool operator! () const // never throws
+ {
+ return px == 0;
+ }
+
+ bool unique() const // never throws
+ {
+ return pn.unique();
+ }
+
+ long use_count() const // never throws
+ {
+ return pn.use_count();
+ }
+
+ void swap(shared_ptr< T > & other) // never throws
+ {
+ std::swap(px, other.px);
+ pn.swap(other.pn);
+ }
+
+ template<class Y> bool _internal_less(shared_ptr<Y> const & rhs) const
+ {
+ return pn < rhs.pn;
+ }
+
+ void * _internal_get_deleter(std::type_info const & ti) const
+ {
+ return pn.get_deleter(ti);
+ }
+
+// Tasteless as this may seem, making all members public allows member templates
+// to work in the absence of member template friends. (Matthew Langston)
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+
+private:
+
+ template<class Y> friend class shared_ptr;
+ template<class Y> friend class weak_ptr;
+
+
+#endif
+public: // for serialization
+ T * px; // contained pointer
+ detail::shared_count pn; // reference counter
+
+}; // shared_ptr
+
+template<class T, class U> inline bool operator==(shared_ptr< T > const & a, shared_ptr<U> const & b)
+{
+ return a.get() == b.get();
+}
+
+template<class T, class U> inline bool operator!=(shared_ptr< T > const & a, shared_ptr<U> const & b)
+{
+ return a.get() != b.get();
+}
+
+template<class T, class U> inline bool operator<(shared_ptr< T > const & a, shared_ptr<U> const & b)
+{
+ return a._internal_less(b);
+}
+
+template<class T> inline void swap(shared_ptr< T > & a, shared_ptr< T > & b)
+{
+ a.swap(b);
+}
+
+template<class T, class U> shared_ptr< T > static_pointer_cast(shared_ptr<U> const & r)
+{
+ return shared_ptr< T >(r, detail::static_cast_tag());
+}
+
+template<class T, class U> shared_ptr< T > const_pointer_cast(shared_ptr<U> const & r)
+{
+ return shared_ptr< T >(r, detail::const_cast_tag());
+}
+
+template<class T, class U> shared_ptr< T > dynamic_pointer_cast(shared_ptr<U> const & r)
+{
+ return shared_ptr< T >(r, detail::dynamic_cast_tag());
+}
+
+// shared_*_cast names are deprecated. Use *_pointer_cast instead.
+
+template<class T, class U> shared_ptr< T > shared_static_cast(shared_ptr<U> const & r)
+{
+ return shared_ptr< T >(r, detail::static_cast_tag());
+}
+
+template<class T, class U> shared_ptr< T > shared_dynamic_cast(shared_ptr<U> const & r)
+{
+ return shared_ptr< T >(r, detail::dynamic_cast_tag());
+}
+
+template<class T, class U> shared_ptr< T > shared_polymorphic_cast(shared_ptr<U> const & r)
+{
+ return shared_ptr< T >(r, detail::polymorphic_cast_tag());
+}
+
+template<class T, class U> shared_ptr< T > shared_polymorphic_downcast(shared_ptr<U> const & r)
+{
+ BOOST_ASSERT(dynamic_cast<T *>(r.get()) == r.get());
+ return shared_static_cast< T >(r);
+}
+
+// get_pointer() enables boost::mem_fn to recognize shared_ptr
+
+template<class T> inline T * get_pointer(shared_ptr< T > const & p)
+{
+ return p.get();
+}
+
+// operator<<
+
+
+template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, shared_ptr<Y> const & p)
+{
+ os << p.get();
+ return os;
+}
+
+// get_deleter (experimental)
+
+#if defined(__EDG_VERSION__) && (__EDG_VERSION__ <= 238)
+
+// g++ 2.9x doesn't allow static_cast<X const *>(void *)
+// apparently EDG 2.38 also doesn't accept it
+
+template<class D, class T> D * get_deleter(shared_ptr< T > const & p)
+{
+ void const * q = p._internal_get_deleter(typeid(D));
+ return const_cast<D *>(static_cast<D const *>(q));
+}
+
+#else
+
+template<class D, class T> D * get_deleter(shared_ptr< T > const & p)
+{
+ return static_cast<D *>(p._internal_get_deleter(typeid(D)));
+}
+
+#endif
+
+} // namespace boost
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+#endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
+
+#endif // #ifndef BOOST_SHARED_PTR_132_HPP_INCLUDED
diff --git a/include/boost/serialization/detail/shared_ptr_nmt_132.hpp b/include/boost/serialization/detail/shared_ptr_nmt_132.hpp
new file mode 100644
index 0000000..490e7dd
--- /dev/null
+++ b/include/boost/serialization/detail/shared_ptr_nmt_132.hpp
@@ -0,0 +1,182 @@
+#ifndef BOOST_DETAIL_SHARED_PTR_NMT_132_HPP_INCLUDED
+#define BOOST_DETAIL_SHARED_PTR_NMT_132_HPP_INCLUDED
+
+//
+// detail/shared_ptr_nmt.hpp - shared_ptr.hpp without member templates
+//
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002 Peter Dimov
+//
+// 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)
+//
+// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
+//
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+#include <boost/serialization/throw_exception.hpp>
+#include <boost/detail/atomic_count.hpp>
+
+#ifndef BOOST_NO_AUTO_PTR
+# include <memory> // for std::auto_ptr
+#endif
+
+#include <algorithm> // for std::swap
+#include <functional> // for std::less
+#include <new> // for std::bad_alloc
+
+namespace boost
+{
+
+template<class T> class shared_ptr
+{
+private:
+
+ typedef detail::atomic_count count_type;
+
+public:
+
+ typedef T element_type;
+ typedef T value_type;
+
+ explicit shared_ptr(T * p = 0): px(p)
+ {
+#ifndef BOOST_NO_EXCEPTIONS
+
+ try // prevent leak if new throws
+ {
+ pn = new count_type(1);
+ }
+ catch(...)
+ {
+ boost::checked_delete(p);
+ throw;
+ }
+
+#else
+
+ pn = new count_type(1);
+
+ if(pn == 0)
+ {
+ boost::checked_delete(p);
+ boost::serialization::throw_exception(std::bad_alloc());
+ }
+
+#endif
+ }
+
+ ~shared_ptr()
+ {
+ if(--*pn == 0)
+ {
+ boost::checked_delete(px);
+ delete pn;
+ }
+ }
+
+ shared_ptr(shared_ptr const & r): px(r.px) // never throws
+ {
+ pn = r.pn;
+ ++*pn;
+ }
+
+ shared_ptr & operator=(shared_ptr const & r)
+ {
+ shared_ptr(r).swap(*this);
+ return *this;
+ }
+
+#ifndef BOOST_NO_AUTO_PTR
+
+ explicit shared_ptr(std::auto_ptr< T > & r)
+ {
+ pn = new count_type(1); // may throw
+ px = r.release(); // fix: moved here to stop leak if new throws
+ }
+
+ shared_ptr & operator=(std::auto_ptr< T > & r)
+ {
+ shared_ptr(r).swap(*this);
+ return *this;
+ }
+
+#endif
+
+ void reset(T * p = 0)
+ {
+ BOOST_ASSERT(p == 0 || p != px);
+ shared_ptr(p).swap(*this);
+ }
+
+ T & operator*() const // never throws
+ {
+ BOOST_ASSERT(px != 0);
+ return *px;
+ }
+
+ T * operator->() const // never throws
+ {
+ BOOST_ASSERT(px != 0);
+ return px;
+ }
+
+ T * get() const // never throws
+ {
+ return px;
+ }
+
+ long use_count() const // never throws
+ {
+ return *pn;
+ }
+
+ bool unique() const // never throws
+ {
+ return *pn == 1;
+ }
+
+ void swap(shared_ptr< T > & other) // never throws
+ {
+ std::swap(px, other.px);
+ std::swap(pn, other.pn);
+ }
+
+private:
+
+ T * px; // contained pointer
+ count_type * pn; // ptr to reference counter
+};
+
+template<class T, class U> inline bool operator==(shared_ptr< T > const & a, shared_ptr<U> const & b)
+{
+ return a.get() == b.get();
+}
+
+template<class T, class U> inline bool operator!=(shared_ptr< T > const & a, shared_ptr<U> const & b)
+{
+ return a.get() != b.get();
+}
+
+template<class T> inline bool operator<(shared_ptr< T > const & a, shared_ptr< T > const & b)
+{
+ return std::less<T*>()(a.get(), b.get());
+}
+
+template<class T> void swap(shared_ptr< T > & a, shared_ptr< T > & b)
+{
+ a.swap(b);
+}
+
+// get_pointer() enables boost::mem_fn to recognize shared_ptr
+
+template<class T> inline T * get_pointer(shared_ptr< T > const & p)
+{
+ return p.get();
+}
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_SHARED_PTR_NMT_132_HPP_INCLUDED
diff --git a/include/boost/serialization/detail/stack_constructor.hpp b/include/boost/serialization/detail/stack_constructor.hpp
new file mode 100644
index 0000000..ae14832
--- /dev/null
+++ b/include/boost/serialization/detail/stack_constructor.hpp
@@ -0,0 +1,66 @@
+#ifndef BOOST_SERIALIZATION_DETAIL_STACK_CONSTRUCTOR_HPP
+#define BOOST_SERIALIZATION_DETAIL_STACK_CONSTRUCTOR_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// stack_constructor.hpp: serialization for loading stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/aligned_storage.hpp>
+#include <boost/serialization/serialization.hpp>
+
+namespace boost{
+namespace serialization {
+namespace detail {
+
+// reserve space on stack for an object of type T without actually
+// construction such an object
+template<typename T >
+struct stack_allocate
+{
+ T * address() {
+ return static_cast<T*>(storage_.address());
+ }
+ T & reference() {
+ return * address();
+ }
+private:
+ typedef typename boost::aligned_storage<
+ sizeof(T),
+ boost::alignment_of<T>::value
+ > type;
+ type storage_;
+};
+
+// construct element on the stack
+template<class Archive, class T>
+struct stack_construct : public stack_allocate<T>
+{
+ stack_construct(Archive & ar, const unsigned int version){
+ // note borland emits a no-op without the explicit namespace
+ boost::serialization::load_construct_data_adl(
+ ar,
+ this->address(),
+ version
+ );
+ }
+ ~stack_construct(){
+ this->address()->~T(); // undo load_construct_data above
+ }
+};
+
+} // detail
+} // serializaition
+} // boost
+
+#endif // BOOST_SERIALIZATION_DETAIL_STACH_CONSTRUCTOR_HPP
diff --git a/include/boost/serialization/ephemeral.hpp b/include/boost/serialization/ephemeral.hpp
new file mode 100644
index 0000000..3a422c3
--- /dev/null
+++ b/include/boost/serialization/ephemeral.hpp
@@ -0,0 +1,72 @@
+#ifndef BOOST_SERIALIZATION_EPHEMERAL_HPP
+#define BOOST_SERIALIZATION_EPHEMERAL_HPP
+
+// MS compatible compilers support
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// ephemeral_object.hpp: interface for serialization system.
+
+// (C) Copyright 2007 Matthias Troyer.
+// 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 <utility>
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/mpl/integral_c.hpp>
+#include <boost/mpl/integral_c_tag.hpp>
+
+#include <boost/serialization/level.hpp>
+#include <boost/serialization/tracking.hpp>
+#include <boost/serialization/split_member.hpp>
+#include <boost/serialization/base_object.hpp>
+#include <boost/serialization/traits.hpp>
+#include <boost/serialization/wrapper.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class T>
+struct ephemeral_object :
+ public wrapper_traits<ephemeral_object<T> >
+{
+ explicit ephemeral_object(T& t) :
+ val(t)
+ {}
+
+ T & value() const {
+ return val;
+ }
+
+ const T & const_value() const {
+ return val;
+ }
+
+ template<class Archive>
+ void serialize(Archive &ar, const unsigned int) const
+ {
+ ar & val;
+ }
+
+private:
+ T & val;
+};
+
+template<class T>
+inline
+const ephemeral_object<T> ephemeral(const char * name, T & t){
+ return ephemeral_object<T>(name, t);
+}
+
+} // seralization
+} // boost
+
+#endif // BOOST_SERIALIZATION_EPHEMERAL_HPP
diff --git a/include/boost/serialization/export.hpp b/include/boost/serialization/export.hpp
new file mode 100644
index 0000000..9eef440
--- /dev/null
+++ b/include/boost/serialization/export.hpp
@@ -0,0 +1,225 @@
+#ifndef BOOST_SERIALIZATION_EXPORT_HPP
+#define BOOST_SERIALIZATION_EXPORT_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// export.hpp: set traits of classes to be serialized
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// (C) Copyright 2006 David Abrahams - http://www.boost.org.
+// implementation of class export functionality. This is an alternative to
+// "forward declaration" method to provoke instantiation of derived classes
+// that are to be serialized through pointers.
+
+#include <utility>
+#include <cstddef> // NULL
+
+#include <boost/config.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/preprocessor/stringize.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/bool_fwd.hpp>
+
+#include <boost/serialization/extended_type_info.hpp> // for guid_defined only
+#include <boost/serialization/static_warning.hpp>
+#include <boost/serialization/assume_abstract.hpp>
+#include <boost/serialization/force_include.hpp>
+#include <boost/serialization/singleton.hpp>
+
+#include <boost/archive/detail/register_archive.hpp>
+
+#include <iostream>
+
+namespace boost {
+namespace archive {
+namespace detail {
+
+class basic_pointer_iserializer;
+class basic_pointer_oserializer;
+
+template<class Archive, class T>
+class pointer_iserializer;
+template<class Archive, class T>
+class pointer_oserializer;
+
+template <class Archive, class Serializable>
+struct export_impl
+{
+ static const basic_pointer_iserializer &
+ enable_load(mpl::true_){
+ return boost::serialization::singleton<
+ pointer_iserializer<Archive, Serializable>
+ >::get_const_instance();
+ }
+
+ static const basic_pointer_oserializer &
+ enable_save(mpl::true_){
+ return boost::serialization::singleton<
+ pointer_oserializer<Archive, Serializable>
+ >::get_const_instance();
+ }
+ inline static void enable_load(mpl::false_) {}
+ inline static void enable_save(mpl::false_) {}
+};
+
+// On many platforms, naming a specialization of this template is
+// enough to cause its argument to be instantiated.
+template <void(*)()>
+struct instantiate_function {};
+
+template <class Archive, class Serializable>
+struct ptr_serialization_support
+{
+# if defined(BOOST_MSVC) || defined(__SUNPRO_CC)
+ virtual BOOST_DLLEXPORT void instantiate() BOOST_USED;
+# else
+ static BOOST_DLLEXPORT void instantiate() BOOST_USED;
+ typedef instantiate_function<
+ &ptr_serialization_support::instantiate
+ > x;
+# endif
+};
+
+template <class Archive, class Serializable>
+BOOST_DLLEXPORT void
+ptr_serialization_support<Archive,Serializable>::instantiate()
+{
+ export_impl<Archive,Serializable>::enable_save(
+ typename Archive::is_saving()
+ );
+
+ export_impl<Archive,Serializable>::enable_load(
+ typename Archive::is_loading()
+ );
+}
+
+// Note INTENTIONAL usage of anonymous namespace in header.
+// This was made this way so that export.hpp could be included
+// in other headers. This is still under study.
+
+namespace extra_detail {
+
+template<class T>
+struct guid_initializer
+{
+ void export_guid(mpl::false_) const {
+ // generates the statically-initialized objects whose constructors
+ // register the information allowing serialization of T objects
+ // through pointers to their base classes.
+ instantiate_ptr_serialization((T*)0, 0, adl_tag());
+ }
+ void export_guid(mpl::true_) const {
+ }
+ guid_initializer const & export_guid() const {
+ BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value);
+ // note: exporting an abstract base class will have no effect
+ // and cannot be used to instantitiate serialization code
+ // (one might be using this in a DLL to instantiate code)
+ //BOOST_STATIC_WARNING(! boost::serialization::is_abstract< T >::value);
+ export_guid(boost::serialization::is_abstract< T >());
+ return *this;
+ }
+};
+
+template<typename T>
+struct init_guid;
+
+} // anonymous
+} // namespace detail
+} // namespace archive
+} // namespace boost
+
+#define BOOST_CLASS_EXPORT_IMPLEMENT(T) \
+ namespace boost { \
+ namespace archive { \
+ namespace detail { \
+ namespace extra_detail { \
+ template<> \
+ struct init_guid< T > { \
+ static guid_initializer< T > const & g; \
+ }; \
+ guid_initializer< T > const & init_guid< T >::g = \
+ ::boost::serialization::singleton< \
+ guid_initializer< T > \
+ >::get_mutable_instance().export_guid(); \
+ }}}} \
+/**/
+
+#define BOOST_CLASS_EXPORT_KEY2(T, K) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct guid_defined< T > : boost::mpl::true_ {}; \
+template<> \
+inline const char * guid< T >(){ \
+ return K; \
+} \
+} /* serialization */ \
+} /* boost */ \
+/**/
+
+#define BOOST_CLASS_EXPORT_KEY(T) \
+ BOOST_CLASS_EXPORT_KEY2(T, BOOST_PP_STRINGIZE(T)) \
+/**/
+
+#define BOOST_CLASS_EXPORT_GUID(T, K) \
+BOOST_CLASS_EXPORT_KEY2(T, K) \
+BOOST_CLASS_EXPORT_IMPLEMENT(T) \
+/**/
+
+#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
+
+// CodeWarrior fails to construct static members of class templates
+// when they are instantiated from within templates, so on that
+// compiler we ask users to specifically register base/derived class
+// relationships for exported classes. On all other compilers, use of
+// this macro is entirely optional.
+# define BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(Base,Derived) \
+namespace { \
+ static int BOOST_PP_CAT(boost_serialization_mwerks_init_, __LINE__) = \
+ (::boost::archive::detail::instantiate_ptr_serialization((Derived*)0,0), 3); \
+ static int BOOST_PP_CAT(boost_serialization_mwerks_init2_, __LINE__) = ( \
+ ::boost::serialization::void_cast_register((Derived*)0,(Base*)0) \
+ , 3); \
+}
+
+#else
+
+# define BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(Base,Derived)
+
+#endif
+
+// check for unnecessary export. T isn't polymorphic so there is no
+// need to export it.
+#define BOOST_CLASS_EXPORT_CHECK(T) \
+ BOOST_STATIC_WARNING( \
+ boost::is_polymorphic<U>::value \
+ ); \
+ /**/
+
+// the default exportable class identifier is the class name
+// the default list of archives types for which code id generated
+// are the originally included with this serialization system
+#define BOOST_CLASS_EXPORT(T) \
+ BOOST_CLASS_EXPORT_GUID( \
+ T, \
+ BOOST_PP_STRINGIZE(T) \
+ ) \
+ /**/
+
+#endif // BOOST_SERIALIZATION_EXPORT_HPP
+
diff --git a/include/boost/serialization/extended_type_info.hpp b/include/boost/serialization/extended_type_info.hpp
new file mode 100644
index 0000000..bb2a190
--- /dev/null
+++ b/include/boost/serialization/extended_type_info.hpp
@@ -0,0 +1,116 @@
+#ifndef BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP
+#define BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// extended_type_info.hpp: interface for portable version of type_info
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// for now, extended type info is part of the serialization libraries
+// this could change in the future.
+#include <cstdarg>
+#include <boost/assert.hpp>
+#include <cstddef> // NULL
+#include <boost/config.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/mpl/bool.hpp>
+
+#include <boost/serialization/config.hpp>
+#include <boost/config/abi_prefix.hpp> // must be the last header
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4251 4231 4660 4275)
+#endif
+
+#define BOOST_SERIALIZATION_MAX_KEY_SIZE 128
+
+namespace boost {
+namespace serialization {
+
+namespace void_cast_detail{
+ class void_caster;
+}
+
+class BOOST_SYMBOL_VISIBLE extended_type_info :
+ private boost::noncopyable
+{
+private:
+ friend class boost::serialization::void_cast_detail::void_caster;
+
+ // used to uniquely identify the type of class derived from this one
+ // so that different derivations of this class can be simultaneously
+ // included in implementation of sets and maps.
+ const unsigned int m_type_info_key;
+ virtual bool is_less_than(const extended_type_info & /*rhs*/) const = 0;
+ virtual bool is_equal(const extended_type_info & /*rhs*/) const = 0;
+ const char * m_key;
+
+protected:
+ BOOST_SERIALIZATION_DECL void key_unregister() const;
+ BOOST_SERIALIZATION_DECL void key_register() const;
+ // this class can't be used as is. It's just the
+ // common functionality for all type_info replacement
+ // systems. Hence, make these protected
+ BOOST_SERIALIZATION_DECL extended_type_info(
+ const unsigned int type_info_key,
+ const char * key
+ );
+ virtual BOOST_SERIALIZATION_DECL ~extended_type_info();
+public:
+ const char * get_key() const {
+ return m_key;
+ }
+ virtual const char * get_debug_info() const = 0;
+ BOOST_SERIALIZATION_DECL bool operator<(const extended_type_info &rhs) const;
+ BOOST_SERIALIZATION_DECL bool operator==(const extended_type_info &rhs) const;
+ bool operator!=(const extended_type_info &rhs) const {
+ return !(operator==(rhs));
+ }
+ // note explicit "export" of static function to work around
+ // gcc 4.5 mingw error
+ static BOOST_SERIALIZATION_DECL const extended_type_info *
+ find(const char *key);
+ // for plugins
+ virtual void * construct(unsigned int /*count*/ = 0, ...) const = 0;
+ virtual void destroy(void const * const /*p*/) const = 0;
+};
+
+template<class T>
+struct guid_defined : boost::mpl::false_ {};
+
+namespace ext {
+ template <typename T>
+ struct guid_impl
+ {
+ static inline const char * call()
+ {
+ return NULL;
+ }
+ };
+}
+
+template<class T>
+inline const char * guid(){
+ return ext::guid_impl<T>::call();
+}
+
+} // namespace serialization
+} // namespace boost
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
+#endif // BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP
diff --git a/include/boost/serialization/extended_type_info_no_rtti.hpp b/include/boost/serialization/extended_type_info_no_rtti.hpp
new file mode 100644
index 0000000..aaa8b44
--- /dev/null
+++ b/include/boost/serialization/extended_type_info_no_rtti.hpp
@@ -0,0 +1,182 @@
+#ifndef BOOST_EXTENDED_TYPE_INFO_NO_RTTI_HPP
+#define BOOST_EXTENDED_TYPE_INFO_NO_RTTI_HPP
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+// extended_type_info_no_rtti.hpp: implementation for version that depends
+// on runtime typing (rtti - typeid) but uses a user specified string
+// as the portable class identifier.
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+#include <boost/assert.hpp>
+
+#include <boost/config.hpp>
+#include <boost/static_assert.hpp>
+
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+#include <boost/type_traits/remove_const.hpp>
+
+#include <boost/serialization/static_warning.hpp>
+#include <boost/serialization/singleton.hpp>
+#include <boost/serialization/extended_type_info.hpp>
+#include <boost/serialization/factory.hpp>
+#include <boost/serialization/throw_exception.hpp>
+
+#include <boost/serialization/config.hpp>
+// hijack serialization access
+#include <boost/serialization/access.hpp>
+
+#include <boost/config/abi_prefix.hpp> // must be the last header
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4251 4231 4660 4275 4511 4512)
+#endif
+
+namespace boost {
+namespace serialization {
+///////////////////////////////////////////////////////////////////////
+// define a special type_info that doesn't depend on rtti which is not
+// available in all situations.
+
+namespace no_rtti_system {
+
+// common base class to share type_info_key. This is used to
+// identify the method used to keep track of the extended type
+class BOOST_SYMBOL_VISIBLE extended_type_info_no_rtti_0 :
+ public extended_type_info
+{
+protected:
+ BOOST_SERIALIZATION_DECL extended_type_info_no_rtti_0(const char * key);
+ BOOST_SERIALIZATION_DECL ~extended_type_info_no_rtti_0();
+public:
+ virtual BOOST_SERIALIZATION_DECL bool
+ is_less_than(const boost::serialization::extended_type_info &rhs) const ;
+ virtual BOOST_SERIALIZATION_DECL bool
+ is_equal(const boost::serialization::extended_type_info &rhs) const ;
+};
+
+} // no_rtti_system
+
+template<class T>
+class extended_type_info_no_rtti :
+ public no_rtti_system::extended_type_info_no_rtti_0,
+ public singleton<extended_type_info_no_rtti< T > >
+{
+ template<bool tf>
+ struct action {
+ struct defined {
+ static const char * invoke(){
+ return guid< T >();
+ }
+ };
+ struct undefined {
+ // if your program traps here - you failed to
+ // export a guid for this type. the no_rtti
+ // system requires export for types serialized
+ // as pointers.
+ BOOST_STATIC_ASSERT(0 == sizeof(T));
+ static const char * invoke();
+ };
+ static const char * invoke(){
+ typedef
+ typename boost::mpl::if_c<
+ tf,
+ defined,
+ undefined
+ >::type type;
+ return type::invoke();
+ }
+ };
+public:
+ extended_type_info_no_rtti() :
+ no_rtti_system::extended_type_info_no_rtti_0(get_key())
+ {
+ key_register();
+ }
+ ~extended_type_info_no_rtti(){
+ key_unregister();
+ }
+ const extended_type_info *
+ get_derived_extended_type_info(const T & t) const {
+ // find the type that corresponds to the most derived type.
+ // this implementation doesn't depend on typeid() but assumes
+ // that the specified type has a function of the following signature.
+ // A common implemention of such a function is to define as a virtual
+ // function. So if the is not a polymporphic type it's likely an error
+ BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value);
+ const char * derived_key = t.get_key();
+ BOOST_ASSERT(NULL != derived_key);
+ return boost::serialization::extended_type_info::find(derived_key);
+ }
+ const char * get_key() const{
+ return action<guid_defined< T >::value >::invoke();
+ }
+ virtual const char * get_debug_info() const{
+ return action<guid_defined< T >::value >::invoke();
+ }
+ virtual void * construct(unsigned int count, ...) const{
+ // count up the arguments
+ std::va_list ap;
+ va_start(ap, count);
+ switch(count){
+ case 0:
+ return factory<typename boost::remove_const< T >::type, 0>(ap);
+ case 1:
+ return factory<typename boost::remove_const< T >::type, 1>(ap);
+ case 2:
+ return factory<typename boost::remove_const< T >::type, 2>(ap);
+ case 3:
+ return factory<typename boost::remove_const< T >::type, 3>(ap);
+ case 4:
+ return factory<typename boost::remove_const< T >::type, 4>(ap);
+ default:
+ BOOST_ASSERT(false); // too many arguments
+ // throw exception here?
+ return NULL;
+ }
+ }
+ virtual void destroy(void const * const p) const{
+ boost::serialization::access::destroy(
+ static_cast<T const *>(p)
+ );
+ //delete static_cast<T const * const>(p) ;
+ }
+};
+
+} // namespace serialization
+} // namespace boost
+
+///////////////////////////////////////////////////////////////////////////////
+// If no other implementation has been designated as default,
+// use this one. To use this implementation as the default, specify it
+// before any of the other headers.
+
+#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
+ #define BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
+ namespace boost {
+ namespace serialization {
+ template<class T>
+ struct extended_type_info_impl {
+ typedef typename
+ boost::serialization::extended_type_info_no_rtti< T > type;
+ };
+ } // namespace serialization
+ } // namespace boost
+#endif
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
+#endif // BOOST_EXTENDED_TYPE_INFO_NO_RTTI_HPP
diff --git a/include/boost/serialization/extended_type_info_typeid.hpp b/include/boost/serialization/extended_type_info_typeid.hpp
new file mode 100644
index 0000000..8ee591b
--- /dev/null
+++ b/include/boost/serialization/extended_type_info_typeid.hpp
@@ -0,0 +1,167 @@
+#ifndef BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_TYPEID_HPP
+#define BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_TYPEID_HPP
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+// extended_type_info_typeid.hpp: implementation for version that depends
+// on runtime typing (rtti - typeid) but uses a user specified string
+// as the portable class identifier.
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <typeinfo>
+#include <cstdarg>
+#include <boost/assert.hpp>
+#include <boost/config.hpp>
+
+#include <boost/static_assert.hpp>
+#include <boost/serialization/static_warning.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+#include <boost/type_traits/remove_const.hpp>
+
+#include <boost/serialization/config.hpp>
+#include <boost/serialization/singleton.hpp>
+#include <boost/serialization/extended_type_info.hpp>
+#include <boost/serialization/factory.hpp>
+
+// hijack serialization access
+#include <boost/serialization/access.hpp>
+
+#include <boost/mpl/if.hpp>
+
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4251 4231 4660 4275 4511 4512)
+#endif
+
+namespace boost {
+namespace serialization {
+namespace typeid_system {
+
+class BOOST_SYMBOL_VISIBLE extended_type_info_typeid_0 :
+ public extended_type_info
+{
+ virtual const char * get_debug_info() const {
+ if(static_cast<const std::type_info *>(0) == m_ti)
+ return static_cast<const char *>(0);
+ return m_ti->name();
+ }
+protected:
+ const std::type_info * m_ti;
+ BOOST_SERIALIZATION_DECL extended_type_info_typeid_0(const char * key);
+ BOOST_SERIALIZATION_DECL ~extended_type_info_typeid_0();
+ BOOST_SERIALIZATION_DECL void type_register(const std::type_info & ti);
+ BOOST_SERIALIZATION_DECL void type_unregister();
+ BOOST_SERIALIZATION_DECL const extended_type_info *
+ get_extended_type_info(const std::type_info & ti) const;
+public:
+ virtual BOOST_SERIALIZATION_DECL bool
+ is_less_than(const extended_type_info &rhs) const;
+ virtual BOOST_SERIALIZATION_DECL bool
+ is_equal(const extended_type_info &rhs) const;
+ const std::type_info & get_typeid() const {
+ return *m_ti;
+ }
+};
+
+} // typeid_system
+
+template<class T>
+class extended_type_info_typeid :
+ public typeid_system::extended_type_info_typeid_0,
+ public singleton<extended_type_info_typeid< T > >
+{
+public:
+ extended_type_info_typeid() :
+ typeid_system::extended_type_info_typeid_0(
+ boost::serialization::guid< T >()
+ )
+ {
+ type_register(typeid(T));
+ key_register();
+ }
+ ~extended_type_info_typeid(){
+ key_unregister();
+ type_unregister();
+ }
+ // get the eti record for the true type of this record
+ // relying upon standard type info implemenation (rtti)
+ const extended_type_info *
+ get_derived_extended_type_info(const T & t) const {
+ // note: this implementation - based on usage of typeid (rtti)
+ // only does something if the class has at least one virtual function.
+ BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value);
+ return
+ typeid_system::extended_type_info_typeid_0::get_extended_type_info(
+ typeid(t)
+ );
+ }
+ const char * get_key() const {
+ return boost::serialization::guid< T >();
+ }
+ virtual void * construct(unsigned int count, ...) const{
+ // count up the arguments
+ std::va_list ap;
+ va_start(ap, count);
+ switch(count){
+ case 0:
+ return factory<typename boost::remove_const< T >::type, 0>(ap);
+ case 1:
+ return factory<typename boost::remove_const< T >::type, 1>(ap);
+ case 2:
+ return factory<typename boost::remove_const< T >::type, 2>(ap);
+ case 3:
+ return factory<typename boost::remove_const< T >::type, 3>(ap);
+ case 4:
+ return factory<typename boost::remove_const< T >::type, 4>(ap);
+ default:
+ BOOST_ASSERT(false); // too many arguments
+ // throw exception here?
+ return NULL;
+ }
+ }
+ virtual void destroy(void const * const p) const {
+ boost::serialization::access::destroy(
+ static_cast<T const *>(p)
+ );
+ //delete static_cast<T const * const>(p);
+ }
+};
+
+} // namespace serialization
+} // namespace boost
+
+///////////////////////////////////////////////////////////////////////////////
+// If no other implementation has been designated as default,
+// use this one. To use this implementation as the default, specify it
+// before any of the other headers.
+#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
+ #define BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
+ namespace boost {
+ namespace serialization {
+ template<class T>
+ struct extended_type_info_impl {
+ typedef typename
+ boost::serialization::extended_type_info_typeid< T > type;
+ };
+ } // namespace serialization
+ } // namespace boost
+#endif
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
+#endif // BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_TYPEID_HPP
diff --git a/include/boost/serialization/factory.hpp b/include/boost/serialization/factory.hpp
new file mode 100644
index 0000000..2db7e7e
--- /dev/null
+++ b/include/boost/serialization/factory.hpp
@@ -0,0 +1,102 @@
+#ifndef BOOST_SERIALIZATION_FACTORY_HPP
+#define BOOST_SERIALIZATION_FACTORY_HPP
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+// factory.hpp: create an instance from an extended_type_info instance.
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <cstdarg> // valist
+#include <cstddef> // NULL
+
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/comparison/greater.hpp>
+#include <boost/assert.hpp>
+
+namespace std{
+ #if defined(__LIBCOMO__)
+ using ::va_list;
+ #endif
+} // namespace std
+
+namespace boost {
+namespace serialization {
+
+// default implementation does nothing.
+template<class T, int N>
+T * factory(std::va_list){
+ BOOST_ASSERT(false);
+ // throw exception here?
+ return NULL;
+}
+
+} // namespace serialization
+} // namespace boost
+
+#define BOOST_SERIALIZATION_FACTORY(N, T, A0, A1, A2, A3) \
+namespace boost { \
+namespace serialization { \
+ template<> \
+ T * factory<T, N>(std::va_list ap){ \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 0) \
+ , A0 a0 = va_arg(ap, A0);, BOOST_PP_EMPTY()) \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 1) \
+ , A1 a1 = va_arg(ap, A1);, BOOST_PP_EMPTY()) \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 2) \
+ , A2 a2 = va_arg(ap, A2);, BOOST_PP_EMPTY()) \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 3) \
+ , A3 a3 = va_arg(ap, A3);, BOOST_PP_EMPTY()) \
+ return new T( \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 0) \
+ , a0, BOOST_PP_EMPTY()) \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 1)) \
+ , BOOST_PP_COMMA, BOOST_PP_EMPTY)() \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 1) \
+ , a1, BOOST_PP_EMPTY()) \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 2)) \
+ , BOOST_PP_COMMA, BOOST_PP_EMPTY)() \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 2) \
+ , a2, BOOST_PP_EMPTY()) \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 3)) \
+ , BOOST_PP_COMMA, BOOST_PP_EMPTY)() \
+ BOOST_PP_IF(BOOST_PP_GREATER(N, 3) \
+ , a3, BOOST_PP_EMPTY()) \
+ ); \
+ } \
+} \
+} /**/
+
+#define BOOST_SERIALIZATION_FACTORY_4(T, A0, A1, A2, A3) \
+ BOOST_SERIALIZATION_FACTORY(4, T, A0, A1, A2, A3)
+
+#define BOOST_SERIALIZATION_FACTORY_3(T, A0, A1, A2) \
+ BOOST_SERIALIZATION_FACTORY(3, T, A0, A1, A2, 0)
+
+#define BOOST_SERIALIZATION_FACTORY_2(T, A0, A1) \
+ BOOST_SERIALIZATION_FACTORY(2, T, A0, A1, 0, 0)
+
+#define BOOST_SERIALIZATION_FACTORY_1(T, A0) \
+ BOOST_SERIALIZATION_FACTORY(1, T, A0, 0, 0, 0)
+
+#define BOOST_SERIALIZATION_FACTORY_0(T) \
+namespace boost { \
+namespace serialization { \
+ template<> \
+ T * factory<T, 0>(std::va_list){ \
+ return new T(); \
+ } \
+} \
+} \
+/**/
+
+#endif // BOOST_SERIALIZATION_FACTORY_HPP
diff --git a/include/boost/serialization/force_include.hpp b/include/boost/serialization/force_include.hpp
new file mode 100644
index 0000000..55ab79d
--- /dev/null
+++ b/include/boost/serialization/force_include.hpp
@@ -0,0 +1,55 @@
+#ifndef BOOST_SERIALIZATION_FORCE_INCLUDE_HPP
+#define BOOST_SERIALIZATION_FORCE_INCLUDE_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// force_include.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+
+// the following help macro is to guarentee that certain coded
+// is not removed by over-eager linker optimiser. In certain cases
+// we create static objects must be created but are actually never
+// referenced - creation has a side-effect such as global registration
+// which is important to us. We make an effort to refer these objects
+// so that a smart linker won't remove them as being unreferenced.
+// In microsoft compilers, inlining the code that does the referring
+// means the code gets lost and the static object is not included
+// in the library and hence never registered. This manifests itself
+// in an ungraceful crash at runtime when (and only when) built in
+// release mode.
+
+#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__)
+# define BOOST_DLLEXPORT __declspec(dllexport)
+#elif ! defined(_WIN32) && ! defined(_WIN64)
+# if defined(__MWERKS__)
+# define BOOST_DLLEXPORT __declspec(dllexport)
+# elif defined(__GNUC__) && (__GNUC__ >= 3)
+# define BOOST_USED __attribute__ ((__used__))
+# elif defined(__IBMCPP__) && (__IBMCPP__ >= 1110)
+# define BOOST_USED __attribute__ ((__used__))
+# elif defined(__INTEL_COMPILER) && (BOOST_INTEL_CXX_VERSION >= 800)
+# define BOOST_USED __attribute__ ((__used__))
+# endif
+#endif
+
+#ifndef BOOST_USED
+# define BOOST_USED
+#endif
+
+#ifndef BOOST_DLLEXPORT
+# define BOOST_DLLEXPORT
+#endif
+
+#endif // BOOST_SERIALIZATION_FORCE_INCLUDE_HPP
diff --git a/include/boost/serialization/forward_list.hpp b/include/boost/serialization/forward_list.hpp
new file mode 100644
index 0000000..b8a3c20
--- /dev/null
+++ b/include/boost/serialization/forward_list.hpp
@@ -0,0 +1,124 @@
+#ifndef BOOST_SERIALIZATION_FORWARD_LIST_HPP
+#define BOOST_SERIALIZATION_FORWARD_LIST_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// forward_list.hpp
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+
+#include <forward_list>
+#include <iterator> // distance
+
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/collections_load_imp.hpp>
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+#include <boost/serialization/detail/is_default_constructible.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class U, class Allocator>
+inline void save(
+ Archive & ar,
+ const std::forward_list<U, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ const collection_size_type count(std::distance(t.cbegin(), t.cend()));
+ boost::serialization::stl::save_collection<
+ Archive,
+ std::forward_list<U, Allocator>
+ >(ar, t, count);
+}
+
+namespace stl {
+
+template<
+ class Archive,
+ class T,
+ class Allocator
+>
+typename boost::disable_if<
+ typename detail::is_default_constructible<
+ typename std::forward_list<T, Allocator>::value_type
+ >,
+ void
+>::type
+collection_load_impl(
+ Archive & ar,
+ std::forward_list<T, Allocator> &t,
+ collection_size_type count,
+ item_version_type item_version
+){
+ t.clear();
+ boost::serialization::detail::stack_construct<Archive, T> u(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ t.push_front(boost::move(u.reference()));
+ typename std::forward_list<T, Allocator>::iterator last;
+ last = t.begin();
+ ar.reset_object_address(&(*t.begin()) , & u.reference());
+ while(--count > 0){
+ detail::stack_construct<Archive, T> u(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ last = t.insert_after(last, boost::move(u.reference()));
+ ar.reset_object_address(&(*last) , & u.reference());
+ }
+}
+
+} // stl
+
+template<class Archive, class U, class Allocator>
+inline void load(
+ Archive & ar,
+ std::forward_list<U, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ const boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ item_version_type item_version(0);
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ stl::collection_load_impl(ar, t, count, item_version);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class U, class Allocator>
+inline void serialize(
+ Archive & ar,
+ std::forward_list<U, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(std::forward_list)
+
+#endif // BOOST_SERIALIZATION_FORWARD_LIST_HPP
diff --git a/include/boost/serialization/hash_collections_load_imp.hpp b/include/boost/serialization/hash_collections_load_imp.hpp
new file mode 100644
index 0000000..88def8f
--- /dev/null
+++ b/include/boost/serialization/hash_collections_load_imp.hpp
@@ -0,0 +1,77 @@
+#ifndef BOOST_SERIALIZATION_HASH_COLLECTIONS_LOAD_IMP_HPP
+#define BOOST_SERIALIZATION_HASH_COLLECTIONS_LOAD_IMP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+# pragma warning (disable : 4786) // too long name, harmless warning
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// hash_collections_load_imp.hpp: serialization for loading stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// helper function templates for serialization of hashed collections
+#include <boost/config.hpp>
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+namespace boost{
+namespace serialization {
+namespace stl {
+
+//////////////////////////////////////////////////////////////////////
+// implementation of serialization for STL containers
+//
+template<class Archive, class Container, class InputFunction>
+inline void load_hash_collection(Archive & ar, Container &s)
+{
+ collection_size_type count;
+ collection_size_type bucket_count;
+ boost::serialization::item_version_type item_version(0);
+ boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ if(boost::archive::library_version_type(6) != library_version){
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ ar >> BOOST_SERIALIZATION_NVP(bucket_count);
+ }
+ else{
+ // note: fixup for error in version 6. collection size was
+ // changed to size_t BUT for hashed collections it was implemented
+ // as an unsigned int. This should be a problem only on win64 machines
+ // but I'll leave it for everyone just in case.
+ unsigned int c;
+ unsigned int bc;
+ ar >> BOOST_SERIALIZATION_NVP(c);
+ count = c;
+ ar >> BOOST_SERIALIZATION_NVP(bc);
+ bucket_count = bc;
+ }
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ s.clear();
+ #if ! defined(__MWERKS__)
+ s.resize(bucket_count);
+ #endif
+ InputFunction ifunc;
+ while(count-- > 0){
+ ifunc(ar, s, item_version);
+ }
+}
+
+} // namespace stl
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_HASH_COLLECTIONS_LOAD_IMP_HPP
diff --git a/include/boost/serialization/hash_collections_save_imp.hpp b/include/boost/serialization/hash_collections_save_imp.hpp
new file mode 100644
index 0000000..65dfe83
--- /dev/null
+++ b/include/boost/serialization/hash_collections_save_imp.hpp
@@ -0,0 +1,97 @@
+#ifndef BOOST_SERIALIZATION_HASH_COLLECTIONS_SAVE_IMP_HPP
+#define BOOST_SERIALIZATION_HASH_COLLECTIONS_SAVE_IMP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// hash_collections_save_imp.hpp: serialization for stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// helper function templates for serialization of collections
+
+#include <boost/config.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/serialization.hpp>
+#include <boost/serialization/version.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+namespace boost{
+namespace serialization {
+namespace stl {
+
+//////////////////////////////////////////////////////////////////////
+// implementation of serialization for STL containers
+//
+
+template<class Archive, class Container>
+inline void save_hash_collection(Archive & ar, const Container &s)
+{
+ collection_size_type count(s.size());
+ const collection_size_type bucket_count(s.bucket_count());
+ const item_version_type item_version(
+ version<typename Container::value_type>::value
+ );
+
+ #if 0
+ /* should only be necessary to create archives of previous versions
+ * which is not currently supported. So for now comment this out
+ */
+ boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ if(boost::archive::library_version_type(6) != library_version){
+ ar << BOOST_SERIALIZATION_NVP(count);
+ ar << BOOST_SERIALIZATION_NVP(bucket_count);
+ }
+ else{
+ // note: fixup for error in version 6. collection size was
+ // changed to size_t BUT for hashed collections it was implemented
+ // as an unsigned int. This should be a problem only on win64 machines
+ // but I'll leave it for everyone just in case.
+ const unsigned int c = count;
+ const unsigned int bc = bucket_count;
+ ar << BOOST_SERIALIZATION_NVP(c);
+ ar << BOOST_SERIALIZATION_NVP(bc);
+ }
+ if(boost::archive::library_version_type(3) < library_version){
+ // record number of elements
+ // make sure the target type is registered so we can retrieve
+ // the version when we load
+ ar << BOOST_SERIALIZATION_NVP(item_version);
+ }
+ #else
+ ar << BOOST_SERIALIZATION_NVP(count);
+ ar << BOOST_SERIALIZATION_NVP(bucket_count);
+ ar << BOOST_SERIALIZATION_NVP(item_version);
+ #endif
+
+ typename Container::const_iterator it = s.begin();
+ while(count-- > 0){
+ // note borland emits a no-op without the explicit namespace
+ boost::serialization::save_construct_data_adl(
+ ar,
+ &(*it),
+ boost::serialization::version<
+ typename Container::value_type
+ >::value
+ );
+ ar << boost::serialization::make_nvp("item", *it++);
+ }
+}
+
+} // namespace stl
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_HASH_COLLECTIONS_SAVE_IMP_HPP
diff --git a/include/boost/serialization/hash_map.hpp b/include/boost/serialization/hash_map.hpp
new file mode 100644
index 0000000..22626db
--- /dev/null
+++ b/include/boost/serialization/hash_map.hpp
@@ -0,0 +1,232 @@
+#ifndef BOOST_SERIALIZATION_HASH_MAP_HPP
+#define BOOST_SERIALIZATION_HASH_MAP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization/hash_map.hpp:
+// serialization for stl hash_map templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+#ifdef BOOST_HAS_HASH
+#include BOOST_HASH_MAP_HEADER
+
+#include <boost/serialization/utility.hpp>
+#include <boost/serialization/hash_collections_save_imp.hpp>
+#include <boost/serialization/hash_collections_load_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+namespace serialization {
+
+namespace stl {
+
+// map input
+template<class Archive, class Container>
+struct archive_input_hash_map
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ std::pair<typename Container::const_iterator, bool> result =
+ s.insert(boost::move(t.reference()));
+ // note: the following presumes that the map::value_type was NOT tracked
+ // in the archive. This is the usual case, but here there is no way
+ // to determine that.
+ if(result.second){
+ ar.reset_object_address(
+ & (result.first->second),
+ & t.reference().second
+ );
+ }
+ }
+};
+
+// multimap input
+template<class Archive, class Container>
+struct archive_input_hash_multimap
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ typename Container::const_iterator result
+ = s.insert(boost::move(t.reference()));
+ // note: the following presumes that the map::value_type was NOT tracked
+ // in the archive. This is the usual case, but here there is no way
+ // to determine that.
+ ar.reset_object_address(
+ & result->second,
+ & t.reference()
+ );
+ }
+};
+
+} // stl
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const BOOST_STD_EXTENSION_NAMESPACE::hash_map<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::save_hash_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_map<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_map<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::load_hash_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_map<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_hash_map<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_map<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_map<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// hash_multimap
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::save_hash_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::load_hash_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_hash_multimap<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_HAS_HASH
+#endif // BOOST_SERIALIZATION_HASH_MAP_HPP
diff --git a/include/boost/serialization/hash_set.hpp b/include/boost/serialization/hash_set.hpp
new file mode 100644
index 0000000..0c72c18
--- /dev/null
+++ b/include/boost/serialization/hash_set.hpp
@@ -0,0 +1,222 @@
+#ifndef BOOST_SERIALIZATION_HASH_SET_HPP
+#define BOOST_SERIALIZATION_HASH_SET_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// hash_set.hpp: serialization for stl hash_set templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+#ifdef BOOST_HAS_HASH
+#include BOOST_HASH_SET_HEADER
+
+#include <boost/serialization/hash_collections_save_imp.hpp>
+#include <boost/serialization/hash_collections_load_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+namespace serialization {
+
+namespace stl {
+
+// hash_set input
+template<class Archive, class Container>
+struct archive_input_hash_set
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ std::pair<typename Container::const_iterator, bool> result =
+ s.insert(boost::move(t.reference()));
+ if(result.second)
+ ar.reset_object_address(& (* result.first), & t.reference());
+ }
+};
+
+// hash_multiset input
+template<class Archive, class Container>
+struct archive_input_hash_multiset
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ typename Container::const_iterator result
+ = s.insert(boost::move(t.reference()));
+ ar.reset_object_address(& (* result), & t.reference());
+ }
+};
+
+} // stl
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const BOOST_STD_EXTENSION_NAMESPACE::hash_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::save_hash_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_set<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::load_hash_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_set<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_hash_set<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_set<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// hash_multiset
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::save_hash_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::load_hash_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_hash_multiset<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ > & t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_set)
+BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::hash_multiset)
+
+#endif // BOOST_HAS_HASH
+#endif // BOOST_SERIALIZATION_HASH_SET_HPP
diff --git a/include/boost/serialization/is_bitwise_serializable.hpp b/include/boost/serialization/is_bitwise_serializable.hpp
new file mode 100644
index 0000000..7e24a2c
--- /dev/null
+++ b/include/boost/serialization/is_bitwise_serializable.hpp
@@ -0,0 +1,46 @@
+// (C) Copyright 2007 Matthias Troyer
+
+// 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)
+
+// Authors: Matthias Troyer
+
+/** @file is_bitwise_serializable.hpp
+ *
+ * This header provides a traits class for determining whether a class
+ * can be serialized (in a non-portable way) just by copying the bits.
+ */
+
+
+#ifndef BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
+#define BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#include <boost/mpl/bool_fwd.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+
+namespace boost {
+namespace serialization {
+ template<class T>
+ struct is_bitwise_serializable
+ : public is_arithmetic< T >
+ {};
+} // namespace serialization
+} // namespace boost
+
+
+// define a macro to make explicit designation of this more transparent
+#define BOOST_IS_BITWISE_SERIALIZABLE(T) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct is_bitwise_serializable< T > : mpl::true_ {}; \
+}} \
+/**/
+
+#endif //BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
diff --git a/include/boost/serialization/item_version_type.hpp b/include/boost/serialization/item_version_type.hpp
new file mode 100644
index 0000000..f3e5ada
--- /dev/null
+++ b/include/boost/serialization/item_version_type.hpp
@@ -0,0 +1,68 @@
+#ifndef BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP
+#define BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP
+
+// (C) Copyright 2010 Robert Ramey
+// 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)
+
+#include <boost/cstdint.hpp> // uint_least8_t
+#include <boost/integer_traits.hpp>
+#include <boost/serialization/level.hpp>
+#include <boost/serialization/is_bitwise_serializable.hpp>
+
+// fixes broken example build on x86_64-linux-gnu-gcc-4.6.0
+#include <boost/assert.hpp>
+
+namespace boost {
+namespace serialization {
+
+#if defined(_MSC_VER)
+#pragma warning( push )
+#pragma warning( disable : 4244 4267 )
+#endif
+
+class item_version_type {
+private:
+ typedef unsigned int base_type;
+ base_type t;
+public:
+ // should be private - but MPI fails if it's not!!!
+ item_version_type(): t(0) {};
+ explicit item_version_type(const unsigned int t_) : t(t_){
+ BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
+ }
+ item_version_type(const item_version_type & t_) :
+ t(t_.t)
+ {}
+ item_version_type & operator=(item_version_type rhs){
+ t = rhs.t;
+ return *this;
+ }
+ // used for text output
+ operator base_type () const {
+ return t;
+ }
+ // used for text input
+ operator base_type & () {
+ return t;
+ }
+ bool operator==(const item_version_type & rhs) const {
+ return t == rhs.t;
+ }
+ bool operator<(const item_version_type & rhs) const {
+ return t < rhs.t;
+ }
+};
+
+#if defined(_MSC_VER)
+#pragma warning( pop )
+#endif
+
+} } // end namespace boost::serialization
+
+BOOST_IS_BITWISE_SERIALIZABLE(item_version_type)
+
+BOOST_CLASS_IMPLEMENTATION(item_version_type, primitive_type)
+
+#endif //BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP
diff --git a/include/boost/serialization/level.hpp b/include/boost/serialization/level.hpp
new file mode 100644
index 0000000..f6a84d1
--- /dev/null
+++ b/include/boost/serialization/level.hpp
@@ -0,0 +1,116 @@
+#ifndef BOOST_SERIALIZATION_LEVEL_HPP
+#define BOOST_SERIALIZATION_LEVEL_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// level.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/type_traits/is_fundamental.hpp>
+#include <boost/type_traits/is_enum.hpp>
+#include <boost/type_traits/is_array.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/integral_c.hpp>
+#include <boost/mpl/integral_c_tag.hpp>
+
+#include <boost/serialization/level_enum.hpp>
+
+namespace boost {
+namespace serialization {
+
+struct basic_traits;
+
+// default serialization implementation level
+template<class T>
+struct implementation_level_impl {
+ template<class U>
+ struct traits_class_level {
+ typedef typename U::level type;
+ };
+
+ typedef mpl::integral_c_tag tag;
+ // note: at least one compiler complained w/o the full qualification
+ // on basic traits below
+ typedef
+ typename mpl::eval_if<
+ is_base_and_derived<boost::serialization::basic_traits, T>,
+ traits_class_level< T >,
+ //else
+ typename mpl::eval_if<
+ is_fundamental< T >,
+ mpl::int_<primitive_type>,
+ //else
+ typename mpl::eval_if<
+ is_class< T >,
+ mpl::int_<object_class_info>,
+ //else
+ typename mpl::eval_if<
+ is_array< T >,
+ mpl::int_<object_serializable>,
+ //else
+ typename mpl::eval_if<
+ is_enum< T >,
+ mpl::int_<primitive_type>,
+ //else
+ mpl::int_<not_serializable>
+ >
+ >
+ >
+ >
+ >::type type;
+ // vc 7.1 doesn't like enums here
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+};
+
+template<class T>
+struct implementation_level :
+ public implementation_level_impl<const T>
+{
+};
+
+template<class T, int L>
+inline bool operator>=(implementation_level< T > t, enum level_type l)
+{
+ return t.value >= (int)l;
+}
+
+} // namespace serialization
+} // namespace boost
+
+// specify the level of serialization implementation for the class
+// require that class info saved when versioning is used
+#define BOOST_CLASS_IMPLEMENTATION(T, E) \
+ namespace boost { \
+ namespace serialization { \
+ template <> \
+ struct implementation_level_impl< const T > \
+ { \
+ typedef mpl::integral_c_tag tag; \
+ typedef mpl::int_< E > type; \
+ BOOST_STATIC_CONSTANT( \
+ int, \
+ value = implementation_level_impl::type::value \
+ ); \
+ }; \
+ } \
+ }
+ /**/
+
+#endif // BOOST_SERIALIZATION_LEVEL_HPP
diff --git a/include/boost/serialization/level_enum.hpp b/include/boost/serialization/level_enum.hpp
new file mode 100644
index 0000000..baf64e0
--- /dev/null
+++ b/include/boost/serialization/level_enum.hpp
@@ -0,0 +1,55 @@
+#ifndef BOOST_SERIALIZATION_LEVEL_ENUM_HPP
+#define BOOST_SERIALIZATION_LEVEL_ENUM_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// level_enum.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+namespace boost {
+namespace serialization {
+
+// for each class used in the program, specify which level
+// of serialization should be implemented
+
+// names for each level
+enum level_type
+{
+ // Don't serialize this type. An attempt to do so should
+ // invoke a compile time assertion.
+ not_serializable = 0,
+ // write/read this type directly to the archive. In this case
+ // serialization code won't be called. This is the default
+ // case for fundamental types. It presumes a member function or
+ // template in the archive class that can handle this type.
+ // there is no runtime overhead associated reading/writing
+ // instances of this level
+ primitive_type = 1,
+ // Serialize the objects of this type using the objects "serialize"
+ // function or template. This permits values to be written/read
+ // to/from archives but includes no class or version information.
+ object_serializable = 2,
+ ///////////////////////////////////////////////////////////////////
+ // once an object is serialized at one of the above levels, the
+ // corresponding archives cannot be read if the implementation level
+ // for the archive object is changed.
+ ///////////////////////////////////////////////////////////////////
+ // Add class information to the archive. Class information includes
+ // implementation level, class version and class name if available
+ object_class_info = 3
+};
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_LEVEL_ENUM_HPP
diff --git a/include/boost/serialization/list.hpp b/include/boost/serialization/list.hpp
new file mode 100644
index 0000000..5fdc114
--- /dev/null
+++ b/include/boost/serialization/list.hpp
@@ -0,0 +1,85 @@
+#ifndef BOOST_SERIALIZATION_LIST_HPP
+#define BOOST_SERIALIZATION_LIST_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// list.hpp: serialization for stl list templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <list>
+
+#include <boost/config.hpp>
+
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/collections_load_imp.hpp>
+
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class U, class Allocator>
+inline void save(
+ Archive & ar,
+ const std::list<U, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ boost::serialization::stl::save_collection<
+ Archive,
+ std::list<U, Allocator>
+ >(ar, t);
+}
+
+template<class Archive, class U, class Allocator>
+inline void load(
+ Archive & ar,
+ std::list<U, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ const boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ item_version_type item_version(0);
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ stl::collection_load_impl(ar, t, count, item_version);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class U, class Allocator>
+inline void serialize(
+ Archive & ar,
+ std::list<U, Allocator> & t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(std::list)
+
+#endif // BOOST_SERIALIZATION_LIST_HPP
diff --git a/include/boost/serialization/map.hpp b/include/boost/serialization/map.hpp
new file mode 100644
index 0000000..9209864
--- /dev/null
+++ b/include/boost/serialization/map.hpp
@@ -0,0 +1,139 @@
+#ifndef BOOST_SERIALIZATION_MAP_HPP
+#define BOOST_SERIALIZATION_MAP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization/map.hpp:
+// serialization for stl map templates
+
+// (C) Copyright 2002-2014 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <map>
+
+#include <boost/config.hpp>
+
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+
+#include <boost/serialization/utility.hpp>
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+namespace serialization {
+
+////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// implementation of serialization for map and mult-map STL containers
+
+template<class Archive, class Container>
+inline void load_map_collection(Archive & ar, Container &s)
+{
+ s.clear();
+ const boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ item_version_type item_version(0);
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ typename Container::iterator hint;
+ hint = s.begin();
+ while(count-- > 0){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ typename Container::iterator result =
+ s.insert(hint, boost::move(t.reference()));
+ ar.reset_object_address(& (result->second), & t.reference().second);
+ hint = result;
+ ++hint;
+ }
+}
+
+// map
+template<class Archive, class Type, class Key, class Compare, class Allocator >
+inline void save(
+ Archive & ar,
+ const std::map<Key, Type, Compare, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ boost::serialization::stl::save_collection<
+ Archive,
+ std::map<Key, Type, Compare, Allocator>
+ >(ar, t);
+}
+
+template<class Archive, class Type, class Key, class Compare, class Allocator >
+inline void load(
+ Archive & ar,
+ std::map<Key, Type, Compare, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ load_map_collection(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class Type, class Key, class Compare, class Allocator >
+inline void serialize(
+ Archive & ar,
+ std::map<Key, Type, Compare, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// multimap
+template<class Archive, class Type, class Key, class Compare, class Allocator >
+inline void save(
+ Archive & ar,
+ const std::multimap<Key, Type, Compare, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ boost::serialization::stl::save_collection<
+ Archive,
+ std::multimap<Key, Type, Compare, Allocator>
+ >(ar, t);
+}
+
+template<class Archive, class Type, class Key, class Compare, class Allocator >
+inline void load(
+ Archive & ar,
+ std::multimap<Key, Type, Compare, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ load_map_collection(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class Type, class Key, class Compare, class Allocator >
+inline void serialize(
+ Archive & ar,
+ std::multimap<Key, Type, Compare, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_MAP_HPP
diff --git a/include/boost/serialization/nvp.hpp b/include/boost/serialization/nvp.hpp
new file mode 100644
index 0000000..066fe94
--- /dev/null
+++ b/include/boost/serialization/nvp.hpp
@@ -0,0 +1,125 @@
+#ifndef BOOST_SERIALIZATION_NVP_HPP
+#define BOOST_SERIALIZATION_NVP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// nvp.hpp: interface for serialization system.
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <utility>
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/serialization/level.hpp>
+#include <boost/serialization/tracking.hpp>
+#include <boost/serialization/split_member.hpp>
+#include <boost/serialization/base_object.hpp>
+#include <boost/serialization/traits.hpp>
+#include <boost/serialization/wrapper.hpp>
+
+#include <boost/core/addressof.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class T>
+struct nvp :
+ public std::pair<const char *, T *>,
+ public wrapper_traits<const nvp< T > >
+{
+//private:
+ nvp(const nvp & rhs) :
+ std::pair<const char *, T *>(rhs.first, rhs.second)
+ {}
+public:
+ explicit nvp(const char * name_, T & t) :
+ // note: added _ to suppress useless gcc warning
+ std::pair<const char *, T *>(name_, boost::addressof(t))
+ {}
+
+ const char * name() const {
+ return this->first;
+ }
+ T & value() const {
+ return *(this->second);
+ }
+
+ const T & const_value() const {
+ return *(this->second);
+ }
+
+ template<class Archive>
+ void save(
+ Archive & ar,
+ const unsigned int /* file_version */
+ ) const {
+ ar.operator<<(const_value());
+ }
+ template<class Archive>
+ void load(
+ Archive & ar,
+ const unsigned int /* file_version */
+ ){
+ ar.operator>>(value());
+ }
+ BOOST_SERIALIZATION_SPLIT_MEMBER()
+};
+
+template<class T>
+inline
+const nvp< T > make_nvp(const char * name, T & t){
+ return nvp< T >(name, t);
+}
+
+// to maintain efficiency and portability, we want to assign
+// specific serialization traits to all instances of this wrappers.
+// we can't strait forward method below as it depends upon
+// Partial Template Specialization and doing so would mean that wrappers
+// wouldn't be treated the same on different platforms. This would
+// break archive portability. Leave this here as reminder not to use it !!!
+
+template <class T>
+struct implementation_level<nvp< T > >
+{
+ typedef mpl::integral_c_tag tag;
+ typedef mpl::int_<object_serializable> type;
+ BOOST_STATIC_CONSTANT(int, value = implementation_level::type::value);
+};
+
+// nvp objects are generally created on the stack and are never tracked
+template<class T>
+struct tracking_level<nvp< T > >
+{
+ typedef mpl::integral_c_tag tag;
+ typedef mpl::int_<track_never> type;
+ BOOST_STATIC_CONSTANT(int, value = tracking_level::type::value);
+};
+
+} // seralization
+} // boost
+
+#include <boost/preprocessor/stringize.hpp>
+
+#define BOOST_SERIALIZATION_NVP(name) \
+ boost::serialization::make_nvp(BOOST_PP_STRINGIZE(name), name)
+/**/
+
+#define BOOST_SERIALIZATION_BASE_OBJECT_NVP(name) \
+ boost::serialization::make_nvp( \
+ BOOST_PP_STRINGIZE(name), \
+ boost::serialization::base_object<name >(*this) \
+ )
+/**/
+
+#endif // BOOST_SERIALIZATION_NVP_HPP
diff --git a/include/boost/serialization/optional.hpp b/include/boost/serialization/optional.hpp
new file mode 100644
index 0000000..d6ff830
--- /dev/null
+++ b/include/boost/serialization/optional.hpp
@@ -0,0 +1,107 @@
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+
+// (C) Copyright 2002-4 Pavel Vozenilek .
+// 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)
+
+// Provides non-intrusive serialization for boost::optional.
+
+#ifndef BOOST_SERIALIZATION_OPTIONAL_HPP_
+#define BOOST_SERIALIZATION_OPTIONAL_HPP_
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#include <boost/config.hpp>
+
+#include <boost/archive/detail/basic_iarchive.hpp>
+
+#include <boost/optional.hpp>
+#include <boost/move/utility_core.hpp>
+
+#include <boost/serialization/item_version_type.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/level.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/version.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+#include <boost/serialization/detail/is_default_constructible.hpp>
+#include <boost/serialization/force_include.hpp>
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+namespace boost {
+namespace serialization {
+
+template<class Archive, class T>
+void save(
+ Archive & ar,
+ const boost::optional< T > & t,
+ const unsigned int /*version*/
+){
+ // It is an inherent limitation to the serialization of optional.hpp
+ // that the underlying type must be either a pointer or must have a
+ // default constructor. It's possible that this could change sometime
+ // in the future, but for now, one will have to work around it. This can
+ // be done by serialization the optional<T> as optional<T *>
+ #if ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
+ BOOST_STATIC_ASSERT(
+ boost::serialization::detail::is_default_constructible<T>::value
+ || boost::is_pointer<T>::value
+ );
+ #endif
+ const bool tflag = t.is_initialized();
+ ar << boost::serialization::make_nvp("initialized", tflag);
+ if (tflag){
+ ar << boost::serialization::make_nvp("value", *t);
+ }
+}
+
+template<class Archive, class T>
+void load(
+ Archive & ar,
+ boost::optional< T > & t,
+ const unsigned int version
+){
+ bool tflag;
+ ar >> boost::serialization::make_nvp("initialized", tflag);
+ if(! tflag){
+ t.reset();
+ return;
+ }
+
+ if(0 == version){
+ boost::serialization::item_version_type item_version(0);
+ boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ }
+ if(! t.is_initialized())
+ t = T();
+ ar >> boost::serialization::make_nvp("value", *t);
+}
+
+template<class Archive, class T>
+void serialize(
+ Archive & ar,
+ boost::optional< T > & t,
+ const unsigned int version
+){
+ boost::serialization::split_free(ar, t, version);
+}
+
+template<class T>
+struct version<boost::optional<T> > {
+ BOOST_STATIC_CONSTANT(int, value = 1);
+};
+
+} // serialization
+} // boost
+
+#endif // BOOST_SERIALIZATION_OPTIONAL_HPP_
diff --git a/include/boost/serialization/priority_queue.hpp b/include/boost/serialization/priority_queue.hpp
new file mode 100644
index 0000000..5b08ffd
--- /dev/null
+++ b/include/boost/serialization/priority_queue.hpp
@@ -0,0 +1,76 @@
+#ifndef BOOST_SERIALIZATION_PRIORITY_QUEUE_HPP
+#define BOOST_SERIALIZATION_PRIORITY_QUEUE_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
+// priority_queue.hpp
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <queue>
+#include <boost/config.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
+namespace boost {
+namespace serialization {
+namespace detail{
+
+template <typename U, typename Container, typename Compare>
+struct priority_queue_save : public STD::priority_queue<U, Container, Compare> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) const {
+ save(ar, STD::priority_queue<U, Container, Compare>::c, file_version);
+ }
+};
+template <typename U, typename Container, typename Compare>
+struct priority_queue_load : public STD::priority_queue<U, Container, Compare> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) {
+ load(ar, STD::priority_queue<U, Container, Compare>::c, file_version);
+ }
+};
+
+} // detail
+
+template<class Archive, class T, class Container, class Compare>
+inline void serialize(
+ Archive & ar,
+ std::priority_queue< T, Container, Compare> & t,
+ const unsigned int file_version
+){
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
+ mpl::identity<detail::priority_queue_save<T, Container, Compare> >,
+ mpl::identity<detail::priority_queue_load<T, Container, Compare> >
+ >::type typex;
+ static_cast<typex &>(t)(ar, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::priority_queue)
+
+#undef STD
+
+#endif // BOOST_SERIALIZATION_PRIORITY_QUEUE_HPP
diff --git a/include/boost/serialization/queue.hpp b/include/boost/serialization/queue.hpp
new file mode 100644
index 0000000..b227452
--- /dev/null
+++ b/include/boost/serialization/queue.hpp
@@ -0,0 +1,76 @@
+#ifndef BOOST_SERIALIZATION_QUEUE_HPP
+#define BOOST_SERIALIZATION_QUEUE_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
+// queue.hpp
+
+// (C) Copyright 2014 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <queue>
+#include <boost/config.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
+namespace boost {
+namespace serialization {
+namespace detail {
+
+template <typename U, typename C>
+struct queue_save : public STD::queue<U, C> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) const {
+ save(ar, STD::queue<U, C>::c, file_version);
+ }
+};
+template <typename U, typename C>
+struct queue_load : public STD::queue<U, C> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) {
+ load(ar, STD::queue<U, C>::c, file_version);
+ }
+};
+
+} // detail
+
+template<class Archive, class T, class C>
+inline void serialize(
+ Archive & ar,
+ std::queue< T, C> & t,
+ const unsigned int file_version
+){
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
+ mpl::identity<detail::queue_save<T, C> >,
+ mpl::identity<detail::queue_load<T, C> >
+ >::type typex;
+ static_cast<typex &>(t)(ar, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::queue)
+
+#undef STD
+
+#endif // BOOST_SERIALIZATION_QUEUE_HPP
diff --git a/include/boost/serialization/scoped_ptr.hpp b/include/boost/serialization/scoped_ptr.hpp
new file mode 100644
index 0000000..0d11f84
--- /dev/null
+++ b/include/boost/serialization/scoped_ptr.hpp
@@ -0,0 +1,58 @@
+#ifndef BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30
+#define BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+// Copyright (c) 2003 Vladimir Prus.
+// 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)
+
+// Provides non-intrusive serialization for boost::scoped_ptr
+// Does not allow to serialize scoped_ptr's to builtin types.
+
+#include <boost/config.hpp>
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+ template<class Archive, class T>
+ void save(
+ Archive & ar,
+ const boost::scoped_ptr< T > & t,
+ const unsigned int /* version */
+ ){
+ T* r = t.get();
+ ar << boost::serialization::make_nvp("scoped_ptr", r);
+ }
+
+ template<class Archive, class T>
+ void load(
+ Archive & ar,
+ boost::scoped_ptr< T > & t,
+ const unsigned int /* version */
+ ){
+ T* r;
+ ar >> boost::serialization::make_nvp("scoped_ptr", r);
+ t.reset(r);
+ }
+
+ template<class Archive, class T>
+ void serialize(
+ Archive& ar,
+ boost::scoped_ptr< T >& t,
+ const unsigned int version
+ ){
+ boost::serialization::split_free(ar, t, version);
+ }
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30
diff --git a/include/boost/serialization/serialization.hpp b/include/boost/serialization/serialization.hpp
new file mode 100644
index 0000000..a4d0472
--- /dev/null
+++ b/include/boost/serialization/serialization.hpp
@@ -0,0 +1,154 @@
+#ifndef BOOST_SERIALIZATION_SERIALIZATION_HPP
+#define BOOST_SERIALIZATION_SERIALIZATION_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#if defined(_MSC_VER)
+# pragma warning (disable : 4675) // suppress ADL warning
+#endif
+
+#include <boost/config.hpp>
+#include <boost/serialization/strong_typedef.hpp>
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization.hpp: interface for serialization system.
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+//////////////////////////////////////////////////////////////////////
+// public interface to serialization.
+
+/////////////////////////////////////////////////////////////////////////////
+// layer 0 - intrusive verison
+// declared and implemented for each user defined class to be serialized
+//
+// template<Archive>
+// serialize(Archive &ar, const unsigned int file_version){
+// ar & base_object<base>(*this) & member1 & member2 ... ;
+// }
+
+/////////////////////////////////////////////////////////////////////////////
+// layer 1 - layer that routes member access through the access class.
+// this is what permits us to grant access to private class member functions
+// by specifying friend class boost::serialization::access
+
+#include <boost/serialization/access.hpp>
+
+/////////////////////////////////////////////////////////////////////////////
+// layer 2 - default implementation of non-intrusive serialization.
+//
+// note the usage of function overloading to compensate that C++ does not
+// currently support Partial Template Specialization for function templates
+// We have declared the version number as "const unsigned long".
+// Overriding templates for specific data types should declare the version
+// number as "const unsigned int". Template matching will first be applied
+// to functions with the same version types - that is the overloads.
+// If there is no declared function prototype that matches, the second argument
+// will be converted to "const unsigned long" and a match will be made with
+// one of the default template functions below.
+
+namespace boost {
+namespace serialization {
+
+BOOST_STRONG_TYPEDEF(unsigned int, version_type)
+
+// default implementation - call the member function "serialize"
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar, T & t, const unsigned int file_version
+){
+ access::serialize(ar, t, static_cast<unsigned int>(file_version));
+}
+
+// save data required for construction
+template<class Archive, class T>
+inline void save_construct_data(
+ Archive & /*ar*/,
+ const T * /*t*/,
+ const unsigned int /*file_version */
+){
+ // default is to save no data because default constructor
+ // requires no arguments.
+}
+
+// load data required for construction and invoke constructor in place
+template<class Archive, class T>
+inline void load_construct_data(
+ Archive & /*ar*/,
+ T * t,
+ const unsigned int /*file_version*/
+){
+ // default just uses the default constructor. going
+ // through access permits usage of otherwise private default
+ // constructor
+ access::construct(t);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// layer 3 - move call into serialization namespace so that ADL will function
+// in the manner we desire.
+//
+// on compilers which don't implement ADL. only the current namespace
+// i.e. boost::serialization will be searched.
+//
+// on compilers which DO implement ADL
+// serialize overrides can be in any of the following
+//
+// 1) same namepace as Archive
+// 2) same namespace as T
+// 3) boost::serialization
+//
+// Due to Martin Ecker
+
+template<class Archive, class T>
+inline void serialize_adl(
+ Archive & ar,
+ T & t,
+ const unsigned int file_version
+){
+ // note usage of function overloading to delay final resolution
+ // until the point of instantiation. This works around the two-phase
+ // lookup "feature" which inhibits redefintion of a default function
+ // template implementation. Due to Robert Ramey
+ //
+ // Note that this trick generates problems for compiles which don't support
+ // PFTO, suppress it here. As far as we know, there are no compilers
+ // which fail to support PFTO while supporting two-phase lookup.
+ const version_type v(file_version);
+ serialize(ar, t, v);
+}
+
+template<class Archive, class T>
+inline void save_construct_data_adl(
+ Archive & ar,
+ const T * t,
+ const unsigned int file_version
+){
+ // see above
+ const version_type v(file_version);
+ save_construct_data(ar, t, v);
+}
+
+template<class Archive, class T>
+inline void load_construct_data_adl(
+ Archive & ar,
+ T * t,
+ const unsigned int file_version
+){
+ // see above comment
+ const version_type v(file_version);
+ load_construct_data(ar, t, v);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_SERIALIZATION_HPP
diff --git a/include/boost/serialization/set.hpp b/include/boost/serialization/set.hpp
new file mode 100644
index 0000000..dd20126
--- /dev/null
+++ b/include/boost/serialization/set.hpp
@@ -0,0 +1,138 @@
+#ifndef BOOST_SERIALIZATION_SET_HPP
+#define BOOST_SERIALIZATION_SET_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// set.hpp: serialization for stl set templates
+
+// (C) Copyright 2002-2014 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <set>
+
+#include <boost/config.hpp>
+
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class Container>
+inline void load_set_collection(Archive & ar, Container &s)
+{
+ s.clear();
+ const boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ item_version_type item_version(0);
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ typename Container::iterator hint;
+ hint = s.begin();
+ while(count-- > 0){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, item_version);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ typename Container::iterator result =
+ s.insert(hint, boost::move(t.reference()));
+ const type * new_address = & (* result);
+ ar.reset_object_address(new_address, & t.reference());
+ hint = result;
+ }
+}
+
+template<class Archive, class Key, class Compare, class Allocator >
+inline void save(
+ Archive & ar,
+ const std::set<Key, Compare, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ boost::serialization::stl::save_collection<
+ Archive, std::set<Key, Compare, Allocator>
+ >(ar, t);
+}
+
+template<class Archive, class Key, class Compare, class Allocator >
+inline void load(
+ Archive & ar,
+ std::set<Key, Compare, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ load_set_collection(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class Key, class Compare, class Allocator >
+inline void serialize(
+ Archive & ar,
+ std::set<Key, Compare, Allocator> & t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// multiset
+template<class Archive, class Key, class Compare, class Allocator >
+inline void save(
+ Archive & ar,
+ const std::multiset<Key, Compare, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ boost::serialization::stl::save_collection<
+ Archive,
+ std::multiset<Key, Compare, Allocator>
+ >(ar, t);
+}
+
+template<class Archive, class Key, class Compare, class Allocator >
+inline void load(
+ Archive & ar,
+ std::multiset<Key, Compare, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ load_set_collection(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class Key, class Compare, class Allocator >
+inline void serialize(
+ Archive & ar,
+ std::multiset<Key, Compare, Allocator> & t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(std::set)
+BOOST_SERIALIZATION_COLLECTION_TRAITS(std::multiset)
+
+#endif // BOOST_SERIALIZATION_SET_HPP
diff --git a/include/boost/serialization/shared_ptr.hpp b/include/boost/serialization/shared_ptr.hpp
new file mode 100644
index 0000000..0d4c5ae
--- /dev/null
+++ b/include/boost/serialization/shared_ptr.hpp
@@ -0,0 +1,281 @@
+#ifndef BOOST_SERIALIZATION_SHARED_PTR_HPP
+#define BOOST_SERIALIZATION_SHARED_PTR_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// shared_ptr.hpp: serialization for boost shared pointer
+
+// (C) Copyright 2004 Robert Ramey and Martin Ecker
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <cstddef> // NULL
+#include <memory>
+
+#include <boost/config.hpp>
+#include <boost/mpl/integral_c.hpp>
+#include <boost/mpl/integral_c_tag.hpp>
+
+#include <boost/detail/workaround.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include <boost/serialization/shared_ptr_helper.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/version.hpp>
+#include <boost/serialization/tracking.hpp>
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// boost:: shared_ptr serialization traits
+// version 1 to distinguish from boost 1.32 version. Note: we can only do this
+// for a template when the compiler supports partial template specialization
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ namespace boost {
+ namespace serialization{
+ template<class T>
+ struct version< ::boost::shared_ptr< T > > {
+ typedef mpl::integral_c_tag tag;
+ #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206))
+ typedef typename mpl::int_<1> type;
+ #else
+ typedef mpl::int_<1> type;
+ #endif
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+ };
+ // don't track shared pointers
+ template<class T>
+ struct tracking_level< ::boost::shared_ptr< T > > {
+ typedef mpl::integral_c_tag tag;
+ #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206))
+ typedef typename mpl::int_< ::boost::serialization::track_never> type;
+ #else
+ typedef mpl::int_< ::boost::serialization::track_never> type;
+ #endif
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+ };
+ }}
+ #define BOOST_SERIALIZATION_SHARED_PTR(T)
+#else
+ // define macro to let users of these compilers do this
+ #define BOOST_SERIALIZATION_SHARED_PTR(T) \
+ BOOST_CLASS_VERSION( \
+ ::boost::shared_ptr< T >, \
+ 1 \
+ ) \
+ BOOST_CLASS_TRACKING( \
+ ::boost::shared_ptr< T >, \
+ ::boost::serialization::track_never \
+ ) \
+ /**/
+#endif
+
+namespace boost {
+namespace serialization{
+
+struct null_deleter {
+ void operator()(void const *) const {}
+};
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization for boost::shared_ptr
+
+// Using a constant means that all shared pointers are held in the same set.
+// Thus we detect handle multiple pointers to the same value instances
+// in the archive.
+void * const shared_ptr_helper_id = 0;
+
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const boost::shared_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ // The most common cause of trapping here would be serializing
+ // something like shared_ptr<int>. This occurs because int
+ // is never tracked by default. Wrap int in a trackable type
+ BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
+ const T * t_ptr = t.get();
+ ar << boost::serialization::make_nvp("px", t_ptr);
+}
+
+#ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ boost::shared_ptr< T > &t,
+ const unsigned int file_version
+){
+ // something like shared_ptr<int>. This occurs because int
+ // is never tracked by default. Wrap int in a trackable type
+ BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
+ T* r;
+ if(file_version < 1){
+ ar.register_type(static_cast<
+ boost_132::detail::sp_counted_base_impl<T *, null_deleter > *
+ >(NULL));
+ boost_132::shared_ptr< T > sp;
+ ar >> boost::serialization::make_nvp("px", sp.px);
+ ar >> boost::serialization::make_nvp("pn", sp.pn);
+ // got to keep the sps around so the sp.pns don't disappear
+ boost::serialization::shared_ptr_helper<boost::shared_ptr> & h =
+ ar.template get_helper< shared_ptr_helper<boost::shared_ptr> >(
+ shared_ptr_helper_id
+ );
+ h.append(sp);
+ r = sp.get();
+ }
+ else{
+ ar >> boost::serialization::make_nvp("px", r);
+ }
+ shared_ptr_helper<boost::shared_ptr> & h =
+ ar.template get_helper<shared_ptr_helper<boost::shared_ptr> >(
+ shared_ptr_helper_id
+ );
+ h.reset(t,r);
+}
+#else
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ boost::shared_ptr< T > &t,
+ const unsigned int /*file_version*/
+){
+ // The most common cause of trapping here would be serializing
+ // something like shared_ptr<int>. This occurs because int
+ // is never tracked by default. Wrap int in a trackable type
+ BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
+ T* r;
+ ar >> boost::serialization::make_nvp("px", r);
+
+ boost::serialization::shared_ptr_helper<boost::shared_ptr> & h =
+ ar.template get_helper<shared_ptr_helper<boost::shared_ptr> >(
+ shared_ptr_helper_id
+ );
+ h.reset(t,r);
+}
+#endif
+
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ boost::shared_ptr< T > &t,
+ const unsigned int file_version
+){
+ // correct shared_ptr serialization depends upon object tracking
+ // being used.
+ BOOST_STATIC_ASSERT(
+ boost::serialization::tracking_level< T >::value
+ != boost::serialization::track_never
+ );
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// std::shared_ptr serialization traits
+// version 1 to distinguish from boost 1.32 version. Note: we can only do this
+// for a template when the compiler supports partial template specialization
+
+#ifndef BOOST_NO_CXX11_SMART_PTR
+#include <boost/static_assert.hpp>
+
+// note: we presume that any compiler/library which supports C++11
+// std::pointers also supports template partial specialization
+// trap here if such presumption were to turn out to wrong!!!
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ BOOST_STATIC_ASSERT(false);
+#endif
+
+namespace boost {
+namespace serialization{
+ template<class T>
+ struct version< ::std::shared_ptr< T > > {
+ typedef mpl::integral_c_tag tag;
+ typedef mpl::int_<1> type;
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+ };
+ // don't track shared pointers
+ template<class T>
+ struct tracking_level< ::std::shared_ptr< T > > {
+ typedef mpl::integral_c_tag tag;
+ typedef mpl::int_< ::boost::serialization::track_never> type;
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+ };
+}}
+// the following just keeps older programs from breaking
+#define BOOST_SERIALIZATION_SHARED_PTR(T)
+
+namespace boost {
+namespace serialization{
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization for std::shared_ptr
+
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const std::shared_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ // The most common cause of trapping here would be serializing
+ // something like shared_ptr<int>. This occurs because int
+ // is never tracked by default. Wrap int in a trackable type
+ BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
+ const T * t_ptr = t.get();
+ ar << boost::serialization::make_nvp("px", t_ptr);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ std::shared_ptr< T > &t,
+ const unsigned int /*file_version*/
+){
+ // The most common cause of trapping here would be serializing
+ // something like shared_ptr<int>. This occurs because int
+ // is never tracked by default. Wrap int in a trackable type
+ BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
+ T* r;
+ ar >> boost::serialization::make_nvp("px", r);
+ //void (* const id)(Archive &, std::shared_ptr< T > &, const unsigned int) = & load;
+ boost::serialization::shared_ptr_helper<std::shared_ptr> & h =
+ ar.template get_helper<
+ shared_ptr_helper<std::shared_ptr>
+ >(
+ shared_ptr_helper_id
+ );
+ h.reset(t,r);
+}
+
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ std::shared_ptr< T > &t,
+ const unsigned int file_version
+){
+ // correct shared_ptr serialization depends upon object tracking
+ // being used.
+ BOOST_STATIC_ASSERT(
+ boost::serialization::tracking_level< T >::value
+ != boost::serialization::track_never
+ );
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_NO_CXX11_SMART_PTR
+
+#endif // BOOST_SERIALIZATION_SHARED_PTR_HPP
diff --git a/include/boost/serialization/shared_ptr_132.hpp b/include/boost/serialization/shared_ptr_132.hpp
new file mode 100644
index 0000000..3dfaba4
--- /dev/null
+++ b/include/boost/serialization/shared_ptr_132.hpp
@@ -0,0 +1,222 @@
+#ifndef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+#define BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// shared_ptr.hpp: serialization for boost shared pointer
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// note: totally unadvised hack to gain access to private variables
+// in shared_ptr and shared_count. Unfortunately its the only way to
+// do this without changing shared_ptr and shared_count
+// the best we can do is to detect a conflict here
+#include <boost/config.hpp>
+
+#include <list>
+#include <cstddef> // NULL
+
+#include <boost/serialization/assume_abstract.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/tracking.hpp>
+#include <boost/serialization/void_cast.hpp>
+
+// mark base class as an (uncreatable) base class
+#include <boost/serialization/detail/shared_ptr_132.hpp>
+
+/////////////////////////////////////////////////////////////
+// Maintain a couple of lists of loaded shared pointers of the old previous
+// version (1.32)
+
+namespace boost_132 {
+namespace serialization {
+namespace detail {
+
+struct null_deleter {
+ void operator()(void const *) const {}
+};
+
+} // namespace detail
+} // namespace serialization
+} // namespace boost_132
+
+/////////////////////////////////////////////////////////////
+// sp_counted_base_impl serialization
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class P, class D>
+inline void serialize(
+ Archive & /* ar */,
+ boost_132::detail::sp_counted_base_impl<P, D> & /* t */,
+ const unsigned int /*file_version*/
+){
+ // register the relationship between each derived class
+ // its polymorphic base
+ boost::serialization::void_cast_register<
+ boost_132::detail::sp_counted_base_impl<P, D>,
+ boost_132::detail::sp_counted_base
+ >(
+ static_cast<boost_132::detail::sp_counted_base_impl<P, D> *>(NULL),
+ static_cast<boost_132::detail::sp_counted_base *>(NULL)
+ );
+}
+
+template<class Archive, class P, class D>
+inline void save_construct_data(
+ Archive & ar,
+ const
+ boost_132::detail::sp_counted_base_impl<P, D> *t,
+ const unsigned int /* file_version */
+){
+ // variables used for construction
+ ar << boost::serialization::make_nvp("ptr", t->ptr);
+}
+
+template<class Archive, class P, class D>
+inline void load_construct_data(
+ Archive & ar,
+ boost_132::detail::sp_counted_base_impl<P, D> * t,
+ const unsigned int /* file_version */
+){
+ P ptr_;
+ ar >> boost::serialization::make_nvp("ptr", ptr_);
+ // ::new(t)boost_132::detail::sp_counted_base_impl<P, D>(ptr_, D());
+ // placement
+ // note: the original ::new... above is replaced by the one here. This one
+ // creates all new objects with a null_deleter so that after the archive
+ // is finished loading and the shared_ptrs are destroyed - the underlying
+ // raw pointers are NOT deleted. This is necessary as they are used by the
+ // new system as well.
+ ::new(t)boost_132::detail::sp_counted_base_impl<
+ P,
+ boost_132::serialization::detail::null_deleter
+ >(
+ ptr_, boost_132::serialization::detail::null_deleter()
+ ); // placement new
+ // compensate for that fact that a new shared count always is
+ // initialized with one. the add_ref_copy below will increment it
+ // every time its serialized so without this adjustment
+ // the use and weak counts will be off by one.
+ t->use_count_ = 0;
+}
+
+} // serialization
+} // namespace boost
+
+/////////////////////////////////////////////////////////////
+// shared_count serialization
+
+namespace boost {
+namespace serialization {
+
+template<class Archive>
+inline void save(
+ Archive & ar,
+ const boost_132::detail::shared_count &t,
+ const unsigned int /* file_version */
+){
+ ar << boost::serialization::make_nvp("pi", t.pi_);
+}
+
+template<class Archive>
+inline void load(
+ Archive & ar,
+ boost_132::detail::shared_count &t,
+ const unsigned int /* file_version */
+){
+ ar >> boost::serialization::make_nvp("pi", t.pi_);
+ if(NULL != t.pi_)
+ t.pi_->add_ref_copy();
+}
+
+} // serialization
+} // namespace boost
+
+BOOST_SERIALIZATION_SPLIT_FREE(boost_132::detail::shared_count)
+
+/////////////////////////////////////////////////////////////
+// implement serialization for shared_ptr< T >
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const boost_132::shared_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ // only the raw pointer has to be saved
+ // the ref count is maintained automatically as shared pointers are loaded
+ ar.register_type(static_cast<
+ boost_132::detail::sp_counted_base_impl<T *, boost::checked_deleter< T > > *
+ >(NULL));
+ ar << boost::serialization::make_nvp("px", t.px);
+ ar << boost::serialization::make_nvp("pn", t.pn);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ boost_132::shared_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ // only the raw pointer has to be saved
+ // the ref count is maintained automatically as shared pointers are loaded
+ ar.register_type(static_cast<
+ boost_132::detail::sp_counted_base_impl<T *, boost::checked_deleter< T > > *
+ >(NULL));
+ ar >> boost::serialization::make_nvp("px", t.px);
+ ar >> boost::serialization::make_nvp("pn", t.pn);
+}
+
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ boost_132::shared_ptr< T > &t,
+ const unsigned int file_version
+){
+ // correct shared_ptr serialization depends upon object tracking
+ // being used.
+ BOOST_STATIC_ASSERT(
+ boost::serialization::tracking_level< T >::value
+ != boost::serialization::track_never
+ );
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // serialization
+} // namespace boost
+
+// note: change below uses null_deleter
+// This macro is used to export GUIDS for shared pointers to allow
+// the serialization system to export them properly. David Tonge
+#define BOOST_SHARED_POINTER_EXPORT_GUID(T, K) \
+ typedef boost_132::detail::sp_counted_base_impl< \
+ T *, \
+ boost::checked_deleter< T > \
+ > __shared_ptr_ ## T; \
+ BOOST_CLASS_EXPORT_GUID(__shared_ptr_ ## T, "__shared_ptr_" K) \
+ BOOST_CLASS_EXPORT_GUID(T, K) \
+ /**/
+
+#define BOOST_SHARED_POINTER_EXPORT(T) \
+ BOOST_SHARED_POINTER_EXPORT_GUID( \
+ T, \
+ BOOST_PP_STRINGIZE(T) \
+ ) \
+ /**/
+
+#endif // BOOST_SERIALIZATION_SHARED_PTR_132_HPP
diff --git a/include/boost/serialization/shared_ptr_helper.hpp b/include/boost/serialization/shared_ptr_helper.hpp
new file mode 100644
index 0000000..37c34d6
--- /dev/null
+++ b/include/boost/serialization/shared_ptr_helper.hpp
@@ -0,0 +1,209 @@
+#ifndef BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
+#define BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# 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 <map>
+#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/mpl/if.hpp>
+
+#include <boost/serialization/singleton.hpp>
+#include <boost/serialization/extended_type_info.hpp>
+#include <boost/serialization/throw_exception.hpp>
+#include <boost/serialization/type_info_implementation.hpp>
+#include <boost/archive/archive_exception.hpp>
+
+namespace boost_132 {
+ template<class T> class shared_ptr;
+}
+namespace boost {
+namespace serialization {
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+template<class Archive, template<class U> class SPT >
+void load(
+ Archive & ar,
+ SPT< class U > &t,
+ const unsigned int file_version
+);
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// a common class for holding various types of shared pointers
+
+template<template<class T> class SPT>
+class shared_ptr_helper {
+ typedef std::map<
+ const void *, // address of object
+ SPT<const void> // address shared ptr to single instance
+ > object_shared_pointer_map;
+
+ // 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.
+ object_shared_pointer_map * m_o_sp;
+
+ struct null_deleter {
+ void operator()(void const *) const {}
+ };
+
+#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \
+|| defined(BOOST_MSVC) \
+|| defined(__SUNPRO_CC)
+public:
+#else
+ template<class Archive, class U>
+ friend void boost::serialization::load(
+ Archive & ar,
+ SPT< U > &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;
+ void
+ append(const boost_132::shared_ptr<const void> & t){
+ if(NULL == m_pointers_132)
+ m_pointers_132 = new std::list<boost_132::shared_ptr<const void> >;
+ m_pointers_132->push_back(t);
+ }
+ #endif
+
+ struct non_polymorphic {
+ template<class U>
+ static const boost::serialization::extended_type_info *
+ get_object_type(U & ){
+ return & boost::serialization::singleton<
+ typename
+ boost::serialization::type_info_implementation< U >::type
+ >::get_const_instance();
+ }
+ };
+ struct polymorphic {
+ template<class U>
+ static const boost::serialization::extended_type_info *
+ get_object_type(U & u){
+ return boost::serialization::singleton<
+ typename
+ boost::serialization::type_info_implementation< U >::type
+ >::get_const_instance().get_derived_extended_type_info(u);
+ }
+ };
+
+public:
+ template<class T>
+ void reset(SPT< 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's eti. This is effectively
+ // the object type identifer
+ typedef typename mpl::if_<
+ is_polymorphic< T >,
+ polymorphic,
+ non_polymorphic
+ >::type type;
+
+ const boost::serialization::extended_type_info * true_type
+ = type::get_object_type(*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(
+ boost::archive::archive_exception(
+ boost::archive::archive_exception::unregistered_class,
+ this_type->get_debug_info()
+ )
+ );
+ // get void pointer to the most derived type
+ // this uniquely identifies the object referred to
+ // oid = "object identifier"
+ const void * oid = void_downcast(
+ *true_type,
+ *this_type,
+ t
+ );
+ if(NULL == oid)
+ boost::serialization::throw_exception(
+ boost::archive::archive_exception(
+ boost::archive::archive_exception::unregistered_cast,
+ true_type->get_debug_info(),
+ this_type->get_debug_info()
+ )
+ );
+
+ // make tracking array if necessary
+ if(NULL == m_o_sp)
+ m_o_sp = new object_shared_pointer_map;
+
+ typename object_shared_pointer_map::iterator i = m_o_sp->find(oid);
+
+ // if it's a new object
+ if(i == m_o_sp->end()){
+ s.reset(t);
+ std::pair<typename object_shared_pointer_map::iterator, bool> result;
+ result = m_o_sp->insert(std::make_pair(oid, s));
+ BOOST_ASSERT(result.second);
+ }
+ // if the object has already been seen
+ else{
+ s = SPT<T>(i->second, t);
+ }
+ }
+
+ shared_ptr_helper() :
+ m_o_sp(NULL)
+ #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+ , m_pointers_132(NULL)
+ #endif
+ {}
+ virtual ~shared_ptr_helper(){
+ if(NULL != m_o_sp)
+ delete m_o_sp;
+ #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+ if(NULL != m_pointers_132)
+ delete m_pointers_132;
+ #endif
+ }
+};
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
diff --git a/include/boost/serialization/singleton.hpp b/include/boost/serialization/singleton.hpp
new file mode 100644
index 0000000..3437f38
--- /dev/null
+++ b/include/boost/serialization/singleton.hpp
@@ -0,0 +1,173 @@
+#ifndef BOOST_SERIALIZATION_SINGLETON_HPP
+#define BOOST_SERIALIZATION_SINGLETON_HPP
+
+/////////1/////////2///////// 3/////////4/////////5/////////6/////////7/////////8
+// singleton.hpp
+//
+// Copyright David Abrahams 2006. Original version
+//
+// Copyright Robert Ramey 2007. Changes made to permit
+// application throughout the serialization library.
+//
+// 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)
+//
+// The intention here is to define a template which will convert
+// any class into a singleton with the following features:
+//
+// a) initialized before first use.
+// b) thread-safe for const access to the class
+// c) non-locking
+//
+// In order to do this,
+// a) Initialize dynamically when used.
+// b) Require that all singletons be initialized before main
+// is called or any entry point into the shared library is invoked.
+// This guarentees no race condition for initialization.
+// In debug mode, we assert that no non-const functions are called
+// after main is invoked.
+//
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+#include <boost/assert.hpp>
+#include <boost/config.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/serialization/force_include.hpp>
+
+#include <boost/archive/detail/auto_link_archive.hpp>
+#include <boost/serialization/config.hpp>
+#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4511 4512)
+#endif
+
+namespace boost {
+namespace serialization {
+
+//////////////////////////////////////////////////////////////////////
+// Provides a dynamically-initialized (singleton) instance of T in a
+// way that avoids LNK1179 on vc6. See http://tinyurl.com/ljdp8 or
+// http://lists.boost.org/Archives/boost/2006/05/105286.php for
+// details.
+//
+
+// singletons created by this code are guarenteed to be unique
+// within the executable or shared library which creates them.
+// This is sufficient and in fact ideal for the serialization library.
+// The singleton is created when the module is loaded and destroyed
+// when the module is unloaded.
+
+// This base class has two functions.
+
+// First it provides a module handle for each singleton indicating
+// the executable or shared library in which it was created. This
+// turns out to be necessary and sufficient to implement the tables
+// used by serialization library.
+
+// Second, it provides a mechanism to detect when a non-const function
+// is called after initialization.
+
+// make a singleton to lock/unlock all singletons for alteration.
+// The intent is that all singletons created/used by this code
+// are to be initialized before main is called. A test program
+// can lock all the singletons when main is entereed. This any
+// attempt to retieve a mutable instances while locked will
+// generate a assertion if compiled for debug.
+
+// note usage of BOOST_DLLEXPORT. These functions are in danger of
+// being eliminated by the optimizer when building an application in
+// release mode. Usage of the macro is meant to signal the compiler/linker
+// to avoid dropping these functions which seem to be unreferenced.
+// This usage is not related to autolinking.
+
+class BOOST_SYMBOL_VISIBLE singleton_module :
+ public boost::noncopyable
+{
+private:
+ BOOST_DLLEXPORT static bool & get_lock() BOOST_USED {
+ static bool lock = false;
+ return lock;
+ }
+
+public:
+ BOOST_DLLEXPORT static void lock(){
+ get_lock() = true;
+ }
+ BOOST_DLLEXPORT static void unlock(){
+ get_lock() = false;
+ }
+ BOOST_DLLEXPORT static bool is_locked(){
+ return get_lock();
+ }
+};
+
+template <class T>
+class singleton : public singleton_module
+{
+private:
+ static T & m_instance;
+ // include this to provoke instantiation at pre-execution time
+ static void use(T const *) {}
+ static T & get_instance() {
+ // use a wrapper so that types T with protected constructors
+ // can be used
+ class singleton_wrapper : public T {};
+ static singleton_wrapper t;
+
+ // refer to instance, causing it to be instantiated (and
+ // initialized at startup on working compilers)
+ BOOST_ASSERT(! is_destroyed());
+
+ // note that the following is absolutely essential.
+ // commenting out this statement will cause compilers to fail to
+ // construct the instance at pre-execution time. This would prevent
+ // our usage/implementation of "locking" and introduce uncertainty into
+ // the sequence of object initializaition.
+ use(& m_instance);
+
+ return static_cast<T &>(t);
+ }
+ static bool & get_is_destroyed(){
+ static bool is_destroyed;
+ return is_destroyed;
+ }
+
+public:
+ BOOST_DLLEXPORT static T & get_mutable_instance(){
+ BOOST_ASSERT(! is_locked());
+ return get_instance();
+ }
+ BOOST_DLLEXPORT static const T & get_const_instance(){
+ return get_instance();
+ }
+ BOOST_DLLEXPORT static bool is_destroyed(){
+ return get_is_destroyed();
+ }
+ BOOST_DLLEXPORT singleton(){
+ get_is_destroyed() = false;
+ }
+ BOOST_DLLEXPORT ~singleton() {
+ get_is_destroyed() = true;
+ }
+};
+
+template<class T>
+T & singleton< T >::m_instance = singleton< T >::get_instance();
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+#endif // BOOST_SERIALIZATION_SINGLETON_HPP
diff --git a/include/boost/serialization/slist.hpp b/include/boost/serialization/slist.hpp
new file mode 100644
index 0000000..d9b971b
--- /dev/null
+++ b/include/boost/serialization/slist.hpp
@@ -0,0 +1,145 @@
+#ifndef BOOST_SERIALIZATION_SLIST_HPP
+#define BOOST_SERIALIZATION_SLIST_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// slist.hpp
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+#ifdef BOOST_HAS_SLIST
+#include BOOST_SLIST_HEADER
+
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/collections_load_imp.hpp>
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+#include <boost/serialization/detail/is_default_constructible.hpp>
+#include <boost/move/utility_core.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class U, class Allocator>
+inline void save(
+ Archive & ar,
+ const BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::stl::save_collection<
+ Archive,
+ BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator>
+ >(ar, t);
+}
+
+namespace stl {
+
+template<
+ class Archive,
+ class T,
+ class Allocator
+>
+typename boost::disable_if<
+ typename detail::is_default_constructible<
+ typename BOOST_STD_EXTENSION_NAMESPACE::slist<T, Allocator>::value_type
+ >,
+ void
+>::type
+collection_load_impl(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::slist<T, Allocator> &t,
+ collection_size_type count,
+ item_version_type item_version
+){
+ t.clear();
+ boost::serialization::detail::stack_construct<Archive, T> u(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ t.push_front(boost::move(u.reference()));
+ typename BOOST_STD_EXTENSION_NAMESPACE::slist<T, Allocator>::iterator last;
+ last = t.begin();
+ ar.reset_object_address(&(*t.begin()) , & u.reference());
+ while(--count > 0){
+ detail::stack_construct<Archive, T> u(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ last = t.insert_after(last, boost::move(u.reference()));
+ ar.reset_object_address(&(*last) , & u.reference());
+ }
+}
+
+} // stl
+
+template<class Archive, class U, class Allocator>
+inline void load(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator> &t,
+ const unsigned int file_version
+){
+ const boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ item_version_type item_version(0);
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ if(detail::is_default_constructible<U>()){
+ t.resize(count);
+ typename BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator>::iterator hint;
+ hint = t.begin();
+ while(count-- > 0){
+ ar >> boost::serialization::make_nvp("item", *hint++);
+ }
+ }
+ else{
+ t.clear();
+ boost::serialization::detail::stack_construct<Archive, U> u(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ t.push_front(boost::move(u.reference()));
+ typename BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator>::iterator last;
+ last = t.begin();
+ ar.reset_object_address(&(*t.begin()) , & u.reference());
+ while(--count > 0){
+ detail::stack_construct<Archive, U> u(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ last = t.insert_after(last, boost::move(u.reference()));
+ ar.reset_object_address(&(*last) , & u.reference());
+ }
+ }
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class U, class Allocator>
+inline void serialize(
+ Archive & ar,
+ BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(BOOST_STD_EXTENSION_NAMESPACE::slist)
+
+#endif // BOOST_HAS_SLIST
+#endif // BOOST_SERIALIZATION_SLIST_HPP
diff --git a/include/boost/serialization/smart_cast.hpp b/include/boost/serialization/smart_cast.hpp
new file mode 100644
index 0000000..563f36a
--- /dev/null
+++ b/include/boost/serialization/smart_cast.hpp
@@ -0,0 +1,275 @@
+#ifndef BOOST_SERIALIZATION_SMART_CAST_HPP
+#define BOOST_SERIALIZATION_SMART_CAST_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// smart_cast.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/serialization for updates, documentation, and revision history.
+
+// casting of pointers and references.
+
+// In casting between different C++ classes, there are a number of
+// rules that have to be kept in mind in deciding whether to use
+// static_cast or dynamic_cast.
+
+// a) dynamic casting can only be applied when one of the types is polymorphic
+// Otherwise static_cast must be used.
+// b) only dynamic casting can do runtime error checking
+// use of static_cast is generally un checked even when compiled for debug
+// c) static_cast would be considered faster than dynamic_cast.
+
+// If casting is applied to a template parameter, there is no apriori way
+// to know which of the two casting methods will be permitted or convenient.
+
+// smart_cast uses C++ type_traits, and program debug mode to select the
+// most convenient cast to use.
+
+#include <exception>
+#include <typeinfo>
+#include <cstddef> // NULL
+
+#include <boost/config.hpp>
+#include <boost/static_assert.hpp>
+
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/identity.hpp>
+
+#include <boost/serialization/throw_exception.hpp>
+
+namespace boost {
+namespace serialization {
+namespace smart_cast_impl {
+
+ template<class T>
+ struct reference {
+
+ struct polymorphic {
+
+ struct linear {
+ template<class U>
+ static T cast(U & u){
+ return static_cast< T >(u);
+ }
+ };
+
+ struct cross {
+ template<class U>
+ static T cast(U & u){
+ return dynamic_cast< T >(u);
+ }
+ };
+
+ template<class U>
+ static T cast(U & u){
+ // if we're in debug mode
+ #if ! defined(NDEBUG) \
+ || defined(__MWERKS__)
+ // do a checked dynamic cast
+ return cross::cast(u);
+ #else
+ // borland 5.51 chokes here so we can't use it
+ // note: if remove_reference isn't function for these types
+ // cross casting will be selected this will work but will
+ // not be the most efficient method. This will conflict with
+ // the original smart_cast motivation.
+ typedef typename mpl::eval_if<
+ typename mpl::and_<
+ mpl::not_<is_base_and_derived<
+ typename remove_reference< T >::type,
+ U
+ > >,
+ mpl::not_<is_base_and_derived<
+ U,
+ typename remove_reference< T >::type
+ > >
+ >,
+ // borland chokes w/o full qualification here
+ mpl::identity<cross>,
+ mpl::identity<linear>
+ >::type typex;
+ // typex works around gcc 2.95 issue
+ return typex::cast(u);
+ #endif
+ }
+ };
+
+ struct non_polymorphic {
+ template<class U>
+ static T cast(U & u){
+ return static_cast< T >(u);
+ }
+ };
+ template<class U>
+ static T cast(U & u){
+ typedef typename mpl::eval_if<
+ boost::is_polymorphic<U>,
+ mpl::identity<polymorphic>,
+ mpl::identity<non_polymorphic>
+ >::type typex;
+ return typex::cast(u);
+ }
+ };
+
+ template<class T>
+ struct pointer {
+
+ struct polymorphic {
+ // unfortunately, this below fails to work for virtual base
+ // classes. need has_virtual_base to do this.
+ // Subject for further study
+ #if 0
+ struct linear {
+ template<class U>
+ static T cast(U * u){
+ return static_cast< T >(u);
+ }
+ };
+
+ struct cross {
+ template<class U>
+ static T cast(U * u){
+ T tmp = dynamic_cast< T >(u);
+ #ifndef NDEBUG
+ if ( tmp == 0 ) throw_exception(std::bad_cast());
+ #endif
+ return tmp;
+ }
+ };
+
+ template<class U>
+ static T cast(U * u){
+ typedef
+ typename mpl::eval_if<
+ typename mpl::and_<
+ mpl::not_<is_base_and_derived<
+ typename remove_pointer< T >::type,
+ U
+ > >,
+ mpl::not_<is_base_and_derived<
+ U,
+ typename remove_pointer< T >::type
+ > >
+ >,
+ // borland chokes w/o full qualification here
+ mpl::identity<cross>,
+ mpl::identity<linear>
+ >::type typex;
+ return typex::cast(u);
+ }
+ #else
+ template<class U>
+ static T cast(U * u){
+ T tmp = dynamic_cast< T >(u);
+ #ifndef NDEBUG
+ if ( tmp == 0 ) throw_exception(std::bad_cast());
+ #endif
+ return tmp;
+ }
+ #endif
+ };
+
+ struct non_polymorphic {
+ template<class U>
+ static T cast(U * u){
+ return static_cast< T >(u);
+ }
+ };
+
+ template<class U>
+ static T cast(U * u){
+ typedef typename mpl::eval_if<
+ boost::is_polymorphic<U>,
+ mpl::identity<polymorphic>,
+ mpl::identity<non_polymorphic>
+ >::type typex;
+ return typex::cast(u);
+ }
+
+ };
+
+ template<class TPtr>
+ struct void_pointer {
+ template<class UPtr>
+ static TPtr cast(UPtr uptr){
+ return static_cast<TPtr>(uptr);
+ }
+ };
+
+ template<class T>
+ struct error {
+ // if we get here, its because we are using one argument in the
+ // cast on a system which doesn't support partial template
+ // specialization
+ template<class U>
+ static T cast(U){
+ BOOST_STATIC_ASSERT(sizeof(T)==0);
+ return * static_cast<T *>(NULL);
+ }
+ };
+
+} // smart_cast_impl
+
+// this implements:
+// smart_cast<Target *, Source *>(Source * s)
+// smart_cast<Target &, Source &>(s)
+// note that it will fail with
+// smart_cast<Target &>(s)
+template<class T, class U>
+T smart_cast(U u) {
+ typedef
+ typename mpl::eval_if<
+ typename mpl::or_<
+ boost::is_same<void *, U>,
+ boost::is_same<void *, T>,
+ boost::is_same<const void *, U>,
+ boost::is_same<const void *, T>
+ >,
+ mpl::identity<smart_cast_impl::void_pointer< T > >,
+ // else
+ typename mpl::eval_if<boost::is_pointer<U>,
+ mpl::identity<smart_cast_impl::pointer< T > >,
+ // else
+ typename mpl::eval_if<boost::is_reference<U>,
+ mpl::identity<smart_cast_impl::reference< T > >,
+ // else
+ mpl::identity<smart_cast_impl::error< T >
+ >
+ >
+ >
+ >::type typex;
+ return typex::cast(u);
+}
+
+// this implements:
+// smart_cast_reference<Target &>(Source & s)
+template<class T, class U>
+T smart_cast_reference(U & u) {
+ return smart_cast_impl::reference< T >::cast(u);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_SMART_CAST_HPP
diff --git a/include/boost/serialization/split_free.hpp b/include/boost/serialization/split_free.hpp
new file mode 100644
index 0000000..85e2f59
--- /dev/null
+++ b/include/boost/serialization/split_free.hpp
@@ -0,0 +1,93 @@
+#ifndef BOOST_SERIALIZATION_SPLIT_FREE_HPP
+#define BOOST_SERIALIZATION_SPLIT_FREE_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// split_free.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/serialization/serialization.hpp>
+
+namespace boost {
+namespace archive {
+ namespace detail {
+ template<class Archive> class interface_oarchive;
+ template<class Archive> class interface_iarchive;
+ } // namespace detail
+} // namespace archive
+
+namespace serialization {
+
+//namespace detail {
+template<class Archive, class T>
+struct free_saver {
+ static void invoke(
+ Archive & ar,
+ const T & t,
+ const unsigned int file_version
+ ){
+ // use function overload (version_type) to workaround
+ // two-phase lookup issue
+ const version_type v(file_version);
+ save(ar, t, v);
+ }
+};
+template<class Archive, class T>
+struct free_loader {
+ static void invoke(
+ Archive & ar,
+ T & t,
+ const unsigned int file_version
+ ){
+ // use function overload (version_type) to workaround
+ // two-phase lookup issue
+ const version_type v(file_version);
+ load(ar, t, v);
+ }
+};
+//} // namespace detail
+
+template<class Archive, class T>
+inline void split_free(
+ Archive & ar,
+ T & t,
+ const unsigned int file_version
+){
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
+ mpl::identity</* detail:: */ free_saver<Archive, T> >,
+ mpl::identity</* detail:: */ free_loader<Archive, T> >
+ >::type typex;
+ typex::invoke(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#define BOOST_SERIALIZATION_SPLIT_FREE(T) \
+namespace boost { namespace serialization { \
+template<class Archive> \
+inline void serialize( \
+ Archive & ar, \
+ T & t, \
+ const unsigned int file_version \
+){ \
+ split_free(ar, t, file_version); \
+} \
+}}
+/**/
+
+#endif // BOOST_SERIALIZATION_SPLIT_FREE_HPP
diff --git a/include/boost/serialization/split_member.hpp b/include/boost/serialization/split_member.hpp
new file mode 100644
index 0000000..5f32520
--- /dev/null
+++ b/include/boost/serialization/split_member.hpp
@@ -0,0 +1,86 @@
+#ifndef BOOST_SERIALIZATION_SPLIT_MEMBER_HPP
+#define BOOST_SERIALIZATION_SPLIT_MEMBER_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// split_member.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+
+#include <boost/serialization/access.hpp>
+
+namespace boost {
+namespace archive {
+ namespace detail {
+ template<class Archive> class interface_oarchive;
+ template<class Archive> class interface_iarchive;
+ } // namespace detail
+} // namespace archive
+
+namespace serialization {
+namespace detail {
+
+ template<class Archive, class T>
+ struct member_saver {
+ static void invoke(
+ Archive & ar,
+ const T & t,
+ const unsigned int file_version
+ ){
+ access::member_save(ar, t, file_version);
+ }
+ };
+
+ template<class Archive, class T>
+ struct member_loader {
+ static void invoke(
+ Archive & ar,
+ T & t,
+ const unsigned int file_version
+ ){
+ access::member_load(ar, t, file_version);
+ }
+ };
+
+} // detail
+
+template<class Archive, class T>
+inline void split_member(
+ Archive & ar, T & t, const unsigned int file_version
+){
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
+ mpl::identity<detail::member_saver<Archive, T> >,
+ mpl::identity<detail::member_loader<Archive, T> >
+ >::type typex;
+ typex::invoke(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+// split member function serialize funcition into save/load
+#define BOOST_SERIALIZATION_SPLIT_MEMBER() \
+template<class Archive> \
+void serialize( \
+ Archive &ar, \
+ const unsigned int file_version \
+){ \
+ boost::serialization::split_member(ar, *this, file_version); \
+} \
+/**/
+
+#endif // BOOST_SERIALIZATION_SPLIT_MEMBER_HPP
diff --git a/include/boost/serialization/stack.hpp b/include/boost/serialization/stack.hpp
new file mode 100644
index 0000000..96f90fe
--- /dev/null
+++ b/include/boost/serialization/stack.hpp
@@ -0,0 +1,76 @@
+#ifndef BOOST_SERIALIZATION_STACK_HPP
+#define BOOST_SERIALIZATION_STACK_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
+// stack.hpp
+
+// (C) Copyright 2014 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <stack>
+#include <boost/config.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
+namespace boost {
+namespace serialization {
+namespace detail{
+
+template <typename U, typename C>
+struct stack_save : public STD::stack<U, C> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) const {
+ save(ar, STD::stack<U, C>::c, file_version);
+ }
+};
+template <typename U, typename C>
+struct stack_load : public STD::stack<U, C> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) {
+ load(ar, STD::stack<U, C>::c, file_version);
+ }
+};
+
+} // detail
+
+template<class Archive, class T, class C>
+inline void serialize(
+ Archive & ar,
+ std::stack< T, C> & t,
+ const unsigned int file_version
+){
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
+ mpl::identity<detail::stack_save<T, C> >,
+ mpl::identity<detail::stack_load<T, C> >
+ >::type typex;
+ static_cast<typex &>(t)(ar, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::stack)
+
+#undef STD
+
+#endif // BOOST_SERIALIZATION_DEQUE_HPP
diff --git a/include/boost/serialization/state_saver.hpp b/include/boost/serialization/state_saver.hpp
new file mode 100644
index 0000000..248b8d9
--- /dev/null
+++ b/include/boost/serialization/state_saver.hpp
@@ -0,0 +1,96 @@
+#ifndef BOOST_SERIALIZATION_STATE_SAVER_HPP
+#define BOOST_SERIALIZATION_STATE_SAVER_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// state_saver.hpp:
+
+// (C) Copyright 2003-4 Pavel Vozenilek and Robert Ramey - http://www.rrsd.com.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/serialization for updates, documentation, and revision history.
+
+// Inspired by Daryle Walker's iostate_saver concept. This saves the original
+// value of a variable when a state_saver is constructed and restores
+// upon destruction. Useful for being sure that state is restored to
+// variables upon exit from scope.
+
+
+#include <boost/config.hpp>
+#ifndef BOOST_NO_EXCEPTIONS
+ #include <exception>
+#endif
+
+#include <boost/call_traits.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/type_traits/has_nothrow_copy.hpp>
+#include <boost/core/no_exceptions_support.hpp>
+
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class T>
+// T requirements:
+// - POD or object semantic (cannot be reference, function, ...)
+// - copy constructor
+// - operator = (no-throw one preferred)
+class state_saver : private boost::noncopyable
+{
+private:
+ const T previous_value;
+ T & previous_ref;
+
+ struct restore {
+ static void invoke(T & previous_ref, const T & previous_value){
+ previous_ref = previous_value; // won't throw
+ }
+ };
+
+ struct restore_with_exception {
+ static void invoke(T & previous_ref, const T & previous_value){
+ BOOST_TRY{
+ previous_ref = previous_value;
+ }
+ BOOST_CATCH(::std::exception &) {
+ // we must ignore it - we are in destructor
+ }
+ BOOST_CATCH_END
+ }
+ };
+
+public:
+ state_saver(
+ T & object
+ ) :
+ previous_value(object),
+ previous_ref(object)
+ {}
+
+ ~state_saver() {
+ #ifndef BOOST_NO_EXCEPTIONS
+ typedef typename mpl::eval_if<
+ has_nothrow_copy< T >,
+ mpl::identity<restore>,
+ mpl::identity<restore_with_exception>
+ >::type typex;
+ typex::invoke(previous_ref, previous_value);
+ #else
+ previous_ref = previous_value;
+ #endif
+ }
+
+}; // state_saver<>
+
+} // serialization
+} // boost
+
+#endif //BOOST_SERIALIZATION_STATE_SAVER_HPP
diff --git a/include/boost/serialization/static_warning.hpp b/include/boost/serialization/static_warning.hpp
new file mode 100644
index 0000000..1d9238f
--- /dev/null
+++ b/include/boost/serialization/static_warning.hpp
@@ -0,0 +1,103 @@
+#ifndef BOOST_SERIALIZATION_STATIC_WARNING_HPP
+#define BOOST_SERIALIZATION_STATIC_WARNING_HPP
+
+// (C) Copyright Robert Ramey 2003. Jonathan Turkanis 2004.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/static_assert for documentation.
+
+/*
+ Revision history:
+ 15 June 2003 - Initial version.
+ 31 March 2004 - improved diagnostic messages and portability
+ (Jonathan Turkanis)
+ 03 April 2004 - works on VC6 at class and namespace scope
+ - ported to DigitalMars
+ - static warnings disabled by default; when enabled,
+ uses pragmas to enable required compiler warnings
+ on MSVC, Intel, Metrowerks and Borland 5.x.
+ (Jonathan Turkanis)
+ 30 May 2004 - tweaked for msvc 7.1 and gcc 3.3
+ - static warnings ENabled by default; when enabled,
+ (Robert Ramey)
+*/
+
+#include <boost/config.hpp>
+
+//
+// Implementation
+// Makes use of the following warnings:
+// 1. GCC prior to 3.3: division by zero.
+// 2. BCC 6.0 preview: unreferenced local variable.
+// 3. DigitalMars: returning address of local automatic variable.
+// 4. VC6: class previously seen as struct (as in 'boost/mpl/print.hpp')
+// 5. All others: deletion of pointer to incomplete type.
+//
+// The trick is to find code which produces warnings containing the name of
+// a structure or variable. Details, with same numbering as above:
+// 1. static_warning_impl<B>::value is zero iff B is false, so diving an int
+// by this value generates a warning iff B is false.
+// 2. static_warning_impl<B>::type has a constructor iff B is true, so an
+// unreferenced variable of this type generates a warning iff B is false.
+// 3. static_warning_impl<B>::type overloads operator& to return a dynamically
+// allocated int pointer only is B is true, so returning the address of an
+// automatic variable of this type generates a warning iff B is fasle.
+// 4. static_warning_impl<B>::STATIC_WARNING is decalred as a struct iff B is
+// false.
+// 5. static_warning_impl<B>::type is incomplete iff B is false, so deleting a
+// pointer to this type generates a warning iff B is false.
+//
+
+//------------------Enable selected warnings----------------------------------//
+
+// Enable the warnings relied on by BOOST_STATIC_WARNING, where possible.
+
+// 6. replaced implementation with one which depends solely on
+// mpl::print<>. The previous one was found to fail for functions
+// under recent versions of gcc and intel compilers - Robert Ramey
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/print.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/bool_fwd.hpp>
+#include <boost/static_assert.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<int L>
+struct BOOST_SERIALIZATION_STATIC_WARNING_LINE{};
+
+template<bool B, int L>
+struct static_warning_test{
+ typename boost::mpl::eval_if_c<
+ B,
+ boost::mpl::true_,
+ typename boost::mpl::identity<
+ boost::mpl::print<
+ BOOST_SERIALIZATION_STATIC_WARNING_LINE<L>
+ >
+ >
+ >::type type;
+};
+
+template<int i>
+struct BOOST_SERIALIZATION_SS {};
+
+} // serialization
+} // boost
+
+#define BOOST_SERIALIZATION_BSW(B, L) \
+ typedef boost::serialization::BOOST_SERIALIZATION_SS< \
+ sizeof( boost::serialization::static_warning_test< B, L > ) \
+ > BOOST_JOIN(STATIC_WARNING_LINE, L) BOOST_ATTRIBUTE_UNUSED;
+#define BOOST_STATIC_WARNING(B) BOOST_SERIALIZATION_BSW(B, __LINE__)
+
+#endif // BOOST_SERIALIZATION_STATIC_WARNING_HPP
diff --git a/include/boost/serialization/string.hpp b/include/boost/serialization/string.hpp
new file mode 100644
index 0000000..76e695d
--- /dev/null
+++ b/include/boost/serialization/string.hpp
@@ -0,0 +1,30 @@
+#ifndef BOOST_SERIALIZATION_STRING_HPP
+#define BOOST_SERIALIZATION_STRING_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization/string.hpp:
+// serialization for stl string templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <string>
+
+#include <boost/config.hpp>
+#include <boost/serialization/level.hpp>
+
+BOOST_CLASS_IMPLEMENTATION(std::string, boost::serialization::primitive_type)
+#ifndef BOOST_NO_STD_WSTRING
+BOOST_CLASS_IMPLEMENTATION(std::wstring, boost::serialization::primitive_type)
+#endif
+
+#endif // BOOST_SERIALIZATION_STRING_HPP
diff --git a/include/boost/serialization/strong_typedef.hpp b/include/boost/serialization/strong_typedef.hpp
new file mode 100644
index 0000000..fdd1b24
--- /dev/null
+++ b/include/boost/serialization/strong_typedef.hpp
@@ -0,0 +1,50 @@
+#ifndef BOOST_SERIALIZATION_STRONG_TYPEDEF_HPP
+#define BOOST_SERIALIZATION_STRONG_TYPEDEF_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// strong_typedef.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2016 Ashish Sadanandan
+// 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/libs/serialization for updates, documentation, and revision history.
+
+// macro used to implement a strong typedef. strong typedef
+// guarentees that two types are distinguised even though the
+// share the same underlying implementation. typedef does not create
+// a new type. BOOST_STRONG_TYPEDEF(T, D) creates a new type named D
+// that operates as a type T.
+
+#include <boost/config.hpp>
+#include <boost/operators.hpp>
+#include <boost/type_traits/has_nothrow_assign.hpp>
+#include <boost/type_traits/has_nothrow_constructor.hpp>
+#include <boost/type_traits/has_nothrow_copy.hpp>
+
+#define BOOST_STRONG_TYPEDEF(T, D) \
+struct D \
+ : boost::totally_ordered1< D \
+ , boost::totally_ordered2< D, T \
+ > > \
+{ \
+ T t; \
+ explicit D(const T& t_) BOOST_NOEXCEPT_IF(boost::has_nothrow_copy_constructor<T>::value) : t(t_) {} \
+ D() BOOST_NOEXCEPT_IF(boost::has_nothrow_default_constructor<T>::value) : t() {} \
+ D(const D & t_) BOOST_NOEXCEPT_IF(boost::has_nothrow_copy_constructor<T>::value) : t(t_.t) {} \
+ D& operator=(const D& rhs) BOOST_NOEXCEPT_IF(boost::has_nothrow_assign<T>::value) {t = rhs.t; return *this;} \
+ D& operator=(const T& rhs) BOOST_NOEXCEPT_IF(boost::has_nothrow_assign<T>::value) {t = rhs; return *this;} \
+ operator const T&() const {return t;} \
+ operator T&() {return t;} \
+ bool operator==(const D& rhs) const {return t == rhs.t;} \
+ bool operator<(const D& rhs) const {return t < rhs.t;} \
+};
+
+#endif // BOOST_SERIALIZATION_STRONG_TYPEDEF_HPP
diff --git a/include/boost/serialization/throw_exception.hpp b/include/boost/serialization/throw_exception.hpp
new file mode 100644
index 0000000..b67618a
--- /dev/null
+++ b/include/boost/serialization/throw_exception.hpp
@@ -0,0 +1,44 @@
+#ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED
+#define BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+// boost/throw_exception.hpp
+//
+// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+//
+// 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>
+
+#ifndef BOOST_NO_EXCEPTIONS
+#include <exception>
+#endif
+
+namespace boost {
+namespace serialization {
+
+#ifdef BOOST_NO_EXCEPTIONS
+
+inline void throw_exception(std::exception const & e) {
+ ::boost::throw_exception(e);
+}
+
+#else
+
+template<class E> inline void throw_exception(E const & e){
+ throw e;
+}
+
+#endif
+
+} // namespace serialization
+} // namespace boost
+
+#endif // #ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED
diff --git a/include/boost/serialization/tracking.hpp b/include/boost/serialization/tracking.hpp
new file mode 100644
index 0000000..d5c79b8
--- /dev/null
+++ b/include/boost/serialization/tracking.hpp
@@ -0,0 +1,118 @@
+#ifndef BOOST_SERIALIZATION_TRACKING_HPP
+#define BOOST_SERIALIZATION_TRACKING_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// tracking.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/equal_to.hpp>
+#include <boost/mpl/greater.hpp>
+#include <boost/mpl/integral_c_tag.hpp>
+
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/serialization/level.hpp>
+#include <boost/serialization/tracking_enum.hpp>
+#include <boost/serialization/type_info_implementation.hpp>
+
+namespace boost {
+namespace serialization {
+
+struct basic_traits;
+
+// default tracking level
+template<class T>
+struct tracking_level_impl {
+ template<class U>
+ struct traits_class_tracking {
+ typedef typename U::tracking type;
+ };
+ typedef mpl::integral_c_tag tag;
+ // note: at least one compiler complained w/o the full qualification
+ // on basic traits below
+ typedef
+ typename mpl::eval_if<
+ is_base_and_derived<boost::serialization::basic_traits, T>,
+ traits_class_tracking< T >,
+ //else
+ typename mpl::eval_if<
+ is_pointer< T >,
+ // pointers are not tracked by default
+ mpl::int_<track_never>,
+ //else
+ typename mpl::eval_if<
+ // for primitives
+ typename mpl::equal_to<
+ implementation_level< T >,
+ mpl::int_<primitive_type>
+ >,
+ // is never
+ mpl::int_<track_never>,
+ // otherwise its selective
+ mpl::int_<track_selectively>
+ > > >::type type;
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+};
+
+template<class T>
+struct tracking_level :
+ public tracking_level_impl<const T>
+{
+};
+
+template<class T, enum tracking_type L>
+inline bool operator>=(tracking_level< T > t, enum tracking_type l)
+{
+ return t.value >= (int)l;
+}
+
+} // namespace serialization
+} // namespace boost
+
+
+// The STATIC_ASSERT is prevents one from setting tracking for a primitive type.
+// This almost HAS to be an error. Doing this will effect serialization of all
+// char's in your program which is almost certainly what you don't want to do.
+// If you want to track all instances of a given primitive type, You'll have to
+// wrap it in your own type so its not a primitive anymore. Then it will compile
+// without problem.
+#define BOOST_CLASS_TRACKING(T, E) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct tracking_level< T > \
+{ \
+ typedef mpl::integral_c_tag tag; \
+ typedef mpl::int_< E> type; \
+ BOOST_STATIC_CONSTANT( \
+ int, \
+ value = tracking_level::type::value \
+ ); \
+ /* tracking for a class */ \
+ BOOST_STATIC_ASSERT(( \
+ mpl::greater< \
+ /* that is a prmitive */ \
+ implementation_level< T >, \
+ mpl::int_<primitive_type> \
+ >::value \
+ )); \
+}; \
+}}
+
+#endif // BOOST_SERIALIZATION_TRACKING_HPP
diff --git a/include/boost/serialization/tracking_enum.hpp b/include/boost/serialization/tracking_enum.hpp
new file mode 100644
index 0000000..278051e
--- /dev/null
+++ b/include/boost/serialization/tracking_enum.hpp
@@ -0,0 +1,41 @@
+#ifndef BOOST_SERIALIZATION_TRACKING_ENUM_HPP
+#define BOOST_SERIALIZATION_TRACKING_ENUM_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// tracking_enum.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+namespace boost {
+namespace serialization {
+
+// addresses of serialized objects may be tracked to avoid saving/loading
+// redundant copies. This header defines a class trait that can be used
+// to specify when objects should be tracked
+
+// names for each tracking level
+enum tracking_type
+{
+ // never track this type
+ track_never = 0,
+ // track objects of this type if the object is serialized through a
+ // pointer.
+ track_selectively = 1,
+ // always track this type
+ track_always = 2
+};
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_TRACKING_ENUM_HPP
diff --git a/include/boost/serialization/traits.hpp b/include/boost/serialization/traits.hpp
new file mode 100644
index 0000000..9e114fd
--- /dev/null
+++ b/include/boost/serialization/traits.hpp
@@ -0,0 +1,65 @@
+#ifndef BOOST_SERIALIZATION_TRAITS_HPP
+#define BOOST_SERIALIZATION_TRAITS_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// traits.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// This header is used to apply serialization traits to templates. The
+// standard system can't be used for platforms which don't support
+// Partial Templlate Specialization.
+
+// The motivation for this is the Name-Value Pair (NVP) template.
+// it has to work the same on all platforms in order for archives
+// to be portable accross platforms.
+
+#include <boost/config.hpp>
+#include <boost/static_assert.hpp>
+
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/bool_fwd.hpp>
+#include <boost/serialization/level_enum.hpp>
+#include <boost/serialization/tracking_enum.hpp>
+
+namespace boost {
+namespace serialization {
+
+// common base class used to detect appended traits class
+struct basic_traits {};
+
+template <class T>
+struct extended_type_info_impl;
+
+template<
+ class T,
+ int Level,
+ int Tracking,
+ unsigned int Version = 0,
+ class ETII = extended_type_info_impl< T >,
+ class Wrapper = mpl::false_
+>
+struct traits : public basic_traits {
+ BOOST_STATIC_ASSERT(Version == 0 || Level >= object_class_info);
+ BOOST_STATIC_ASSERT(Tracking == track_never || Level >= object_serializable);
+ typedef typename mpl::int_<Level> level;
+ typedef typename mpl::int_<Tracking> tracking;
+ typedef typename mpl::int_<Version> version;
+ typedef ETII type_info_implementation;
+ typedef Wrapper is_wrapper;
+};
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_TRAITS_HPP
diff --git a/include/boost/serialization/type_info_implementation.hpp b/include/boost/serialization/type_info_implementation.hpp
new file mode 100644
index 0000000..24637a8
--- /dev/null
+++ b/include/boost/serialization/type_info_implementation.hpp
@@ -0,0 +1,73 @@
+#ifndef BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP
+#define BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// type_info_implementation.hpp: interface for portable version of type_info
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/static_assert.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/serialization/traits.hpp>
+
+namespace boost {
+namespace serialization {
+
+// note that T and const T are folded into const T so that
+// there is only one table entry per type
+template<class T>
+struct type_info_implementation {
+ template<class U>
+ struct traits_class_typeinfo_implementation {
+ typedef typename U::type_info_implementation::type type;
+ };
+ // note: at least one compiler complained w/o the full qualification
+ // on basic traits below
+ typedef
+ typename mpl::eval_if<
+ is_base_and_derived<boost::serialization::basic_traits, T>,
+ traits_class_typeinfo_implementation< T >,
+ //else
+ mpl::identity<
+ typename extended_type_info_impl< T >::type
+ >
+ >::type type;
+};
+
+} // namespace serialization
+} // namespace boost
+
+// define a macro to assign a particular derivation of extended_type_info
+// to a specified a class.
+#define BOOST_CLASS_TYPE_INFO(T, ETI) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct type_info_implementation< T > { \
+ typedef ETI type; \
+}; \
+template<> \
+struct type_info_implementation< const T > { \
+ typedef ETI type; \
+}; \
+} \
+} \
+/**/
+
+#endif /// BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP
diff --git a/include/boost/serialization/unique_ptr.hpp b/include/boost/serialization/unique_ptr.hpp
new file mode 100644
index 0000000..8d8703e
--- /dev/null
+++ b/include/boost/serialization/unique_ptr.hpp
@@ -0,0 +1,68 @@
+#ifndef BOOST_SERIALIZATION_UNIQUE_PTR_HPP
+#define BOOST_SERIALIZATION_UNIQUE_PTR_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// unique_ptr.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+#include <memory>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/nvp.hpp>
+
+namespace boost {
+namespace serialization {
+
+/////////////////////////////////////////////////////////////
+// implement serialization for unique_ptr< T >
+// note: this must be added to the boost namespace in order to
+// be called by the library
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const std::unique_ptr< T > &t,
+ const unsigned int /*file_version*/
+){
+ // only the raw pointer has to be saved
+ // the ref count is rebuilt automatically on load
+ const T * const tx = t.get();
+ ar << BOOST_SERIALIZATION_NVP(tx);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ std::unique_ptr< T > &t,
+ const unsigned int /*file_version*/
+){
+ T *tx;
+ ar >> BOOST_SERIALIZATION_NVP(tx);
+ // note that the reset automagically maintains the reference count
+ t.reset(tx);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ std::unique_ptr< T > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+
+#endif // BOOST_SERIALIZATION_UNIQUE_PTR_HPP
diff --git a/include/boost/serialization/unordered_collections_load_imp.hpp b/include/boost/serialization/unordered_collections_load_imp.hpp
new file mode 100644
index 0000000..d56a423
--- /dev/null
+++ b/include/boost/serialization/unordered_collections_load_imp.hpp
@@ -0,0 +1,73 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_LOAD_IMP_HPP
+#define BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_LOAD_IMP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+# pragma warning (disable : 4786) // too long name, harmless warning
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// unordered_collections_load_imp.hpp: serialization for loading stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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.
+
+// helper function templates for serialization of collections
+
+#include <boost/assert.hpp>
+#include <cstddef> // size_t
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+#include <boost/detail/workaround.hpp>
+
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+namespace boost{
+namespace serialization {
+namespace stl {
+
+//////////////////////////////////////////////////////////////////////
+// implementation of serialization for STL containers
+//
+template<class Archive, class Container, class InputFunction>
+inline void load_unordered_collection(Archive & ar, Container &s)
+{
+ collection_size_type count;
+ collection_size_type bucket_count;
+ boost::serialization::item_version_type item_version(0);
+ boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ ar >> BOOST_SERIALIZATION_NVP(bucket_count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ s.clear();
+ s.rehash(bucket_count);
+ InputFunction ifunc;
+ while(count-- > 0){
+ ifunc(ar, s, item_version);
+ }
+}
+
+} // namespace stl
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_LOAD_IMP_HPP
diff --git a/include/boost/serialization/unordered_collections_save_imp.hpp b/include/boost/serialization/unordered_collections_save_imp.hpp
new file mode 100644
index 0000000..56746eb
--- /dev/null
+++ b/include/boost/serialization/unordered_collections_save_imp.hpp
@@ -0,0 +1,86 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_HPP
+#define BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_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
+// hash_collections_save_imp.hpp: serialization for stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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.
+
+// helper function templates for serialization of collections
+
+#include <boost/config.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/serialization.hpp>
+#include <boost/serialization/version.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+namespace boost{
+namespace serialization {
+namespace stl {
+
+//////////////////////////////////////////////////////////////////////
+// implementation of serialization for STL containers
+//
+
+template<class Archive, class Container>
+inline void save_unordered_collection(Archive & ar, const Container &s)
+{
+ collection_size_type count(s.size());
+ const collection_size_type bucket_count(s.bucket_count());
+ const item_version_type item_version(
+ version<typename Container::value_type>::value
+ );
+
+ #if 0
+ /* should only be necessary to create archives of previous versions
+ * which is not currently supported. So for now comment this out
+ */
+ boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ ar << BOOST_SERIALIZATION_NVP(count);
+ ar << BOOST_SERIALIZATION_NVP(bucket_count);
+ if(boost::archive::library_version_type(3) < library_version){
+ // record number of elements
+ // make sure the target type is registered so we can retrieve
+ // the version when we load
+ ar << BOOST_SERIALIZATION_NVP(item_version);
+ }
+ #else
+ ar << BOOST_SERIALIZATION_NVP(count);
+ ar << BOOST_SERIALIZATION_NVP(bucket_count);
+ ar << BOOST_SERIALIZATION_NVP(item_version);
+ #endif
+
+ typename Container::const_iterator it = s.begin();
+ while(count-- > 0){
+ // note borland emits a no-op without the explicit namespace
+ boost::serialization::save_construct_data_adl(
+ ar,
+ &(*it),
+ boost::serialization::version<
+ typename Container::value_type
+ >::value
+ );
+ ar << boost::serialization::make_nvp("item", *it++);
+ }
+}
+
+} // namespace stl
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_HPP
diff --git a/include/boost/serialization/unordered_map.hpp b/include/boost/serialization/unordered_map.hpp
new file mode 100644
index 0000000..4fdbddd
--- /dev/null
+++ b/include/boost/serialization/unordered_map.hpp
@@ -0,0 +1,160 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_MAP_HPP
+#define BOOST_SERIALIZATION_UNORDERED_MAP_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
+// serialization/unordered_map.hpp:
+// serialization for stl unordered_map templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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 <boost/config.hpp>
+
+#include <unordered_map>
+
+#include <boost/serialization/utility.hpp>
+#include <boost/serialization/unordered_collections_save_imp.hpp>
+#include <boost/serialization/unordered_collections_load_imp.hpp>
+#include <boost/serialization/archive_input_unordered_map.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const std::unordered_map<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ std::unordered_map<Key, HashFcn, EqualKey, Allocator>
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ std::unordered_map<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ std::unordered_map<Key, HashFcn, EqualKey, Allocator>,
+ boost::serialization::stl::archive_input_unordered_map<
+ Archive,
+ std::unordered_map<Key, HashFcn, EqualKey, Allocator>
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ std::unordered_map<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// unordered_multimap
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ std::unordered_multimap<Key, HashFcn, EqualKey, Allocator>
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_unordered_multimap<
+ Archive,
+ std::unordered_multimap<Key, HashFcn, EqualKey, Allocator>
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_UNORDERED_MAP_HPP
diff --git a/include/boost/serialization/unordered_set.hpp b/include/boost/serialization/unordered_set.hpp
new file mode 100644
index 0000000..adfee60
--- /dev/null
+++ b/include/boost/serialization/unordered_set.hpp
@@ -0,0 +1,162 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_SET_HPP
+#define BOOST_SERIALIZATION_UNORDERED_SET_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
+// unordered_set.hpp: serialization for stl unordered_set templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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 <boost/config.hpp>
+
+#include <unordered_set>
+
+#include <boost/serialization/unordered_collections_save_imp.hpp>
+#include <boost/serialization/unordered_collections_load_imp.hpp>
+#include <boost/serialization/archive_input_unordered_set.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ std::unordered_set<Key, HashFcn, EqualKey, Allocator>
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ std::unordered_set<Key, HashFcn, EqualKey, Allocator>,
+ stl::archive_input_unordered_set<
+ Archive,
+ std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ split_free(ar, t, file_version);
+}
+
+// unordered_multiset
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const std::unordered_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ stl::save_unordered_collection<
+ Archive,
+ std::unordered_multiset<Key, HashFcn, EqualKey, Allocator>
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ std::unordered_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ std::unordered_multiset<Key, HashFcn, EqualKey, Allocator>,
+ boost::serialization::stl::archive_input_unordered_multiset<
+ Archive,
+ std::unordered_multiset<Key, HashFcn, EqualKey, Allocator>
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ std::unordered_multiset<Key, HashFcn, EqualKey, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_UNORDERED_SET_HPP
diff --git a/include/boost/serialization/utility.hpp b/include/boost/serialization/utility.hpp
new file mode 100644
index 0000000..4867a4a
--- /dev/null
+++ b/include/boost/serialization/utility.hpp
@@ -0,0 +1,56 @@
+#ifndef BOOST_SERIALIZATION_UTILITY_HPP
+#define BOOST_SERIALIZATION_UTILITY_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization/utility.hpp:
+// serialization for stl utility templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <utility>
+#include <boost/config.hpp>
+
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/is_bitwise_serializable.hpp>
+#include <boost/mpl/and.hpp>
+
+namespace boost {
+namespace serialization {
+
+// pair
+template<class Archive, class F, class S>
+inline void serialize(
+ Archive & ar,
+ std::pair<F, S> & p,
+ const unsigned int /* file_version */
+){
+ // note: we remove any const-ness on the first argument. The reason is that
+ // for stl maps, the type saved is pair<const key, T). We remove
+ // the const-ness in order to be able to load it.
+ typedef typename boost::remove_const<F>::type typef;
+ ar & boost::serialization::make_nvp("first", const_cast<typef &>(p.first));
+ ar & boost::serialization::make_nvp("second", p.second);
+}
+
+/// specialization of is_bitwise_serializable for pairs
+template <class T, class U>
+struct is_bitwise_serializable<std::pair<T,U> >
+ : public mpl::and_<is_bitwise_serializable< T >,is_bitwise_serializable<U> >
+{
+};
+
+} // serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_UTILITY_HPP
diff --git a/include/boost/serialization/valarray.hpp b/include/boost/serialization/valarray.hpp
new file mode 100644
index 0000000..e7ec81a
--- /dev/null
+++ b/include/boost/serialization/valarray.hpp
@@ -0,0 +1,87 @@
+#ifndef BOOST_SERIALIZATION_VALARAY_HPP
+#define BOOST_SERIALIZATION_VALARAY_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// valarray.hpp: serialization for stl vector templates
+
+// (C) Copyright 2005 Matthias Troyer .
+// 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 <valarray>
+#include <boost/config.hpp>
+#include <boost/core/addressof.hpp>
+
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/collections_load_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/array_wrapper.hpp>
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
+namespace boost {
+namespace serialization {
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// valarray< T >
+
+template<class Archive, class U>
+void save( Archive & ar, const STD::valarray<U> &t, const unsigned int /*file_version*/ )
+{
+ const collection_size_type count(t.size());
+ ar << BOOST_SERIALIZATION_NVP(count);
+ if (t.size()){
+ // explict template arguments to pass intel C++ compiler
+ ar << serialization::make_array<const U, collection_size_type>(
+ static_cast<const U *>( boost::addressof(t[0]) ),
+ count
+ );
+ }
+}
+
+template<class Archive, class U>
+void load( Archive & ar, STD::valarray<U> &t, const unsigned int /*file_version*/ )
+{
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ t.resize(count);
+ if (t.size()){
+ // explict template arguments to pass intel C++ compiler
+ ar >> serialization::make_array<U, collection_size_type>(
+ static_cast<U *>( boost::addressof(t[0]) ),
+ count
+ );
+ }
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class U>
+inline void serialize( Archive & ar, STD::valarray<U> & t, const unsigned int file_version)
+{
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} } // end namespace boost::serialization
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::valarray)
+#undef STD
+
+#endif // BOOST_SERIALIZATION_VALARAY_HPP
diff --git a/include/boost/serialization/variant.hpp b/include/boost/serialization/variant.hpp
new file mode 100644
index 0000000..8edda9a
--- /dev/null
+++ b/include/boost/serialization/variant.hpp
@@ -0,0 +1,178 @@
+#ifndef BOOST_SERIALIZATION_VARIANT_HPP
+#define BOOST_SERIALIZATION_VARIANT_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// variant.hpp - non-intrusive serialization of variant types
+//
+// copyright (c) 2005
+// troy d. straszheim <troy@resophonic.com>
+// http://www.resophonic.com
+//
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org for updates, documentation, and revision history.
+//
+// thanks to Robert Ramey, Peter Dimov, and Richard Crossley.
+//
+
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/pop_front.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/empty.hpp>
+
+#include <boost/serialization/throw_exception.hpp>
+
+#include <boost/variant.hpp>
+
+#include <boost/archive/archive_exception.hpp>
+
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/serialization.hpp>
+#include <boost/serialization/nvp.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class Archive>
+struct variant_save_visitor :
+ boost::static_visitor<>
+{
+ variant_save_visitor(Archive& ar) :
+ m_ar(ar)
+ {}
+ template<class T>
+ void operator()(T const & value) const
+ {
+ m_ar << BOOST_SERIALIZATION_NVP(value);
+ }
+private:
+ Archive & m_ar;
+};
+
+template<class Archive, BOOST_VARIANT_ENUM_PARAMS(/* typename */ class T)>
+void save(
+ Archive & ar,
+ boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const & v,
+ unsigned int /*version*/
+){
+ int which = v.which();
+ ar << BOOST_SERIALIZATION_NVP(which);
+ variant_save_visitor<Archive> visitor(ar);
+ v.apply_visitor(visitor);
+}
+
+template<class S>
+struct variant_impl {
+
+ struct load_null {
+ template<class Archive, class V>
+ static void invoke(
+ Archive & /*ar*/,
+ int /*which*/,
+ V & /*v*/,
+ const unsigned int /*version*/
+ ){}
+ };
+
+ struct load_impl {
+ template<class Archive, class V>
+ static void invoke(
+ Archive & ar,
+ int which,
+ V & v,
+ const unsigned int version
+ ){
+ if(which == 0){
+ // note: A non-intrusive implementation (such as this one)
+ // necessary has to copy the value. This wouldn't be necessary
+ // with an implementation that de-serialized to the address of the
+ // aligned storage included in the variant.
+ typedef typename mpl::front<S>::type head_type;
+ head_type value;
+ ar >> BOOST_SERIALIZATION_NVP(value);
+ v = value;
+ head_type * new_address = & boost::get<head_type>(v);
+ ar.reset_object_address(new_address, & value);
+ return;
+ }
+ typedef typename mpl::pop_front<S>::type type;
+ variant_impl<type>::load(ar, which - 1, v, version);
+ }
+ };
+
+ template<class Archive, class V>
+ static void load(
+ Archive & ar,
+ int which,
+ V & v,
+ const unsigned int version
+ ){
+ typedef typename mpl::eval_if<mpl::empty<S>,
+ mpl::identity<load_null>,
+ mpl::identity<load_impl>
+ >::type typex;
+ typex::invoke(ar, which, v, version);
+ }
+
+};
+
+template<class Archive, BOOST_VARIANT_ENUM_PARAMS(/* typename */ class T)>
+void load(
+ Archive & ar,
+ boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>& v,
+ const unsigned int version
+){
+ int which;
+ typedef typename boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types types;
+ ar >> BOOST_SERIALIZATION_NVP(which);
+ if(which >= mpl::size<types>::value)
+ // this might happen if a type was removed from the list of variant types
+ boost::serialization::throw_exception(
+ boost::archive::archive_exception(
+ boost::archive::archive_exception::unsupported_version
+ )
+ );
+ variant_impl<types>::load(ar, which, v, version);
+}
+
+template<class Archive,BOOST_VARIANT_ENUM_PARAMS(/* typename */ class T)>
+inline void serialize(
+ Archive & ar,
+ boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> & v,
+ const unsigned int file_version
+){
+ split_free(ar,v,file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+//template<typename T0_, BOOST_VARIANT_ENUM_SHIFTED_PARAMS(typename T)>
+
+#include <boost/serialization/tracking.hpp>
+
+namespace boost {
+ namespace serialization {
+
+template<BOOST_VARIANT_ENUM_PARAMS(/* typename */ class T)>
+struct tracking_level<
+ variant<BOOST_VARIANT_ENUM_PARAMS(T)>
+>{
+ typedef mpl::integral_c_tag tag;
+ typedef mpl::int_< ::boost::serialization::track_always> type;
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+};
+
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_VARIANT_HPP
diff --git a/include/boost/serialization/vector.hpp b/include/boost/serialization/vector.hpp
new file mode 100644
index 0000000..9a114c0
--- /dev/null
+++ b/include/boost/serialization/vector.hpp
@@ -0,0 +1,233 @@
+#ifndef BOOST_SERIALIZATION_VECTOR_HPP
+#define BOOST_SERIALIZATION_VECTOR_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// vector.hpp: serialization for stl vector templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// fast array serialization (C) Copyright 2005 Matthias Troyer
+// 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 <vector>
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/collections_load_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/array_wrapper.hpp>
+#include <boost/mpl/bool_fwd.hpp>
+#include <boost/mpl/if.hpp>
+
+// default is being compatible with version 1.34.1 files, not 1.35 files
+#ifndef BOOST_SERIALIZATION_VECTOR_VERSIONED
+#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V==4 || V==5)
+#endif
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
+namespace boost {
+namespace serialization {
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// vector< T >
+
+// the default versions
+
+template<class Archive, class U, class Allocator>
+inline void save(
+ Archive & ar,
+ const std::vector<U, Allocator> &t,
+ const unsigned int /* file_version */,
+ mpl::false_
+){
+ boost::serialization::stl::save_collection<Archive, STD::vector<U, Allocator> >(
+ ar, t
+ );
+}
+
+template<class Archive, class U, class Allocator>
+inline void load(
+ Archive & ar,
+ std::vector<U, Allocator> &t,
+ const unsigned int /* file_version */,
+ mpl::false_
+){
+ const boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ item_version_type item_version(0);
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ t.reserve(count);
+ stl::collection_load_impl(ar, t, count, item_version);
+}
+
+// the optimized versions
+
+template<class Archive, class U, class Allocator>
+inline void save(
+ Archive & ar,
+ const std::vector<U, Allocator> &t,
+ const unsigned int /* file_version */,
+ mpl::true_
+){
+ const collection_size_type count(t.size());
+ ar << BOOST_SERIALIZATION_NVP(count);
+ if (!t.empty())
+ // explict template arguments to pass intel C++ compiler
+ ar << serialization::make_array<const U, collection_size_type>(
+ static_cast<const U *>(&t[0]),
+ count
+ );
+}
+
+template<class Archive, class U, class Allocator>
+inline void load(
+ Archive & ar,
+ std::vector<U, Allocator> &t,
+ const unsigned int /* file_version */,
+ mpl::true_
+){
+ collection_size_type count(t.size());
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ t.resize(count);
+ unsigned int item_version=0;
+ if(BOOST_SERIALIZATION_VECTOR_VERSIONED(ar.get_library_version())) {
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ if (!t.empty())
+ // explict template arguments to pass intel C++ compiler
+ ar >> serialization::make_array<U, collection_size_type>(
+ static_cast<U *>(&t[0]),
+ count
+ );
+ }
+
+// dispatch to either default or optimized versions
+
+template<class Archive, class U, class Allocator>
+inline void save(
+ Archive & ar,
+ const std::vector<U, Allocator> &t,
+ const unsigned int file_version
+){
+ typedef typename
+ boost::serialization::use_array_optimization<Archive>::template apply<
+ typename remove_const<U>::type
+ >::type use_optimized;
+ save(ar,t,file_version, use_optimized());
+}
+
+template<class Archive, class U, class Allocator>
+inline void load(
+ Archive & ar,
+ std::vector<U, Allocator> &t,
+ const unsigned int file_version
+){
+#ifdef BOOST_SERIALIZATION_VECTOR_135_HPP
+ if (ar.get_library_version()==boost::archive::library_version_type(5))
+ {
+ load(ar,t,file_version, boost::is_arithmetic<U>());
+ return;
+ }
+#endif
+ typedef typename
+ boost::serialization::use_array_optimization<Archive>::template apply<
+ typename remove_const<U>::type
+ >::type use_optimized;
+ load(ar,t,file_version, use_optimized());
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class U, class Allocator>
+inline void serialize(
+ Archive & ar,
+ std::vector<U, Allocator> & t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// vector<bool>
+template<class Archive, class Allocator>
+inline void save(
+ Archive & ar,
+ const std::vector<bool, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ // record number of elements
+ collection_size_type count (t.size());
+ ar << BOOST_SERIALIZATION_NVP(count);
+ std::vector<bool>::const_iterator it = t.begin();
+ while(count-- > 0){
+ bool tb = *it++;
+ ar << boost::serialization::make_nvp("item", tb);
+ }
+}
+
+template<class Archive, class Allocator>
+inline void load(
+ Archive & ar,
+ std::vector<bool, Allocator> &t,
+ const unsigned int /* file_version */
+){
+ // retrieve number of elements
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ t.resize(count);
+ for(collection_size_type i = collection_size_type(0); i < count; ++i){
+ bool b;
+ ar >> boost::serialization::make_nvp("item", b);
+ t[i] = b;
+ }
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class Allocator>
+inline void serialize(
+ Archive & ar,
+ std::vector<bool, Allocator> & t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(std::vector)
+#undef STD
+
+#endif // BOOST_SERIALIZATION_VECTOR_HPP
diff --git a/include/boost/serialization/vector_135.hpp b/include/boost/serialization/vector_135.hpp
new file mode 100644
index 0000000..fd1a739
--- /dev/null
+++ b/include/boost/serialization/vector_135.hpp
@@ -0,0 +1,26 @@
+////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// vector_135.hpp: serialization for stl vector templates for compatibility
+// with release 1.35, which had a bug
+
+// (C) Copyright 2008 Matthias Troyer
+// 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.
+
+
+#ifndef BOOST_SERIALIZATION_VECTOR_135_HPP
+#define BOOST_SERIALIZATION_VECTOR_135_HPP
+
+#ifdef BOOST_SERIALIZATION_VECTOR_VERSIONED
+#if BOOST_SERIALIZATION_VECTOR_VERSION != 4
+#error "Boost.Serialization cannot be compatible with both 1.35 and 1.36-1.40 files"
+#endif
+#else
+#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V>4)
+#endif
+
+#include <boost/serialization/vector.hpp>
+
+#endif // BOOST_SERIALIZATION_VECTOR_135_HPP
diff --git a/include/boost/serialization/version.hpp b/include/boost/serialization/version.hpp
new file mode 100644
index 0000000..21a74d7
--- /dev/null
+++ b/include/boost/serialization/version.hpp
@@ -0,0 +1,107 @@
+#ifndef BOOST_SERIALIZATION_VERSION_HPP
+#define BOOST_SERIALIZATION_VERSION_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// version.hpp:
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/integral_c_tag.hpp>
+
+#include <boost/type_traits/is_base_and_derived.hpp>
+
+namespace boost {
+namespace serialization {
+
+struct basic_traits;
+
+// default version number is 0. Override with higher version
+// when class definition changes.
+template<class T>
+struct version
+{
+ template<class U>
+ struct traits_class_version {
+ typedef typename U::version type;
+ };
+
+ typedef mpl::integral_c_tag tag;
+ // note: at least one compiler complained w/o the full qualification
+ // on basic traits below
+ typedef
+ typename mpl::eval_if<
+ is_base_and_derived<boost::serialization::basic_traits,T>,
+ traits_class_version< T >,
+ mpl::int_<0>
+ >::type type;
+ BOOST_STATIC_CONSTANT(int, value = version::type::value);
+};
+
+#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+template<class T>
+const int version<T>::value;
+#endif
+
+} // namespace serialization
+} // namespace boost
+
+/* note: at first it seemed that this would be a good place to trap
+ * as an error an attempt to set a version # for a class which doesn't
+ * save its class information (including version #) in the archive.
+ * However, this imposes a requirement that the version be set after
+ * the implemention level which would be pretty confusing. If this
+ * is to be done, do this check in the input or output operators when
+ * ALL the serialization traits are available. Included the implementation
+ * here with this comment as a reminder not to do this!
+ */
+//#include <boost/serialization/level.hpp>
+//#include <boost/mpl/equal_to.hpp>
+
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/comparison.hpp>
+
+// specify the current version number for the class
+// version numbers limited to 8 bits !!!
+#define BOOST_CLASS_VERSION(T, N) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct version<T > \
+{ \
+ typedef mpl::int_<N> type; \
+ typedef mpl::integral_c_tag tag; \
+ BOOST_STATIC_CONSTANT(int, value = version::type::value); \
+ BOOST_MPL_ASSERT(( \
+ boost::mpl::less< \
+ boost::mpl::int_<N>, \
+ boost::mpl::int_<256> \
+ > \
+ )); \
+ /* \
+ BOOST_MPL_ASSERT(( \
+ mpl::equal_to< \
+ :implementation_level<T >, \
+ mpl::int_<object_class_info> \
+ >::value \
+ )); \
+ */ \
+}; \
+} \
+}
+
+#endif // BOOST_SERIALIZATION_VERSION_HPP
diff --git a/include/boost/serialization/void_cast.hpp b/include/boost/serialization/void_cast.hpp
new file mode 100644
index 0000000..97c5fe6
--- /dev/null
+++ b/include/boost/serialization/void_cast.hpp
@@ -0,0 +1,299 @@
+#ifndef BOOST_SERIALIZATION_VOID_CAST_HPP
+#define BOOST_SERIALIZATION_VOID_CAST_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// void_cast.hpp: interface for run-time casting of void pointers.
+
+// (C) Copyright 2002-2009 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// gennadiy.rozental@tfn.com
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <cstddef> // for ptrdiff_t
+#include <boost/config.hpp>
+#include <boost/noncopyable.hpp>
+
+#include <boost/serialization/smart_cast.hpp>
+#include <boost/serialization/singleton.hpp>
+#include <boost/serialization/force_include.hpp>
+#include <boost/serialization/type_info_implementation.hpp>
+#include <boost/serialization/extended_type_info.hpp>
+#include <boost/type_traits/is_virtual_base_of.hpp>
+#include <boost/serialization/void_cast_fwd.hpp>
+
+#include <boost/serialization/config.hpp>
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4251 4231 4660 4275)
+#endif
+
+namespace boost {
+namespace serialization {
+
+class extended_type_info;
+
+// Given a void *, assume that it really points to an instance of one type
+// and alter it so that it would point to an instance of a related type.
+// Return the altered pointer. If there exists no sequence of casts that
+// can transform from_type to to_type, return a NULL.
+
+BOOST_SERIALIZATION_DECL void const *
+void_upcast(
+ extended_type_info const & derived,
+ extended_type_info const & base,
+ void const * const t
+);
+
+inline void *
+void_upcast(
+ extended_type_info const & derived,
+ extended_type_info const & base,
+ void * const t
+){
+ return const_cast<void*>(void_upcast(
+ derived,
+ base,
+ const_cast<void const *>(t)
+ ));
+}
+
+BOOST_SERIALIZATION_DECL void const *
+void_downcast(
+ extended_type_info const & derived,
+ extended_type_info const & base,
+ void const * const t
+);
+
+inline void *
+void_downcast(
+ extended_type_info const & derived,
+ extended_type_info const & base,
+ void * const t
+){
+ return const_cast<void*>(void_downcast(
+ derived,
+ base,
+ const_cast<void const *>(t)
+ ));
+}
+
+namespace void_cast_detail {
+
+class BOOST_SYMBOL_VISIBLE void_caster :
+ private boost::noncopyable
+{
+ friend
+ BOOST_SERIALIZATION_DECL void const *
+ boost::serialization::void_upcast(
+ extended_type_info const & derived,
+ extended_type_info const & base,
+ void const * const
+ );
+ friend
+ BOOST_SERIALIZATION_DECL void const *
+ boost::serialization::void_downcast(
+ extended_type_info const & derived,
+ extended_type_info const & base,
+ void const * const
+ );
+protected:
+ BOOST_SERIALIZATION_DECL void recursive_register(bool includes_virtual_base = false) const;
+ BOOST_SERIALIZATION_DECL void recursive_unregister() const;
+ virtual bool has_virtual_base() const = 0;
+public:
+ // Data members
+ const extended_type_info * m_derived;
+ const extended_type_info * m_base;
+ /*const*/ std::ptrdiff_t m_difference;
+ void_caster const * const m_parent;
+
+ // note that void_casters are keyed on value of
+ // member extended type info records - NOT their
+ // addresses. This is necessary in order for the
+ // void cast operations to work across dll and exe
+ // module boundries.
+ bool operator<(const void_caster & rhs) const;
+
+ const void_caster & operator*(){
+ return *this;
+ }
+ // each derived class must re-implement these;
+ virtual void const * upcast(void const * const t) const = 0;
+ virtual void const * downcast(void const * const t) const = 0;
+ // Constructor
+ void_caster(
+ extended_type_info const * derived,
+ extended_type_info const * base,
+ std::ptrdiff_t difference = 0,
+ void_caster const * const parent = 0
+ ) :
+ m_derived(derived),
+ m_base(base),
+ m_difference(difference),
+ m_parent(parent)
+ {}
+ virtual ~void_caster(){}
+};
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4251 4231 4660 4275 4511 4512)
+#endif
+
+template <class Derived, class Base>
+class BOOST_SYMBOL_VISIBLE void_caster_primitive :
+ public void_caster
+{
+ virtual void const * downcast(void const * const t) const {
+ const Derived * d =
+ boost::serialization::smart_cast<const Derived *, const Base *>(
+ static_cast<const Base *>(t)
+ );
+ return d;
+ }
+ virtual void const * upcast(void const * const t) const {
+ const Base * b =
+ boost::serialization::smart_cast<const Base *, const Derived *>(
+ static_cast<const Derived *>(t)
+ );
+ return b;
+ }
+ virtual bool has_virtual_base() const {
+ return false;
+ }
+public:
+ void_caster_primitive();
+ virtual ~void_caster_primitive();
+};
+
+template <class Derived, class Base>
+void_caster_primitive<Derived, Base>::void_caster_primitive() :
+ void_caster(
+ & type_info_implementation<Derived>::type::get_const_instance(),
+ & type_info_implementation<Base>::type::get_const_instance(),
+ /* note about displacement:
+ * displace 0: at least one compiler treated 0 by not shifting it at all
+ * displace by small value (8): caused ICE on certain mingw gcc versions */
+ reinterpret_cast<std::ptrdiff_t>(
+ static_cast<Derived *>(
+ reinterpret_cast<Base *>(1 << 20)
+ )
+ ) - (1 << 20)
+ )
+{
+ recursive_register();
+}
+
+template <class Derived, class Base>
+void_caster_primitive<Derived, Base>::~void_caster_primitive(){
+ recursive_unregister();
+}
+
+template <class Derived, class Base>
+class BOOST_SYMBOL_VISIBLE void_caster_virtual_base :
+ public void_caster
+{
+ virtual bool has_virtual_base() const {
+ return true;
+ }
+public:
+ virtual void const * downcast(void const * const t) const {
+ const Derived * d =
+ dynamic_cast<const Derived *>(
+ static_cast<const Base *>(t)
+ );
+ return d;
+ }
+ virtual void const * upcast(void const * const t) const {
+ const Base * b =
+ dynamic_cast<const Base *>(
+ static_cast<const Derived *>(t)
+ );
+ return b;
+ }
+ void_caster_virtual_base();
+ virtual ~void_caster_virtual_base();
+};
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+template <class Derived, class Base>
+void_caster_virtual_base<Derived,Base>::void_caster_virtual_base() :
+ void_caster(
+ & (type_info_implementation<Derived>::type::get_const_instance()),
+ & (type_info_implementation<Base>::type::get_const_instance())
+ )
+{
+ recursive_register(true);
+}
+
+template <class Derived, class Base>
+void_caster_virtual_base<Derived,Base>::~void_caster_virtual_base(){
+ recursive_unregister();
+}
+
+template <class Derived, class Base>
+struct BOOST_SYMBOL_VISIBLE void_caster_base :
+ public void_caster
+{
+ typedef
+ typename mpl::eval_if<boost::is_virtual_base_of<Base,Derived>,
+ mpl::identity<
+ void_cast_detail::void_caster_virtual_base<Derived, Base>
+ >
+ ,// else
+ mpl::identity<
+ void_cast_detail::void_caster_primitive<Derived, Base>
+ >
+ >::type type;
+};
+
+} // void_cast_detail
+
+template<class Derived, class Base>
+BOOST_DLLEXPORT
+inline const void_cast_detail::void_caster & void_cast_register(
+ Derived const * /* dnull = NULL */,
+ Base const * /* bnull = NULL */
+){
+ typedef
+ typename mpl::eval_if<boost::is_virtual_base_of<Base,Derived>,
+ mpl::identity<
+ void_cast_detail::void_caster_virtual_base<Derived, Base>
+ >
+ ,// else
+ mpl::identity<
+ void_cast_detail::void_caster_primitive<Derived, Base>
+ >
+ >::type typex;
+ return singleton<typex>::get_const_instance();
+}
+
+template<class Derived, class Base>
+class BOOST_SYMBOL_VISIBLE void_caster :
+ public void_cast_detail::void_caster_base<Derived, Base>::type
+{
+};
+
+} // namespace serialization
+} // namespace boost
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
+#endif // BOOST_SERIALIZATION_VOID_CAST_HPP
diff --git a/include/boost/serialization/void_cast_fwd.hpp b/include/boost/serialization/void_cast_fwd.hpp
new file mode 100644
index 0000000..def61d5
--- /dev/null
+++ b/include/boost/serialization/void_cast_fwd.hpp
@@ -0,0 +1,37 @@
+#ifndef BOOST_SERIALIZATION_VOID_CAST_FWD_HPP
+#define BOOST_SERIALIZATION_VOID_CAST_FWD_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// void_cast_fwd.hpp: interface for run-time casting of void pointers.
+
+// (C) Copyright 2005 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// gennadiy.rozental@tfn.com
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <cstddef> // NULL
+#include <boost/serialization/force_include.hpp>
+
+namespace boost {
+namespace serialization {
+namespace void_cast_detail{
+class void_caster;
+} // namespace void_cast_detail
+template<class Derived, class Base>
+BOOST_DLLEXPORT
+inline const void_cast_detail::void_caster & void_cast_register(
+ const Derived * dnull = NULL,
+ const Base * bnull = NULL
+) BOOST_USED;
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_VOID_CAST_HPP
diff --git a/include/boost/serialization/weak_ptr.hpp b/include/boost/serialization/weak_ptr.hpp
new file mode 100644
index 0000000..6952d24
--- /dev/null
+++ b/include/boost/serialization/weak_ptr.hpp
@@ -0,0 +1,99 @@
+#ifndef BOOST_SERIALIZATION_WEAK_PTR_HPP
+#define BOOST_SERIALIZATION_WEAK_PTR_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// weak_ptr.hpp: serialization for boost weak pointer
+
+// (C) Copyright 2004 Robert Ramey and Martin Ecker
+// 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 <boost/weak_ptr.hpp>
+#include <boost/serialization/shared_ptr.hpp>
+
+namespace boost {
+namespace serialization{
+
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const boost::weak_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ const boost::shared_ptr< T > sp = t.lock();
+ ar << boost::serialization::make_nvp("weak_ptr", sp);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ boost::weak_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ boost::shared_ptr< T > sp;
+ ar >> boost::serialization::make_nvp("weak_ptr", sp);
+ t = sp;
+}
+
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ boost::weak_ptr< T > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#ifndef BOOST_NO_CXX11_SMART_PTR
+#include <memory>
+
+namespace boost {
+namespace serialization{
+
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const std::weak_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ const std::shared_ptr< T > sp = t.lock();
+ ar << boost::serialization::make_nvp("weak_ptr", sp);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ std::weak_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ std::shared_ptr< T > sp;
+ ar >> boost::serialization::make_nvp("weak_ptr", sp);
+ t = sp;
+}
+
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ std::weak_ptr< T > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_NO_CXX11_SMART_PTR
+
+#endif // BOOST_SERIALIZATION_WEAK_PTR_HPP
diff --git a/include/boost/serialization/wrapper.hpp b/include/boost/serialization/wrapper.hpp
new file mode 100644
index 0000000..60d7910
--- /dev/null
+++ b/include/boost/serialization/wrapper.hpp
@@ -0,0 +1,60 @@
+#ifndef BOOST_SERIALIZATION_WRAPPER_HPP
+#define BOOST_SERIALIZATION_WRAPPER_HPP
+
+// (C) Copyright 2005-2006 Matthias Troyer
+// 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)
+
+#include <boost/serialization/traits.hpp>
+#include <boost/type_traits/is_base_and_derived.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/bool_fwd.hpp>
+
+namespace boost { namespace serialization {
+
+/// the base class for serialization wrappers
+///
+/// wrappers need to be treated differently at various places in the serialization library,
+/// e.g. saving of non-const wrappers has to be possible. Since partial specialization
+// is not supported by all compilers, we derive all wrappers from wrapper_traits.
+
+template<
+ class T,
+ int Level = object_serializable,
+ int Tracking = track_never,
+ unsigned int Version = 0,
+ class ETII = extended_type_info_impl< T >
+>
+struct wrapper_traits :
+ public traits<T,Level,Tracking,Version,ETII,mpl::true_>
+{};
+
+template<class T>
+struct is_wrapper_impl :
+ boost::mpl::eval_if<
+ boost::is_base_and_derived<basic_traits,T>,
+ boost::mpl::true_,
+ boost::mpl::false_
+ >::type
+{};
+
+template<class T>
+struct is_wrapper {
+ typedef typename is_wrapper_impl<const T>::type type;
+};
+
+} // serialization
+} // boost
+
+// A macro to define that a class is a wrapper
+#define BOOST_CLASS_IS_WRAPPER(T) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct is_wrapper_impl<const T> : boost::mpl::true_ {}; \
+} \
+} \
+/**/
+
+#endif //BOOST_SERIALIZATION_WRAPPER_HPP