mirror of
https://github.com/boostorg/serialization.git
synced 2026-07-21 13:33:32 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cb85ddfc4 | |||
| 33b57cdc46 | |||
| 5126a19fd2 | |||
| 1db23af3e0 | |||
| c42e330316 | |||
| 01622ea78d | |||
| fdc5ea55c0 | |||
| ba03ef8336 | |||
| daf791b120 | |||
| efca9caff7 | |||
| 846b078d10 | |||
| 109ae33093 | |||
| 413db7337c | |||
| a2a801b25e |
@@ -0,0 +1,22 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# This file was automatically generated from the original CMakeLists.txt file
|
||||
# Add a variable to hold the headers for the library
|
||||
set (lib_headers
|
||||
serialization
|
||||
archive
|
||||
)
|
||||
|
||||
# Add a library target to the build system
|
||||
boost_library_project(
|
||||
serialization
|
||||
SRCDIRS src
|
||||
TESTDIRS test
|
||||
HEADERS ${lib_headers}
|
||||
# DOCDIRS
|
||||
DESCRIPTION "Serialization for persistence and marshalling."
|
||||
MODULARIZED
|
||||
AUTHORS "<ramey -at- rrsd.com>"
|
||||
# MAINTAINERS
|
||||
)
|
||||
|
||||
|
||||
+6
-3
@@ -8,7 +8,7 @@
|
||||
|
||||
project boost/serialization
|
||||
: source-location ../src
|
||||
: requirements <dependency>../../config/test/all//BOOST_NO_STD_LOCALE
|
||||
: requirements
|
||||
<conditional>@include-spirit
|
||||
;
|
||||
|
||||
@@ -18,7 +18,11 @@ rule include-spirit ( properties * )
|
||||
local old-compiler ;
|
||||
if <toolset>borland in $(properties)
|
||||
{
|
||||
old-compiler = true ;
|
||||
if ! <toolset-borland:version>6.1.0 in $(properties)
|
||||
{
|
||||
old-compiler = true ;
|
||||
}
|
||||
|
||||
}
|
||||
else if <toolset>msvc in $(properties)
|
||||
{
|
||||
@@ -100,7 +104,6 @@ lib boost_wserialization
|
||||
: $(WSOURCES).cpp boost_serialization
|
||||
:
|
||||
<toolset>msvc:<cxxflags>/Gy
|
||||
<dependency>../../config/test/all//BOOST_NO_STD_WSTREAMBUF
|
||||
<link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
|
||||
;
|
||||
|
||||
|
||||
+3
-1
@@ -87,10 +87,12 @@ function initialize() {
|
||||
<dt><img style="display:none" src="plus.gif" id="release_notes"><a target="detail" href="release.html">Release Notes</a></dt>
|
||||
<dd><div id="release_notes_detail"><dl class="page-index">
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="release.html#requirements">Requirements</a></dt>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="release.html#difference_1_36">Differences from version 1.36</a></dt>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="release.html#difference_1_35">Differences from version 1.35</a></dt>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="release.html#difference_1_34">Differences from version 1.34</a></dt>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="release.html#difference_1_32">Differences from version 1.32</a></dt>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="release.html#difference_1_33">Differences from version 1.33</a></dt>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="release.html#difference_1_32">Differences from version 1.32</a></dt>
|
||||
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="release.html#todo">Pending Issues</a></dt>
|
||||
</dl></div></dd>
|
||||
<dt><img style="display:none" src="plus.gif" id="overview"><a target="detail" href="overview.html">Overview</a></dt>
|
||||
|
||||
+7
-6
@@ -161,13 +161,14 @@ boost/serialization/export.hpp
|
||||
</a>
|
||||
<dd>For serialization of pointers to derived classes via key export.</dd>
|
||||
|
||||
<dt><a target="is_abstract" href="../../../boost/serialization/is_abstract.hpp">
|
||||
boost/serialization/is_abstract.hpp
|
||||
<dt><a target="assume_abstract" href="../../../boost/serialization/assume_abstract.hpp">
|
||||
boost/serialization/assume_abstract.hpp
|
||||
</a>
|
||||
<dd>For serialization of pointers to abstract base classes. A generic implementation
|
||||
of this is functional only on the most modern compilers. This one is just
|
||||
a thin wrapper which permits one to specify "by hand" whether or not a base class
|
||||
is abstract or not.</dd>
|
||||
<dd>This is just a thin wrapper which permits one to explicitly specify that a
|
||||
particular type is an abstract base class. It is necessary to use this
|
||||
for compilers which don't support the boost type traits implementation of
|
||||
is_abstact.
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<body bgcolor="#ffffff" text="#000000">
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td><img border="0" src="C:/BoostTrunk/boost.png" width="277" height="86"></td>
|
||||
<td><img border="0" src="../../../boost.png" width="277" height="86"></td>
|
||||
<td>
|
||||
<h1>Library Status: serialization</h1>
|
||||
<b>Run Date:</b> 02:42:48 UTC, Tuesday 10 June 2008
|
||||
|
||||
+7
-2
@@ -27,6 +27,7 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
<hr>
|
||||
<dl class="index">
|
||||
<dt><a href="#requirements">Requirements</a></dt>
|
||||
<dt><a href="#differences_1_37">Differences from version 1.37</a></dt>
|
||||
<dt><a href="#differences_1_35">Differences from version 1.35</a></dt>
|
||||
<dt><a href="#differences_1_34">Differences from version 1.34</a></dt>
|
||||
<dt><a href="#differences_1_33">Differences from version 1.33</a></dt>
|
||||
@@ -36,7 +37,7 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
As of this is written, there are no known bugs. However, due to compiler/library quirks and or
|
||||
bugs, some tests fail with some combinations of compilers and libraries.
|
||||
<h2><a name="requirements"></a>Requirements</h2>
|
||||
This library has been tested on Boost version 1.34 and 1.35.
|
||||
This library has been tested on Boost version 1.37.
|
||||
|
||||
<!--
|
||||
<p>
|
||||
@@ -56,6 +57,10 @@ the directory which contains the version of spirit you plan to use is placed
|
||||
at the front of the list of include paths.
|
||||
-->
|
||||
|
||||
<h2><a name="differences_1_36"></a>Differences from Boost 1.36</h2>
|
||||
There are no new features in this version. As of this writing,
|
||||
all bug reports filed as TRAK tickets have been addressed.
|
||||
|
||||
<h2><a name="differences_1_35"></a>Differences from Boost 1.35</h2>
|
||||
<ul>
|
||||
<li>The library is now thread safe. That is, multiple archives can be open
|
||||
@@ -120,6 +125,7 @@ at the front of the list of include paths.
|
||||
|
||||
<h2><a name="todo"></a>Pending issues</h2>
|
||||
<ul>
|
||||
<li>Pointers to pointers cannot currently be serialized
|
||||
<li>currently can't serialize through a pointer an object a of class
|
||||
that implements its own <code style="white-space: normal">new/delete</code> operators.
|
||||
<li>Its possible that <code style="white-space: normal">std::string</code>
|
||||
@@ -130,7 +136,6 @@ at the front of the list of include paths.
|
||||
is fixed in this version. Unfortunately, the fix breaks serialization of
|
||||
<code style="white-space: normal">std::map</code> for those compilers which do not support
|
||||
partial template specialization.
|
||||
<li>Without taking special precautions, racking fails for types placed in a <code style="white-space: normal">std::map</code>.
|
||||
</ul>
|
||||
<p>
|
||||
Aside from the above, there are a number of issues related to specific platforms.
|
||||
|
||||
+2
-2
@@ -416,8 +416,8 @@ For runtime linked libraries this is illustrated by one of the tests:
|
||||
<code style="white-space: normal">test_dll_simple</code>
|
||||
</a>,
|
||||
and
|
||||
<a href = "../test/dll_A.cpp" target="dll_A">
|
||||
<code style="white-space: normal">dll_A.cpp</code>
|
||||
<a href = "../test/dll_a.cpp" target="dll_a">
|
||||
<code style="white-space: normal">dll_a.cpp</code>
|
||||
</a>
|
||||
where implementation of serializaton is also completely separate
|
||||
from the main program but the code is loaded at runtime. In this
|
||||
|
||||
@@ -6,3 +6,10 @@ pre{
|
||||
MARGIN-LEFT: 0pt;
|
||||
background-color: #EEEEEE;
|
||||
}
|
||||
|
||||
/*
|
||||
(C) Copyright 2008 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)
|
||||
*/
|
||||
+2
-2
@@ -30,7 +30,7 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
<dt><a href="#performancetesting">Performance Testing and Profiling</a></dt>
|
||||
<dt><a href="#backversioning">Back Versioning</a></dt>
|
||||
<dt><a href="#nortti">Testing for Environments with No RTTI</a></dt>
|
||||
<dt><a href="new_case_studies.htm">Additional Case Studies</a></dt>
|
||||
<dt><a href="new_case_studies.html">Additional Case Studies</a></dt>
|
||||
</dl>
|
||||
|
||||
These are enhancements that the serialization library needs but have not been done.
|
||||
@@ -62,7 +62,7 @@ I've managed to setup performance profiling using the following:
|
||||
<li>library_status program from the tools/regression/src directory
|
||||
</ul>
|
||||
Invoking profile script produces a
|
||||
<a href=performance_status.html">table</a>
|
||||
<a href="performance_status.html">table</a>
|
||||
which shows the results of each test and links to the actual
|
||||
profile.
|
||||
<p>
|
||||
|
||||
@@ -468,8 +468,6 @@ and template parameters should be assigned according to the following table:
|
||||
<tr><td><code>IsWrapper</code></td><td><code></code>is the type a wrapper?</td><td><code>mpl::false_<br>mpl::true_</code></td><td><code>mpl::false_</code></td></tr>
|
||||
</table>
|
||||
|
||||
<<<<<<< .working
|
||||
|
||||
<h3><a name="tracking">Bitwise serialization</a></h3>
|
||||
Some simple classes could be serialized just by directly copying all bits
|
||||
of the class. This is, in particular, the case for POD data types containing
|
||||
@@ -495,34 +493,6 @@ is made easy by the corresponding macro:
|
||||
BOOST_IS_BITWISE_SERIALIZABLE(my_class)
|
||||
</code></pre>
|
||||
|
||||
=======
|
||||
|
||||
<h3><a name="tracking">Bitwise serialization</a></h3>
|
||||
Some simple classes could be serialized just by directly copying all bits
|
||||
of the class. This is, in particular, the case for POD data types containing
|
||||
no pointer members, and which are neither versioned nor tracked. Some archives,
|
||||
such as non-portable binary archives can make us of this information to
|
||||
substantially speed up Serialization.
|
||||
|
||||
To indicate the possibility of bitwise serialization the type trait defined
|
||||
in the header
|
||||
file <a href="../../../boost/serialization/is_bitwise_serializable.hpp" target="is_bitwise_serializable">is_bitwise_serializable.hpp</a>
|
||||
is used:
|
||||
<pre><code>
|
||||
namespace boost { namespace serialization {
|
||||
template<class T>
|
||||
struct is_bitwise_serializable
|
||||
: public is_arithmetic<T>
|
||||
{};
|
||||
} }
|
||||
</code></pre>
|
||||
is used, and can be specialized for other classes. The specialization
|
||||
is made easy by the corresponding macro:
|
||||
<pre><code>
|
||||
BOOST_IS_BITWISE_SERIALIZABLE(my_class)
|
||||
</code></pre>
|
||||
|
||||
>>>>>>> .merge-right.r41077
|
||||
<hr>
|
||||
<p><i>© Copyright <a href="http://www.rrsd.com">Robert Ramey</a> 2002-2004 and Matthias Troyer 2006.
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <cstddef> // NULL
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
// should pass compilation and execution
|
||||
|
||||
#include <cstddef> // NULL
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
|
||||
@@ -62,7 +62,7 @@ private:
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
|
||||
int i;
|
||||
if(Archive::is_saving::value){
|
||||
if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){
|
||||
i = l;
|
||||
ar & BOOST_SERIALIZATION_NVP(i);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ private:
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
|
||||
int i;
|
||||
if(Archive::is_saving::value){
|
||||
if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){
|
||||
i = l;
|
||||
ar & BOOST_SERIALIZATION_NVP(i);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <cstddef> // NULL
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#define BOOST_ARCHIVE_SOURCE
|
||||
#include <boost/archive/binary_oarchive_impl.hpp>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <cstddef> // NULL
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#ifndef PORTABLE_BINARY_ARCHIVE_HPP
|
||||
#define PORTABLE_BINARY_ARCHIVE_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)
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
@@ -8,7 +13,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#include <climits>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//#include <cstring> // memcpy
|
||||
|
||||
#include <boost/detail/endian.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
#include "portable_binary_iarchive.hpp"
|
||||
@@ -33,7 +33,7 @@ portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){
|
||||
size = -size;
|
||||
|
||||
if(size > maxsize)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
portable_binary_iarchive_exception()
|
||||
);
|
||||
|
||||
@@ -62,7 +62,7 @@ portable_binary_iarchive::load_override(
|
||||
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
|
||||
load_override(cn, 0);
|
||||
if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
boost::archive::archive_exception(
|
||||
boost::archive::archive_exception::invalid_class_name)
|
||||
);
|
||||
@@ -77,8 +77,8 @@ portable_binary_iarchive::init(unsigned int flags){
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
* this >> file_signature;
|
||||
if(file_signature != boost::archive::ARCHIVE_SIGNATURE())
|
||||
boost::throw_exception(
|
||||
if(file_signature != boost::archive::BOOST_ARCHIVE_SIGNATURE())
|
||||
boost::serialization::throw_exception(
|
||||
boost::archive::archive_exception(
|
||||
boost::archive::archive_exception::invalid_signature
|
||||
)
|
||||
@@ -89,8 +89,8 @@ portable_binary_iarchive::init(unsigned int flags){
|
||||
* this >> input_library_version;
|
||||
|
||||
// extra little .t is to get around borland quirk
|
||||
if(boost::archive::ARCHIVE_VERSION() < input_library_version.t)
|
||||
boost::throw_exception(
|
||||
if(boost::archive::BOOST_ARCHIVE_VERSION() < input_library_version.t)
|
||||
boost::serialization::throw_exception(
|
||||
boost::archive::archive_exception(
|
||||
boost::archive::archive_exception::unsupported_version
|
||||
)
|
||||
|
||||
@@ -59,19 +59,19 @@ portable_binary_oarchive::save_impl(
|
||||
void
|
||||
portable_binary_oarchive::init(unsigned int flags) {
|
||||
if(m_flags == (endian_big | endian_little)){
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
portable_binary_oarchive_exception()
|
||||
);
|
||||
}
|
||||
if(0 == (flags & boost::archive::no_header)){
|
||||
// write signature in an archive version independent manner
|
||||
const std::string file_signature(
|
||||
boost::archive::ARCHIVE_SIGNATURE()
|
||||
boost::archive::BOOST_ARCHIVE_SIGNATURE()
|
||||
);
|
||||
* this << file_signature;
|
||||
// write library version
|
||||
const boost::archive::version_type v(
|
||||
boost::archive::ARCHIVE_VERSION()
|
||||
boost::archive::BOOST_ARCHIVE_VERSION()
|
||||
);
|
||||
* this << v;
|
||||
}
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
#ifndef BOOST_ARCHIVE_ARRAY_IARCHIVE_HPP
|
||||
#define BOOST_ARCHIVE_ARRAY_IARCHIVE_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/archive/basic_archive.hpp>
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <boost/serialization/detail/get_data.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
//#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
namespace boost { namespace archive { namespace array {
|
||||
|
||||
// To conveniently array-optimize an input archive X:
|
||||
//
|
||||
// * Derive it from iarchive<X, Impl>, where Impl is an
|
||||
// archive implementation base class from
|
||||
// Boost.Serialization
|
||||
//
|
||||
// * add a member function template that implements the
|
||||
// procedure for serializing arrays of T (for appropriate T)
|
||||
//
|
||||
// template <class T>
|
||||
// load_array(serialization::array<T> &, unsigned int)
|
||||
//
|
||||
// * add a unary MPL lambda expression member called
|
||||
// use_array_optimization whose result is convertible to
|
||||
// mpl::true_ iff array elements of type T can be serialized
|
||||
// with the load_array member function, and to mpl::false_ if
|
||||
// the unoptimized procedure must be used.
|
||||
|
||||
template <class Archive>
|
||||
class iarchive
|
||||
: public archive::detail::common_iarchive<Archive>
|
||||
{
|
||||
typedef archive::detail::common_iarchive<Archive> Base;
|
||||
public:
|
||||
iarchive(unsigned int flags)
|
||||
: archive::detail::common_iarchive<Archive>(flags)
|
||||
{}
|
||||
|
||||
|
||||
// load_override for std::vector and serialization::array dispatches to
|
||||
// load_optimized with an additional argument.
|
||||
//
|
||||
// If that argument is of type mpl::true_, an optimized serialization is provided
|
||||
// If it is false, we just forward to the default serialization in the base class
|
||||
|
||||
//the default version dispatches to the base class
|
||||
template<class T>
|
||||
void load_optimized(T &t, unsigned int version, mpl::false_)
|
||||
{
|
||||
Base::load_override(t, version);
|
||||
}
|
||||
|
||||
// the optimized implementation for vector uses serialization::array
|
||||
template<class ValueType, class Allocator>
|
||||
void load_optimized(
|
||||
std::vector<ValueType, Allocator> &t, unsigned int /*version*/, mpl::true_)
|
||||
{
|
||||
t.clear();
|
||||
// retrieve number of elements
|
||||
serialization::collection_size_type count;
|
||||
*this->This() >> BOOST_SERIALIZATION_NVP(count);
|
||||
t.resize(count);
|
||||
if (!t.empty())
|
||||
* this->This() >> serialization::make_array(serialization::detail::get_data(t),t.size());
|
||||
}
|
||||
|
||||
// the optimized implementation for serialization::array uses save_array
|
||||
template<class ValueType>
|
||||
void load_optimized(
|
||||
serialization::array<ValueType> &t, unsigned int version, mpl::true_)
|
||||
{
|
||||
this->This()->load_array(t,version);
|
||||
}
|
||||
|
||||
// to load a vector:
|
||||
// if the value type is trivially constructable or an optimized array save exists,
|
||||
// then we can use the optimized version
|
||||
|
||||
template<class ValueType, class Allocator>
|
||||
void load_override(std::vector<ValueType,Allocator> &x, unsigned int version)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME mpl::and_<
|
||||
mpl::not_<is_same<ValueType,bool> >,
|
||||
mpl::apply1<
|
||||
BOOST_DEDUCED_TYPENAME Archive::use_array_optimization
|
||||
, ValueType>
|
||||
>::type use_optimized;
|
||||
load_optimized(x,version, use_optimized() );
|
||||
}
|
||||
|
||||
// dispatch loading of arrays to the optimized version where supported
|
||||
template<class ValueType>
|
||||
void load_override(serialization::array<ValueType> const& x, unsigned int version)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME mpl::apply1<
|
||||
BOOST_DEDUCED_TYPENAME Archive::use_array_optimization
|
||||
, ValueType
|
||||
>::type use_optimized;
|
||||
load_optimized(const_cast<serialization::array<ValueType>&>(x),version,use_optimized());
|
||||
}
|
||||
|
||||
// Load everything else in the usual way, forwarding on to the base class
|
||||
template<class T>
|
||||
void load_override(T & x, unsigned BOOST_PFTO int version)
|
||||
{
|
||||
Base::load_override(x, static_cast<unsigned int>(version));
|
||||
}
|
||||
};
|
||||
|
||||
} } } // end namespace boost::archive::array
|
||||
|
||||
#endif // BOOST_ARCHIVE_ARRAY_OARCHIVE_HPP
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
#ifndef BOOST_ARCHIVE_ARRAY_OARCHIVE_HPP
|
||||
#define BOOST_ARCHIVE_ARRAY_OARCHIVE_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/archive/basic_archive.hpp>
|
||||
#include <boost/archive/detail/common_oarchive.hpp>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <boost/serialization/detail/get_data.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
namespace boost { namespace archive { namespace array {
|
||||
|
||||
// To conveniently array-optimize an output archive X:
|
||||
//
|
||||
// * Derive it from oarchive<X, Impl>, where Impl is an
|
||||
// archive implementation base class from
|
||||
// Boost.Serialization
|
||||
//
|
||||
// * add a member function template that implements the
|
||||
// procedure for serializing arrays of T (for appropriate T)
|
||||
//
|
||||
// template <class T>
|
||||
// save_array(serialization::array<T> const &, unsigned int)
|
||||
//
|
||||
// * add a unary MPL lambda expression member called
|
||||
// use_array_optimization whose result is convertible to
|
||||
// mpl::true_ iff array elements of type T can be serialized
|
||||
// with the load_array member function, and to mpl::false_ if
|
||||
// the unoptimized procedure must be used.
|
||||
|
||||
template <class Archive>
|
||||
class oarchive
|
||||
: public archive::detail::common_oarchive<Archive>
|
||||
{
|
||||
typedef archive::detail::common_oarchive<Archive> Base;
|
||||
public:
|
||||
|
||||
oarchive(unsigned int flags)
|
||||
: archive::detail::common_oarchive<Archive>(flags)
|
||||
{}
|
||||
|
||||
// save_override for std::vector and serialization::array dispatches to
|
||||
// save_optimized with an additional argument.
|
||||
//
|
||||
// If that argument is of type mpl::true_, an optimized serialization is provided
|
||||
// If it is false, we just forward to the default serialization in the base class
|
||||
|
||||
//the default version dispatches to the base class
|
||||
template<class T>
|
||||
void save_optimized(T const &t, unsigned int version, mpl::false_)
|
||||
{
|
||||
Base::save_override(t, version);
|
||||
}
|
||||
|
||||
// the optimized implementation for vector uses serialization::array
|
||||
template<class ValueType, class Allocator>
|
||||
void save_optimized(
|
||||
const std::vector<ValueType, Allocator> &t, unsigned int, mpl::true_)
|
||||
{
|
||||
const serialization::collection_size_type count(t.size());
|
||||
* this->This() << BOOST_SERIALIZATION_NVP(count);
|
||||
if (!t.empty())
|
||||
* this->This() << serialization::make_array(serialization::detail::get_data(t),t.size());
|
||||
}
|
||||
|
||||
// the optimized implementation for serialization::array uses save_array
|
||||
template<class ValueType>
|
||||
void save_optimized(
|
||||
const serialization::array<ValueType> &t, unsigned int version, mpl::true_)
|
||||
{
|
||||
this->This()->save_array(t,version);
|
||||
}
|
||||
|
||||
// to save a vector:
|
||||
// if the value type is trivially constructable or an optimized array save exists,
|
||||
// then we can use the optimized version
|
||||
|
||||
template<class ValueType, class Allocator>
|
||||
void save_override(std::vector<ValueType,Allocator> const &x, unsigned int version)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_const<ValueType>::type value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME mpl::and_<
|
||||
mpl::not_<is_same<value_type,bool> >,
|
||||
mpl::apply1<
|
||||
BOOST_DEDUCED_TYPENAME Archive::use_array_optimization
|
||||
, value_type>
|
||||
>::type use_optimized;
|
||||
save_optimized(x,version,use_optimized() );
|
||||
}
|
||||
|
||||
// dispatch saving of arrays to the optimized version where supported
|
||||
template<class ValueType>
|
||||
void save_override(serialization::array<ValueType> const& x, unsigned int version)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME mpl::apply1<
|
||||
BOOST_DEDUCED_TYPENAME Archive::use_array_optimization
|
||||
, BOOST_DEDUCED_TYPENAME remove_const<ValueType>::type
|
||||
>::type use_optimized;
|
||||
save_optimized(x,version,use_optimized());
|
||||
}
|
||||
|
||||
// Load everything else in the usual way, forwarding on to the
|
||||
// Base class
|
||||
template<class T>
|
||||
void save_override(T const& x, unsigned BOOST_PFTO int version)
|
||||
{
|
||||
Base::save_override(x, static_cast<unsigned int>(version));
|
||||
}
|
||||
};
|
||||
|
||||
} } } // end namespace boost::archive::array
|
||||
|
||||
#endif // BOOST_ARCHIVE_ARRAY_OARCHIVE_HPP
|
||||
@@ -17,7 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/strong_typedef.hpp>
|
||||
#include <boost/serialization/strong_typedef.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
@@ -93,10 +93,10 @@ enum archive_flags {
|
||||
#define NULL_POINTER_TAG class_id_type(-1)
|
||||
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
ARCHIVE_SIGNATURE();
|
||||
BOOST_ARCHIVE_SIGNATURE();
|
||||
|
||||
BOOST_ARCHIVE_DECL(unsigned char)
|
||||
ARCHIVE_VERSION();
|
||||
BOOST_ARCHIVE_VERSION();
|
||||
|
||||
}// namespace archive
|
||||
}// namespace boost
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//#include <cstring>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
#include <boost/archive/array/iarchive.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
namespace boost {
|
||||
@@ -40,7 +40,7 @@ namespace archive {
|
||||
// class basic_binary_iarchive - read serialized objects from a input binary stream
|
||||
template<class Archive>
|
||||
class basic_binary_iarchive :
|
||||
public array::iarchive<Archive>
|
||||
public detail::common_iarchive<Archive>
|
||||
{
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
@@ -56,10 +56,10 @@ public:
|
||||
// fot templates in the absence of partial function
|
||||
// template ordering. If we get here pass to base class
|
||||
// note extra nonsense to sneak it pass the borland compiers
|
||||
typedef array::iarchive<Archive> array_iarchive;
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
this->array_iarchive::load_override(t, 0L);
|
||||
void load_override(T & t, BOOST_PFTO int version){
|
||||
this->detail_common_iarchive::load_override(t, static_cast<int>(version));
|
||||
}
|
||||
// binary files don't include the optional information
|
||||
void load_override(class_id_optional_type & /* t */, int){}
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
init();
|
||||
|
||||
basic_binary_iarchive(unsigned int flags) :
|
||||
array_iarchive(flags)
|
||||
detail::common_iarchive<Archive>(flags)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace std{
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
//#include <boost/limits.hpp>
|
||||
//#include <boost/io/ios_state.hpp>
|
||||
|
||||
@@ -120,11 +120,17 @@ public:
|
||||
~basic_binary_iprimitive();
|
||||
public:
|
||||
// we provide an optimized load for all fundamental types
|
||||
//typedef serialization::is_bitwise_serializable<mpl::_1>
|
||||
// use_array_optimization;
|
||||
struct use_array_optimization {
|
||||
template <class T>
|
||||
struct apply : public serialization::is_bitwise_serializable<T> {};
|
||||
// typedef serialization::is_bitwise_serializable<mpl::_1>
|
||||
// use_array_optimization;
|
||||
struct use_array_optimization {
|
||||
template <class T>
|
||||
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
|
||||
struct apply {
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable<T>::type type;
|
||||
};
|
||||
#else
|
||||
struct apply : public boost::serialization::is_bitwise_serializable<T> {};
|
||||
#endif
|
||||
};
|
||||
|
||||
// the optimized load_array dispatches to load_binary
|
||||
@@ -151,18 +157,20 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load_binary(
|
||||
s
|
||||
);
|
||||
if(scount != static_cast<std::streamsize>(s))
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
// note: an optimizer should eliminate the following for char files
|
||||
s = count % sizeof(Elem);
|
||||
if(0 < s){
|
||||
// if(is.fail())
|
||||
// boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
// boost::serialization::throw_exception(
|
||||
// archive_exception(archive_exception::stream_error)
|
||||
// );
|
||||
Elem t;
|
||||
scount = m_sb.sgetn(& t, 1);
|
||||
if(scount != 1)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
std::memcpy(static_cast<char*>(address) + (count - s), &t, s);
|
||||
|
||||
@@ -24,13 +24,12 @@
|
||||
// ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/archive/array/oarchive.hpp>
|
||||
#include <boost/archive/detail/common_oarchive.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
#include <boost/archive/array/oarchive.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
@@ -45,7 +44,7 @@ namespace archive {
|
||||
// of time. So under some circumstances it may be he right choice.
|
||||
template<class Archive>
|
||||
class basic_binary_oarchive :
|
||||
public array::oarchive<Archive>
|
||||
public archive::detail::common_oarchive<Archive>
|
||||
{
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
@@ -58,17 +57,12 @@ public:
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
#endif
|
||||
// any datatype not specifed below will be handled by base class
|
||||
typedef array::oarchive<Archive> array_oarchive;
|
||||
typedef detail::common_oarchive<Archive> detail_common_oarchive;
|
||||
template<class T>
|
||||
void save_override(const T & t, BOOST_PFTO int){
|
||||
this->array_oarchive::save_override(t, 0L);
|
||||
void save_override(const T & t, BOOST_PFTO int version){
|
||||
this->detail_common_oarchive::save_override(t, static_cast<int>(version));
|
||||
}
|
||||
/*
|
||||
template<class T>
|
||||
void save_override(T & t, BOOST_PFTO int){
|
||||
this->save_override(const_cast<const T &>(t), 0L);
|
||||
}
|
||||
*/
|
||||
|
||||
// binary files don't include the optional information
|
||||
void save_override(const class_id_optional_type & /* t */, int){}
|
||||
|
||||
@@ -119,7 +113,7 @@ public:
|
||||
init();
|
||||
|
||||
basic_binary_oarchive(unsigned int flags) :
|
||||
array_oarchive(flags)
|
||||
detail::common_oarchive<Archive>(flags)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
#include <iosfwd>
|
||||
#include <cassert>
|
||||
#include <locale>
|
||||
#include <cstddef> // size_t
|
||||
#include <streambuf> // basic_streambuf
|
||||
#include <string>
|
||||
#include <cstddef> // size_t
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
@@ -41,7 +41,7 @@ namespace std{
|
||||
//#include <boost/limits.hpp>
|
||||
//#include <boost/io/ios_state.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
|
||||
#include <boost/archive/basic_streambuf_locale_saver.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
@@ -116,17 +116,23 @@ public:
|
||||
|
||||
// we provide an optimized save for all fundamental types
|
||||
// typedef serialization::is_bitwise_serializable<mpl::_1>
|
||||
// use_array_optimization;
|
||||
// use_array_optimization;
|
||||
// workaround without using mpl lambdas
|
||||
struct use_array_optimization {
|
||||
template <class T>
|
||||
struct apply : public serialization::is_bitwise_serializable<T> {};
|
||||
template <class T>
|
||||
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
|
||||
struct apply {
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable<T>::type type;
|
||||
};
|
||||
#else
|
||||
struct apply : public boost::serialization::is_bitwise_serializable<T> {};
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
// the optimized save_array dispatches to save_binary
|
||||
template <class ValueType>
|
||||
void save_array(serialization::array<ValueType> const& a, unsigned int)
|
||||
void save_array(boost::serialization::array<ValueType> const& a, unsigned int)
|
||||
{
|
||||
save_binary(a.address(),a.count()*sizeof(ValueType));
|
||||
}
|
||||
@@ -148,7 +154,9 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save_binary(
|
||||
// mode where by cr characters recieve special treatment.
|
||||
// be sure that the output stream is opened with ios::binary
|
||||
//if(os.fail())
|
||||
// boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
// boost::serialization::throw_exception(
|
||||
// archive_exception(archive_exception::stream_error)
|
||||
// );
|
||||
// figure number of elements to output - round up
|
||||
count = ( count + sizeof(Elem) - 1)
|
||||
/ sizeof(Elem);
|
||||
@@ -157,7 +165,9 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save_binary(
|
||||
count
|
||||
);
|
||||
if(count != static_cast<std::size_t>(scount))
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
//os.write(
|
||||
// static_cast<const BOOST_DEDUCED_TYPENAME OStream::char_type *>(address),
|
||||
// count
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
// use two template parameters
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace std{
|
||||
#include <boost/archive/dinkumware.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/limits.hpp>
|
||||
#include <boost/io/ios_state.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
@@ -80,13 +80,17 @@ public:
|
||||
void load(T & t)
|
||||
{
|
||||
if(is.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
is >> t;
|
||||
}
|
||||
void load(unsigned char & t)
|
||||
{
|
||||
if(is.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
unsigned short int i;
|
||||
is >> i;
|
||||
t = static_cast<unsigned char>(i);
|
||||
@@ -94,7 +98,9 @@ public:
|
||||
void load(signed char & t)
|
||||
{
|
||||
if(is.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
signed short int i;
|
||||
is >> i;
|
||||
t = static_cast<signed char>(i);
|
||||
@@ -102,7 +108,9 @@ public:
|
||||
void load(char & t)
|
||||
{
|
||||
if(is.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
short int i;
|
||||
is >> i;
|
||||
t = static_cast<char>(i);
|
||||
@@ -111,7 +119,9 @@ public:
|
||||
void load(wchar_t & t)
|
||||
{
|
||||
if(is.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
unsigned i;
|
||||
is >> i;
|
||||
t = static_cast<wchar_t>(i);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <cassert>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/archive/detail/common_oarchive.hpp>
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
|
||||
#include <iomanip>
|
||||
#include <locale>
|
||||
#include <cstddef> // size_t
|
||||
#include <cmath> // isnan
|
||||
#include <boost/config/no_tr1/cmath.hpp> // isnan
|
||||
#include <cassert>
|
||||
#include <cstddef> // size_t
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
@@ -48,7 +48,7 @@ namespace std{
|
||||
#include <boost/limits.hpp>
|
||||
#include <boost/io/ios_state.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
@@ -83,7 +83,9 @@ public:
|
||||
template<class T>
|
||||
void save(const T &t){
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os << t;
|
||||
}
|
||||
|
||||
@@ -94,32 +96,42 @@ public:
|
||||
// otherwise crash on load.
|
||||
assert(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os << t;
|
||||
}
|
||||
void save(const signed char t)
|
||||
{
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os << static_cast<short int>(t);
|
||||
}
|
||||
void save(const unsigned char t)
|
||||
{
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os << static_cast<short unsigned int>(t);
|
||||
}
|
||||
void save(const char t)
|
||||
{
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os << static_cast<short int>(t);
|
||||
}
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
void save(const wchar_t t)
|
||||
{
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os << static_cast<int>(t);
|
||||
}
|
||||
#endif
|
||||
@@ -127,7 +139,9 @@ public:
|
||||
{
|
||||
// must be a user mistake - can't serialize un-initialized data
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os << std::setprecision(std::numeric_limits<float>::digits10 + 2);
|
||||
os << t;
|
||||
}
|
||||
@@ -135,7 +149,9 @@ public:
|
||||
{
|
||||
// must be a user mistake - can't serialize un-initialized data
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os << std::setprecision(std::numeric_limits<double>::digits10 + 2);
|
||||
os << t;
|
||||
}
|
||||
@@ -147,13 +163,17 @@ public:
|
||||
// unformatted append of one character
|
||||
void put(int c){
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
os.put(c);
|
||||
}
|
||||
// unformatted append of null terminated string
|
||||
void put(const char * s){
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
while('\0' != *s)
|
||||
os.put(*s++);
|
||||
}
|
||||
|
||||
@@ -28,35 +28,35 @@ namespace archive {
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
OBJECT_ID();
|
||||
BOOST_ARCHIVE_XML_OBJECT_ID();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
OBJECT_REFERENCE();
|
||||
BOOST_ARCHIVE_XML_OBJECT_REFERENCE();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
CLASS_ID();
|
||||
BOOST_ARCHIVE_XML_CLASS_ID();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
CLASS_ID_REFERENCE();
|
||||
BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
CLASS_NAME();
|
||||
BOOST_ARCHIVE_XML_CLASS_NAME();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
TRACKING();
|
||||
BOOST_ARCHIVE_XML_TRACKING();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
VERSION();
|
||||
BOOST_ARCHIVE_XML_VERSION();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
SIGNATURE();
|
||||
BOOST_ARCHIVE_XML_SIGNATURE();
|
||||
|
||||
}// namespace archive
|
||||
}// namespace boost
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
|
||||
@@ -88,5 +88,6 @@ public:
|
||||
|
||||
// required by export
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive)
|
||||
BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive)
|
||||
|
||||
#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <istream>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/basic_binary_iprimitive.hpp>
|
||||
#include <boost/archive/basic_binary_iarchive.hpp>
|
||||
|
||||
|
||||
@@ -50,5 +50,6 @@ typedef binary_oarchive naked_binary_oarchive;
|
||||
|
||||
// required by export
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_oarchive)
|
||||
BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_oarchive)
|
||||
|
||||
#endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <ostream>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/basic_binary_oprimitive.hpp>
|
||||
#include <boost/archive/basic_binary_oarchive.hpp>
|
||||
|
||||
|
||||
@@ -17,27 +17,16 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <locale>
|
||||
#include <cstddef>
|
||||
#include <wchar.h> // for mbstate_t
|
||||
|
||||
#include <cstddef> // NULL, size_t
|
||||
#include <cwchar> // for mbstate_t
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
|
||||
namespace std{
|
||||
#if defined(__LIBCOMO__)
|
||||
using ::mbstate_t;
|
||||
#elif defined(__QNXNTO__)
|
||||
//using std::mbstate_t;
|
||||
#elif defined(BOOST_DINKUMWARE_STDLIB) && BOOST_DINKUMWARE_STDLIB == 1
|
||||
using ::mbstate_t;
|
||||
#elif defined(__SGI_STL_PORT)
|
||||
#elif defined(BOOST_NO_STDC_NAMESPACE)
|
||||
using ::codecvt;
|
||||
using ::mbstate_t;
|
||||
#elif defined(BOOST_RWSTD_VER)
|
||||
using ::mbstate_t;
|
||||
#endif
|
||||
} // namespace std
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
using ::codecvt;
|
||||
using ::mbstate_t;
|
||||
using ::size_t
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#if defined( __BORLANDC__ )
|
||||
#pragma nopushoptwarn
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
|
||||
#if defined( __BORLANDC__ )
|
||||
#pragma nopushoptwarn
|
||||
#endif
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef> // NULL
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <cstddef> // NULL
|
||||
#include <boost/type_traits/broken_compiler_spec.hpp>
|
||||
|
||||
// can't use this - much as I'd like to as borland doesn't support it
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstdlib> // NULL
|
||||
#include <cstddef> // NULL
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <boost/archive/detail/interface_iarchive.hpp>
|
||||
#include <boost/archive/detail/iserializer.hpp>
|
||||
#include <boost/archive/detail/register_archive.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
#include <string>
|
||||
#include <cstddef> // NULL
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
#include <string>
|
||||
#include <cstddef> // NULL
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <new> // for placement new
|
||||
#include <memory> // for auto_ptr
|
||||
#include <cstddef> // size_t
|
||||
#include <cstddef> // size_t, NULL
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
@@ -33,17 +33,17 @@ namespace std{
|
||||
using ::size_t;
|
||||
} // namespace std
|
||||
#endif
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/smart_cast.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/smart_cast.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/static_warning.hpp>
|
||||
#include <boost/serialization/static_warning.hpp>
|
||||
#include <boost/detail/no_exceptions_support.hpp>
|
||||
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/type_traits/is_enum.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_all_extents.hpp>
|
||||
#include <boost/type_traits/remove_extent.hpp>
|
||||
#include <boost/serialization/assume_abstract.hpp>
|
||||
#include <boost/type_traits/is_polymorphic.hpp>
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace std{
|
||||
#include <boost/archive/detail/basic_iarchive.hpp>
|
||||
#include <boost/archive/detail/basic_iserializer.hpp>
|
||||
#include <boost/archive/detail/archive_pointer_iserializer.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
#include <boost/serialization/serialization.hpp>
|
||||
#include <boost/serialization/version.hpp>
|
||||
@@ -115,11 +116,11 @@ public:
|
||||
::get_const_instance()
|
||||
)
|
||||
{}
|
||||
virtual void load_object_data(
|
||||
virtual BOOST_DLLEXPORT void load_object_data(
|
||||
basic_iarchive & ar,
|
||||
void *x,
|
||||
const unsigned int file_version
|
||||
) const;
|
||||
) const BOOST_USED;
|
||||
virtual bool class_info() const {
|
||||
return boost::serialization::implementation_level<T>::value
|
||||
>= boost::serialization::object_class_info;
|
||||
@@ -141,7 +142,7 @@ public:
|
||||
};
|
||||
|
||||
template<class Archive, class T>
|
||||
void iserializer<Archive, T>::load_object_data(
|
||||
BOOST_DLLEXPORT void iserializer<Archive, T>::load_object_data(
|
||||
basic_iarchive & ar,
|
||||
void *x,
|
||||
const unsigned int file_version
|
||||
@@ -149,7 +150,7 @@ void iserializer<Archive, T>::load_object_data(
|
||||
// make sure call is routed through the higest interface that might
|
||||
// be specialized by the user.
|
||||
boost::serialization::serialize_adl(
|
||||
boost::smart_cast_reference<Archive &>(ar),
|
||||
boost::serialization::smart_cast_reference<Archive &>(ar),
|
||||
* static_cast<T *>(x),
|
||||
file_version
|
||||
);
|
||||
@@ -165,11 +166,11 @@ private:
|
||||
iserializer<Archive, T>
|
||||
>::get_const_instance();
|
||||
}
|
||||
virtual void load_object_ptr(
|
||||
BOOST_DLLEXPORT virtual void load_object_ptr(
|
||||
basic_iarchive & ar,
|
||||
void * & x,
|
||||
const unsigned int file_version
|
||||
) const ;
|
||||
) const BOOST_USED;
|
||||
public:
|
||||
pointer_iserializer();
|
||||
};
|
||||
@@ -245,17 +246,18 @@ private:
|
||||
};
|
||||
|
||||
template<class Archive, class T>
|
||||
void pointer_iserializer<Archive, T>::load_object_ptr(
|
||||
BOOST_DLLEXPORT void pointer_iserializer<Archive, T>::load_object_ptr(
|
||||
basic_iarchive & ar,
|
||||
void * & x,
|
||||
const unsigned int file_version
|
||||
) const
|
||||
{
|
||||
Archive & ar_impl = boost::smart_cast_reference<Archive &>(ar);
|
||||
Archive & ar_impl =
|
||||
boost::serialization::smart_cast_reference<Archive &>(ar);
|
||||
|
||||
auto_ptr_with_deleter<T> ap(heap_allocator<T>::invoke());
|
||||
if(NULL == ap.get())
|
||||
boost::throw_exception(std::bad_alloc()) ;
|
||||
boost::serialization::throw_exception(std::bad_alloc()) ;
|
||||
|
||||
T * t = ap.get();
|
||||
x = t;
|
||||
@@ -469,7 +471,7 @@ struct load_enum_type {
|
||||
template<class Archive, class T>
|
||||
struct load_array_type {
|
||||
static void invoke(Archive &ar, T &t){
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_all_extents<T>::type value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_extent<T>::type value_type;
|
||||
|
||||
// convert integers to correct enum to load
|
||||
int current_count = sizeof(t) / (
|
||||
@@ -479,7 +481,7 @@ struct load_array_type {
|
||||
int count;
|
||||
ar >> BOOST_SERIALIZATION_NVP(count);
|
||||
if(count > current_count)
|
||||
boost::throw_exception(archive::archive_exception(
|
||||
boost::serialization::throw_exception(archive::archive_exception(
|
||||
boost::archive::archive_exception::array_size_too_short
|
||||
));
|
||||
ar >> serialization::make_array(static_cast<value_type*>(&t[0]),count);
|
||||
|
||||
@@ -23,13 +23,14 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/smart_cast.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/smart_cast.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/static_warning.hpp>
|
||||
#include <boost/serialization/static_warning.hpp>
|
||||
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/type_traits/is_enum.hpp>
|
||||
@@ -37,7 +38,7 @@
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
//#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_polymorphic.hpp>
|
||||
#include <boost/type_traits/remove_all_extents.hpp>
|
||||
#include <boost/type_traits/remove_extent.hpp>
|
||||
#include <boost/serialization/assume_abstract.hpp>
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
@@ -104,16 +105,16 @@ private:
|
||||
// private constructor to inhibit any existence other than the
|
||||
// static one
|
||||
public:
|
||||
explicit oserializer() :
|
||||
explicit BOOST_DLLEXPORT oserializer() :
|
||||
basic_oserializer(
|
||||
boost::serialization::type_info_implementation<T>::type
|
||||
::get_const_instance()
|
||||
)
|
||||
{}
|
||||
virtual void save_object_data(
|
||||
virtual BOOST_DLLEXPORT void save_object_data(
|
||||
basic_oarchive & ar,
|
||||
const void *x
|
||||
) const ;
|
||||
) const BOOST_USED;
|
||||
virtual bool class_info() const {
|
||||
return boost::serialization::implementation_level<T>::value
|
||||
>= boost::serialization::object_class_info;
|
||||
@@ -133,7 +134,7 @@ public:
|
||||
};
|
||||
|
||||
template<class Archive, class T>
|
||||
void oserializer<Archive, T>::save_object_data(
|
||||
BOOST_DLLEXPORT void oserializer<Archive, T>::save_object_data(
|
||||
basic_oarchive & ar,
|
||||
const void *x
|
||||
) const {
|
||||
@@ -141,7 +142,7 @@ void oserializer<Archive, T>::save_object_data(
|
||||
// be specialized by the user.
|
||||
BOOST_STATIC_ASSERT(boost::is_const<T>::value == false);
|
||||
boost::serialization::serialize_adl(
|
||||
boost::smart_cast_reference<Archive &>(ar),
|
||||
boost::serialization::smart_cast_reference<Archive &>(ar),
|
||||
* static_cast<T *>(const_cast<void *>(x)),
|
||||
version()
|
||||
);
|
||||
@@ -153,12 +154,12 @@ class pointer_oserializer
|
||||
{
|
||||
const basic_oserializer & get_basic_serializer() const;
|
||||
private:
|
||||
virtual void save_object_ptr(
|
||||
virtual BOOST_DLLEXPORT void save_object_ptr(
|
||||
basic_oarchive & ar,
|
||||
const void * x
|
||||
) const ;
|
||||
) const BOOST_USED;
|
||||
public:
|
||||
explicit pointer_oserializer();
|
||||
explicit BOOST_DLLEXPORT pointer_oserializer() BOOST_USED;
|
||||
};
|
||||
|
||||
template<class Archive, class T>
|
||||
@@ -170,7 +171,7 @@ pointer_oserializer<Archive, T>::get_basic_serializer() const {
|
||||
}
|
||||
|
||||
template<class Archive, class T>
|
||||
void pointer_oserializer<Archive, T>::save_object_ptr(
|
||||
BOOST_DLLEXPORT void pointer_oserializer<Archive, T>::save_object_ptr(
|
||||
basic_oarchive & ar,
|
||||
const void * x
|
||||
) const {
|
||||
@@ -179,7 +180,8 @@ void pointer_oserializer<Archive, T>::save_object_ptr(
|
||||
// be specialized by the user.
|
||||
T * t = static_cast<T *>(const_cast<void *>(x));
|
||||
const unsigned int file_version = boost::serialization::version<T>::value;
|
||||
Archive & ar_impl = boost::smart_cast_reference<Archive &>(ar);
|
||||
Archive & ar_impl
|
||||
= boost::serialization::smart_cast_reference<Archive &>(ar);
|
||||
boost::serialization::save_construct_data_adl<Archive, T>(
|
||||
ar_impl,
|
||||
t,
|
||||
@@ -189,7 +191,7 @@ void pointer_oserializer<Archive, T>::save_object_ptr(
|
||||
}
|
||||
|
||||
template<class Archive, class T>
|
||||
pointer_oserializer<Archive, T>::pointer_oserializer() :
|
||||
BOOST_DLLEXPORT pointer_oserializer<Archive, T>::pointer_oserializer() :
|
||||
archive_pointer_oserializer<Archive>(
|
||||
boost::serialization::type_info_implementation<T>::type
|
||||
::get_const_instance()
|
||||
@@ -351,8 +353,9 @@ struct save_pointer_type {
|
||||
Archive &ar,
|
||||
T & t
|
||||
){
|
||||
BOOST_DEDUCED_TYPENAME boost::serialization::type_info_implementation<T>::type
|
||||
const & i = boost::serialization::type_info_implementation<T>::type
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
boost::serialization::type_info_implementation<T>::type const
|
||||
& i = boost::serialization::type_info_implementation<T>::type
|
||||
::get_const_instance();
|
||||
|
||||
boost::serialization::extended_type_info const * const this_type = & i;
|
||||
@@ -367,7 +370,7 @@ struct save_pointer_type {
|
||||
// note:if this exception is thrown, be sure that derived pointer
|
||||
// is either registered or exported.
|
||||
if(NULL == true_type){
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::unregistered_class)
|
||||
);
|
||||
}
|
||||
@@ -381,9 +384,13 @@ struct save_pointer_type {
|
||||
}
|
||||
// convert pointer to more derived type. if this is thrown
|
||||
// it means that the base/derived relationship hasn't be registered
|
||||
vp = serialization::void_downcast(*true_type, *this_type, &t);
|
||||
vp = serialization::void_downcast(
|
||||
*true_type,
|
||||
*this_type,
|
||||
static_cast<const void *>(&t)
|
||||
);
|
||||
if(NULL == vp){
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::unregistered_cast)
|
||||
);
|
||||
}
|
||||
@@ -395,7 +402,7 @@ struct save_pointer_type {
|
||||
= archive_pointer_oserializer<Archive>::find(* true_type);
|
||||
assert(NULL != bpos);
|
||||
if(NULL == bpos)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::unregistered_class)
|
||||
);
|
||||
ar.save_pointer(vp, bpos);
|
||||
@@ -441,7 +448,8 @@ struct save_pointer_type {
|
||||
#endif
|
||||
register_type(ar, * t);
|
||||
if(NULL == t){
|
||||
basic_oarchive & boa = boost::smart_cast_reference<basic_oarchive &>(ar);
|
||||
basic_oarchive & boa
|
||||
= boost::serialization::smart_cast_reference<basic_oarchive &>(ar);
|
||||
boa.save_null_pointer();
|
||||
save_access::end_preamble(ar);
|
||||
return;
|
||||
@@ -464,7 +472,7 @@ template<class Archive, class T>
|
||||
struct save_array_type
|
||||
{
|
||||
static void invoke(Archive &ar, const T &t){
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_all_extents<T>::type value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::remove_extent<T>::type value_type;
|
||||
|
||||
save_access::end_preamble(ar);
|
||||
// consider alignment
|
||||
|
||||
@@ -16,11 +16,9 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
@@ -29,6 +27,8 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/archive/polymorphic_iarchive.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
|
||||
@@ -10,8 +10,13 @@
|
||||
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
|
||||
#include <cstddef>
|
||||
#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/singleton.hpp>
|
||||
#include <boost/archive/detail/basic_serializer_map.hpp>
|
||||
@@ -65,13 +70,16 @@ archive_pointer_iserializer<Archive>::find(
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
archive_pointer_iserializer<Archive>::~archive_pointer_iserializer(){
|
||||
// note: we need to check that the map still exists as we can't depend
|
||||
// on static variables being constructed in a specific sequence
|
||||
unsigned int count;
|
||||
count = serialization::singleton<
|
||||
if(! serialization::singleton<
|
||||
iserializer_map<Archive>
|
||||
>::get_mutable_instance().erase(this);
|
||||
assert(count);
|
||||
>::is_destroyed()
|
||||
){
|
||||
std::size_t count;
|
||||
count = serialization::singleton<
|
||||
iserializer_map<Archive>
|
||||
>::get_mutable_instance().erase(this);
|
||||
assert(count);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -70,11 +70,16 @@ BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
archive_pointer_oserializer<Archive>::~archive_pointer_oserializer(){
|
||||
// note: we need to check that the map still exists as we can't depend
|
||||
// on static variables being constructed in a specific sequence
|
||||
unsigned int count;
|
||||
count = serialization::singleton<
|
||||
oserializer_map<Archive>
|
||||
>::get_mutable_instance().erase(this);
|
||||
assert(count);
|
||||
if(! serialization::singleton<
|
||||
oserializer_map<Archive>
|
||||
>::is_destroyed()
|
||||
){
|
||||
unsigned int count;
|
||||
count = serialization::singleton<
|
||||
oserializer_map<Archive>
|
||||
>::get_mutable_instance().erase(this);
|
||||
assert(count);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -35,7 +35,7 @@ basic_binary_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
|
||||
load_override(cn, 0);
|
||||
if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::invalid_class_name)
|
||||
);
|
||||
std::memcpy(t, cn.data(), cn.size());
|
||||
@@ -49,8 +49,8 @@ basic_binary_iarchive<Archive>::init(){
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
* this->This() >> file_signature;
|
||||
if(file_signature != ARCHIVE_SIGNATURE())
|
||||
boost::throw_exception(
|
||||
if(file_signature != BOOST_ARCHIVE_SIGNATURE())
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::invalid_signature)
|
||||
);
|
||||
|
||||
@@ -69,8 +69,8 @@ basic_binary_iarchive<Archive>::init(){
|
||||
#endif
|
||||
|
||||
// extra little .t is to get around borland quirk
|
||||
if(ARCHIVE_VERSION() < input_library_version.t)
|
||||
boost::throw_exception(
|
||||
if(BOOST_ARCHIVE_VERSION() < input_library_version.t)
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::unsupported_version)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef> // size_t
|
||||
#include <cstddef> // size_t, NULL
|
||||
#include <cstring> // memcpy
|
||||
|
||||
#include <boost/config.hpp>
|
||||
@@ -22,7 +22,7 @@ namespace std{
|
||||
|
||||
#include <boost/detail/workaround.hpp> // fixup for RogueWave
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
@@ -45,22 +45,22 @@ basic_binary_iprimitive<Archive, Elem, Tr>::init()
|
||||
unsigned char size;
|
||||
this->This()->load(size);
|
||||
if(sizeof(int) != size)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::incompatible_native_format)
|
||||
);
|
||||
this->This()->load(size);
|
||||
if(sizeof(long) != size)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::incompatible_native_format)
|
||||
);
|
||||
this->This()->load(size);
|
||||
if(sizeof(float) != size)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::incompatible_native_format)
|
||||
);
|
||||
this->This()->load(size);
|
||||
if(sizeof(double) != size)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::incompatible_native_format)
|
||||
);
|
||||
|
||||
@@ -68,7 +68,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::init()
|
||||
int i;
|
||||
this->This()->load(i);
|
||||
if(1 != i)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::incompatible_native_format)
|
||||
);
|
||||
}
|
||||
@@ -185,11 +185,12 @@ basic_binary_iprimitive<Archive, Elem, Tr>::~basic_binary_iprimitive(){
|
||||
int result = static_cast<detail::input_streambuf_access<Elem, Tr> &>(
|
||||
m_sb
|
||||
).sync();
|
||||
if(0 != result){
|
||||
boost::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
}
|
||||
//destructor can't throw !
|
||||
//if(0 != result){
|
||||
// boost::serialization::throw_exception(
|
||||
// archive_exception(archive_exception::stream_error)
|
||||
// );
|
||||
//}
|
||||
}
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -35,10 +35,10 @@ void
|
||||
#endif
|
||||
basic_binary_oarchive<Archive>::init(){
|
||||
// write signature in an archive version independent manner
|
||||
const std::string file_signature(ARCHIVE_SIGNATURE());
|
||||
const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
|
||||
* this->This() << file_signature;
|
||||
// write library version
|
||||
const version_type v(ARCHIVE_VERSION());
|
||||
const version_type v(BOOST_ARCHIVE_VERSION());
|
||||
* this->This() << v;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <ostream>
|
||||
#include <cstddef> // NULL
|
||||
#include <cstring>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
@@ -29,7 +30,7 @@ namespace std{ using ::wcslen; }
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
#include <boost/archive/add_facet.hpp>
|
||||
@@ -154,11 +155,12 @@ basic_binary_oprimitive<Archive, Elem, Tr>::~basic_binary_oprimitive(){
|
||||
int result = static_cast<detail::output_streambuf_access<Elem, Tr> &>(
|
||||
m_sb
|
||||
).sync();
|
||||
if(0 != result){
|
||||
boost::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
}
|
||||
//destructor can't throw
|
||||
//if(0 != result){
|
||||
// boost::serialization::throw_exception(
|
||||
// archive_exception(archive_exception::stream_error)
|
||||
// );
|
||||
//}
|
||||
}
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -35,7 +35,7 @@ basic_text_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
|
||||
load_override(cn, 0);
|
||||
if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::invalid_class_name)
|
||||
);
|
||||
std::memcpy(t, cn.data(), cn.size());
|
||||
@@ -49,8 +49,8 @@ basic_text_iarchive<Archive>::init(void){
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
* this->This() >> file_signature;
|
||||
if(file_signature != ARCHIVE_SIGNATURE())
|
||||
boost::throw_exception(
|
||||
if(file_signature != BOOST_ARCHIVE_SIGNATURE())
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::invalid_signature)
|
||||
);
|
||||
|
||||
@@ -69,8 +69,8 @@ basic_text_iarchive<Archive>::init(void){
|
||||
#endif
|
||||
|
||||
// extra little .t is to get around borland quirk
|
||||
if(ARCHIVE_VERSION() < input_library_version.t)
|
||||
boost::throw_exception(
|
||||
if(BOOST_ARCHIVE_VERSION() < input_library_version.t)
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::unsupported_version)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstddef> // size_t
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
@@ -17,8 +18,8 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/basic_text_iprimitive.hpp>
|
||||
#include <boost/archive/codecvt_null.hpp>
|
||||
@@ -32,6 +33,23 @@ namespace std{
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
namespace {
|
||||
template<class CharType>
|
||||
bool is_whitespace(CharType c);
|
||||
|
||||
template<>
|
||||
bool is_whitespace(char t){
|
||||
return std::isspace(t);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
template<>
|
||||
bool is_whitespace(wchar_t t){
|
||||
return std::iswspace(t);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// translate base64 text into binary and copy into buffer
|
||||
// until buffer is full.
|
||||
template<class IStream>
|
||||
@@ -51,7 +69,9 @@ basic_text_iprimitive<IStream>::load_binary(
|
||||
);
|
||||
|
||||
if(is.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
// convert from base64 to binary
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
iterators::transform_width<
|
||||
@@ -74,7 +94,6 @@ basic_text_iprimitive<IStream>::load_binary(
|
||||
);
|
||||
|
||||
char * caddr = static_cast<char *>(address);
|
||||
std::size_t padding = 2 - count % 3;
|
||||
|
||||
// take care that we don't increment anymore than necessary
|
||||
while(--count > 0){
|
||||
@@ -83,10 +102,15 @@ basic_text_iprimitive<IStream>::load_binary(
|
||||
}
|
||||
*caddr++ = static_cast<char>(*ti_begin);
|
||||
|
||||
if(padding > 1)
|
||||
++ti_begin;
|
||||
if(padding > 2)
|
||||
++ti_begin;
|
||||
iterators::istream_iterator<CharType> i;
|
||||
for(;;){
|
||||
CharType c;
|
||||
c = is.get();
|
||||
if(is.eof())
|
||||
break;
|
||||
if(is_whitespace(c))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
template<class IStream>
|
||||
|
||||
@@ -51,10 +51,10 @@ template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_text_oarchive<Archive>::init(){
|
||||
// write signature in an archive version independent manner
|
||||
const std::string file_signature(ARCHIVE_SIGNATURE());
|
||||
const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
|
||||
* this->This() << file_signature;
|
||||
// write library version
|
||||
const version_type v(ARCHIVE_VERSION());
|
||||
const version_type v(BOOST_ARCHIVE_VERSION());
|
||||
* this->This() << v;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <boost/pfto.hpp>
|
||||
#include <cstddef> // NULL
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/basic_text_oprimitive.hpp>
|
||||
#include <boost/archive/codecvt_null.hpp>
|
||||
@@ -35,7 +36,9 @@ basic_text_oprimitive<OStream>::save_binary(
|
||||
return;
|
||||
|
||||
if(os.fail())
|
||||
boost::throw_exception(archive_exception(archive_exception::stream_error));
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
|
||||
os.put('\n');
|
||||
|
||||
@@ -61,12 +64,13 @@ basic_text_oprimitive<OStream>::save_binary(
|
||||
),
|
||||
oi
|
||||
);
|
||||
std::size_t padding = 2 - count % 3;
|
||||
if(padding > 1)
|
||||
*oi = '=';
|
||||
if(padding > 2)
|
||||
|
||||
std::size_t tail = count % 3;
|
||||
if(tail > 0){
|
||||
*oi++ = '=';
|
||||
if(tail < 2)
|
||||
*oi = '=';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
template<class OStream>
|
||||
|
||||
@@ -56,9 +56,7 @@
|
||||
#endif
|
||||
|
||||
//#define BOOST_SPIRIT_DEBUG
|
||||
//#include <boost/spirit/core.hpp>
|
||||
#include <boost/spirit/core/non_terminal/rule.hpp>
|
||||
#include <boost/spirit/core/non_terminal/grammar.hpp>
|
||||
|
||||
// the following hack is to evade a bogus error generated by using the
|
||||
// word "arg" when bind.hpp has been included
|
||||
@@ -66,7 +64,13 @@
|
||||
#define arg xarg
|
||||
#endif
|
||||
|
||||
// spirit stuff
|
||||
#if (defined __BORLANDC__) && (__BORLANDC__ < 0x593) \
|
||||
|| (defined _MSC_VER) && (_MSC_VER <= 1300)
|
||||
#include <boost/spirit/utility/chset.hpp>
|
||||
#else
|
||||
#include <boost/spirit/include/classic_chset.hpp>
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
#undef arg
|
||||
@@ -83,8 +87,7 @@ namespace archive {
|
||||
// XML grammar parsing
|
||||
|
||||
template<class CharType>
|
||||
class basic_xml_grammar : public boost::spirit::grammar<basic_xml_grammar<CharType> >
|
||||
{
|
||||
class basic_xml_grammar {
|
||||
public:
|
||||
// The following is not necessary according to DR45, but at least
|
||||
// one compiler (Compaq C++ 6.5 in strict_ansi mode) chokes otherwise.
|
||||
@@ -161,7 +164,7 @@ private:
|
||||
IStream & is,
|
||||
const rule_t &rule_,
|
||||
const CharType delimiter = L'>'
|
||||
);
|
||||
) const ;
|
||||
public:
|
||||
struct return_values {
|
||||
StringType object_name;
|
||||
@@ -176,15 +179,14 @@ public:
|
||||
tracking_level(false)
|
||||
{}
|
||||
} rv;
|
||||
bool parse_start_tag(IStream & is) ;
|
||||
bool parse_end_tag(IStream & is);
|
||||
bool parse_string(IStream & is, StringType & s);
|
||||
bool parse_start_tag(IStream & is) /*const*/;
|
||||
bool parse_end_tag(IStream & is) const;
|
||||
bool parse_string(IStream & is, StringType & s) /*const*/;
|
||||
void init(IStream & is);
|
||||
void windup(IStream & is);
|
||||
basic_xml_grammar();
|
||||
};
|
||||
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef> // NULL
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
|
||||
#include <boost/archive/basic_xml_iarchive.hpp>
|
||||
#include <boost/serialization/tracking.hpp>
|
||||
@@ -30,7 +31,7 @@ basic_xml_iarchive<Archive>::load_start(const char *name){
|
||||
return;
|
||||
bool result = this->This()->gimpl->parse_start_tag(this->This()->get_is());
|
||||
if(true != result){
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
}
|
||||
@@ -47,7 +48,7 @@ basic_xml_iarchive<Archive>::load_end(const char *name){
|
||||
return;
|
||||
bool result = this->This()->gimpl->parse_end_tag(this->This()->get_is());
|
||||
if(true != result){
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
}
|
||||
@@ -65,7 +66,7 @@ basic_xml_iarchive<Archive>::load_end(const char *name){
|
||||
name
|
||||
)
|
||||
){
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef> // NULL
|
||||
#include <cstring>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__)
|
||||
namespace std{
|
||||
@@ -43,7 +44,7 @@ struct XML_name {
|
||||
if((unsigned)t > 127)
|
||||
return;
|
||||
if(0 == lookup_table[(unsigned)t])
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(
|
||||
xml_archive_exception::xml_archive_tag_name_error
|
||||
)
|
||||
@@ -151,7 +152,7 @@ BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const object_id_type & t, int)
|
||||
{
|
||||
int i = t.t; // extra .t is for borland
|
||||
write_attribute(OBJECT_ID(), i, "=\"_");
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
@@ -160,14 +161,14 @@ basic_xml_oarchive<Archive>::save_override(
|
||||
int
|
||||
){
|
||||
int i = t.t; // extra .t is for borland
|
||||
write_attribute(OBJECT_REFERENCE(), i, "=\"_");
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
|
||||
{
|
||||
int i = t.t; // extra .t is for borland
|
||||
write_attribute(VERSION(), i);
|
||||
write_attribute(VBOOST_ARCHIVE_XML_ERSION(), i);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -177,7 +178,7 @@ basic_xml_oarchive<Archive>::save_override(const object_id_type & t, int)
|
||||
{
|
||||
// borland doesn't do conversion of STRONG_TYPEDEFs very well
|
||||
const unsigned int i = t;
|
||||
write_attribute(OBJECT_ID(), i, "=\"_");
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
@@ -186,21 +187,21 @@ basic_xml_oarchive<Archive>::save_override(
|
||||
int
|
||||
){
|
||||
const unsigned int i = t;
|
||||
write_attribute(OBJECT_REFERENCE(), i, "=\"_");
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
|
||||
{
|
||||
const unsigned int i = t;
|
||||
write_attribute(VERSION(), i);
|
||||
write_attribute(BOOST_ARCHIVE_XML_VERSION(), i);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const class_id_type & t, int)
|
||||
{
|
||||
write_attribute(CLASS_ID(), t);
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
@@ -208,7 +209,7 @@ basic_xml_oarchive<Archive>::save_override(
|
||||
const class_id_reference_type & t,
|
||||
int
|
||||
){
|
||||
write_attribute(CLASS_ID_REFERENCE(), t);
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
@@ -216,7 +217,7 @@ basic_xml_oarchive<Archive>::save_override(
|
||||
const class_id_optional_type & t,
|
||||
int
|
||||
){
|
||||
write_attribute(CLASS_ID(), t);
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
@@ -225,14 +226,14 @@ basic_xml_oarchive<Archive>::save_override(const class_name_type & t, int)
|
||||
const char * key = t;
|
||||
if(NULL == key)
|
||||
return;
|
||||
write_attribute(CLASS_NAME(), key);
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_NAME(), key);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const tracking_type & t, int)
|
||||
{
|
||||
write_attribute(TRACKING(), t.t);
|
||||
write_attribute(BOOST_ARCHIVE_XML_TRACKING(), t.t);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
@@ -243,8 +244,8 @@ basic_xml_oarchive<Archive>::init(){
|
||||
this->This()->put("<!DOCTYPE boost_serialization>\n");
|
||||
// xml document wrapper - outer root
|
||||
this->This()->put("<boost_serialization");
|
||||
write_attribute("signature", ARCHIVE_SIGNATURE());
|
||||
write_attribute("version", ARCHIVE_VERSION());
|
||||
write_attribute("signature", BOOST_ARCHIVE_SIGNATURE());
|
||||
write_attribute("version", BOOST_ARCHIVE_VERSION());
|
||||
this->This()->put(">\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// implementation of basic_text_iprimitive overrides for the combination
|
||||
// of template parameters used to implement a text_iprimitive
|
||||
|
||||
#include <cstddef> // size_t
|
||||
#include <cstddef> // size_t, NULL
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstddef> // size_t
|
||||
#include <cstddef> // size_t, NULL
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <cstring> // memcpy
|
||||
#include <cstddef> // NULL
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::memcpy;
|
||||
@@ -55,7 +56,7 @@ xml_iarchive_impl<Archive>::load(std::wstring &ws){
|
||||
std::string s;
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
if(! result)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
);
|
||||
|
||||
@@ -73,7 +74,7 @@ xml_iarchive_impl<Archive>::load(std::wstring &ws){
|
||||
ws += wc;
|
||||
continue;
|
||||
}
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
iterators::dataflow_exception(
|
||||
iterators::dataflow_exception::invalid_conversion
|
||||
)
|
||||
@@ -89,7 +90,7 @@ xml_iarchive_impl<Archive>::load(wchar_t * ws){
|
||||
std::string s;
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
if(! result)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
);
|
||||
|
||||
@@ -103,7 +104,7 @@ xml_iarchive_impl<Archive>::load(wchar_t * ws){
|
||||
*ws++ = wc;
|
||||
continue;
|
||||
}
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
iterators::dataflow_exception(
|
||||
iterators::dataflow_exception::invalid_conversion
|
||||
)
|
||||
@@ -120,7 +121,7 @@ BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::load(std::string &s){
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
if(! result)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
);
|
||||
}
|
||||
@@ -131,7 +132,7 @@ xml_iarchive_impl<Archive>::load(char * s){
|
||||
std::string tstring;
|
||||
bool result = gimpl->parse_string(is, tstring);
|
||||
if(! result)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
);
|
||||
std::memcpy(s, tstring.data(), tstring.size());
|
||||
@@ -143,7 +144,7 @@ BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
const std::string & s = gimpl->rv.class_name;
|
||||
if(s.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::invalid_class_name)
|
||||
);
|
||||
char * tptr = t;
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace std{
|
||||
|
||||
#include <boost/io/ios_state.hpp>
|
||||
#include <boost/detail/no_exceptions_support.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <boost/archive/add_facet.hpp>
|
||||
@@ -73,7 +73,7 @@ xml_wiarchive_impl<Archive>::load(std::string & s){
|
||||
std::wstring ws;
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
if(! result)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
);
|
||||
#if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
|
||||
@@ -98,7 +98,7 @@ BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::load(std::wstring & ws){
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
if(! result)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ xml_wiarchive_impl<Archive>::load(char * s){
|
||||
std::wstring ws;
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
if(! result)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
);
|
||||
copy_to_ptr(s, ws);
|
||||
@@ -123,7 +123,7 @@ xml_wiarchive_impl<Archive>::load(wchar_t * ws){
|
||||
std::wstring twstring;
|
||||
bool result = gimpl->parse_string(is, twstring);
|
||||
if(! result)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
);
|
||||
std::memcpy(ws, twstring.c_str(), twstring.size());
|
||||
@@ -136,7 +136,7 @@ BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
const std::wstring & ws = gimpl->rv.class_name;
|
||||
if(ws.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::invalid_class_name)
|
||||
);
|
||||
copy_to_ptr(t, ws);
|
||||
@@ -166,7 +166,7 @@ xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
|
||||
archive_locale.reset(
|
||||
add_facet(
|
||||
std::locale::classic(),
|
||||
new detail::utf8_codecvt_facet
|
||||
new boost::archive::detail::utf8_codecvt_facet
|
||||
)
|
||||
);
|
||||
is.imbue(* archive_locale);
|
||||
|
||||
@@ -30,8 +30,8 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/iterators/xml_escape.hpp>
|
||||
#include <boost/archive/iterators/wchar_from_mb.hpp>
|
||||
@@ -139,12 +139,13 @@ xml_woarchive_impl<Archive>::xml_woarchive_impl(
|
||||
// we can hack around this by using a static codecvt that never
|
||||
// gets destroyed.
|
||||
if(0 == (flags & no_codecvt)){
|
||||
detail::utf8_codecvt_facet *pfacet;
|
||||
boost::archive::detail::utf8_codecvt_facet *pfacet;
|
||||
#if defined(__SGI_STL_PORT)
|
||||
static detail::utf8_codecvt_facet facet(static_cast<size_t>(1));
|
||||
static boost::archive::detail::utf8_codecvt_facet
|
||||
facet(static_cast<size_t>(1));
|
||||
pfacet = & facet;
|
||||
#else
|
||||
pfacet = new detail::utf8_codecvt_facet;
|
||||
pfacet = new boost::archive::detail::utf8_codecvt_facet;
|
||||
#endif
|
||||
archive_locale.reset(add_facet(std::locale::classic(), pfacet));
|
||||
os.imbue(* archive_locale);
|
||||
|
||||
@@ -18,8 +18,15 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include <cstddef> // size_t
|
||||
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
|
||||
#include <boost/pfto.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
#include <boost/archive/iterators/dataflow_exception.hpp>
|
||||
@@ -43,7 +50,7 @@ struct from_6_bit {
|
||||
"0123456789"
|
||||
"+/";
|
||||
assert(t < 64);
|
||||
return lookup_table[t];
|
||||
return lookup_table[static_cast<size_t>(t)];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include <cassert>
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
@@ -57,7 +57,7 @@ struct to_6_bit {
|
||||
if((unsigned)t <= 127)
|
||||
value = lookup_table[(unsigned)t];
|
||||
if(-1 == value)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
dataflow_exception(dataflow_exception::invalid_base64_character)
|
||||
);
|
||||
return value;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
#include <exception>
|
||||
#endif //BOOST_NO_EXCEPTIONS
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@@ -76,5 +77,4 @@ public:
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
#endif //BOOST_NO_EXCEPTIONS
|
||||
#endif //BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
namespace std{ using ::memcpy; }
|
||||
#endif
|
||||
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
// for wchar_t based streams on systems for which wchar_t not a true
|
||||
// type but rather a synonym for some integer type.
|
||||
|
||||
#include <cstddef> // NULL
|
||||
#include <istream>
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
|
||||
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/iterator/filter_iterator.hpp>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
// or 3 8 bit characters
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME & PTFO
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/archive/iterators/dataflow_exception.hpp>
|
||||
@@ -116,7 +116,7 @@ wchar_t wchar_from_mb<Base>::drain(){
|
||||
wchar_t retval;
|
||||
int result = std::mbtowc(& retval, buffer, MB_CUR_MAX);
|
||||
if(0 >= result)
|
||||
boost::throw_exception(iterators::dataflow_exception(
|
||||
boost::serialization::throw_exception(iterators::dataflow_exception(
|
||||
iterators::dataflow_exception::invalid_conversion
|
||||
));
|
||||
return retval;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <cassert>
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/iterators/escape.hpp>
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include <cassert>
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/iterators/unescape.hpp>
|
||||
#include <boost/archive/iterators/dataflow_exception.hpp>
|
||||
@@ -61,7 +61,7 @@ template<class Base>
|
||||
void xml_unescape<Base>::drain_residue(const char * literal){
|
||||
do{
|
||||
if(* literal != * ++(this->base_reference()))
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
dataflow_exception(
|
||||
dataflow_exception::invalid_xml_escape_sequence
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace std{
|
||||
#include <string>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/detail/iserializer.hpp>
|
||||
#include <boost/archive/detail/interface_iarchive.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -42,13 +42,17 @@ namespace std{
|
||||
#if defined(BOOST_NO_INT64_T)
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#else
|
||||
#if defined(ULONG_MAX)
|
||||
#if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#else
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#if defined(ULLONG_MAX)
|
||||
#if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#elif defined(ULONG_MAX)
|
||||
#if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#else
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace std{
|
||||
#endif
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/detail/oserializer.hpp>
|
||||
#include <boost/archive/detail/interface_oarchive.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -41,13 +41,17 @@ namespace std{
|
||||
#if defined(BOOST_NO_INT64_T)
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#else
|
||||
#if defined(ULONG_MAX)
|
||||
#if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#else
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#if defined(ULLONG_MAX)
|
||||
#if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#elif defined(ULONG_MAX)
|
||||
#if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#else
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
@@ -18,12 +18,13 @@
|
||||
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/serialization/type_info_implementation.hpp>
|
||||
#include <boost/serialization/shared_ptr_132.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
@@ -53,7 +54,7 @@ struct null_deleter {
|
||||
// a common class for holding various types of shared pointers
|
||||
|
||||
class shared_ptr_helper {
|
||||
typedef std::map<void*, shared_ptr<void> > collection_type;
|
||||
typedef std::map<const void *, shared_ptr<void> > collection_type;
|
||||
typedef collection_type::const_iterator iterator_type;
|
||||
// list of shared_pointers create accessable by raw pointer. This
|
||||
// is used to "match up" shared pointers loaded at different
|
||||
@@ -85,14 +86,14 @@ public:
|
||||
|
||||
// return a void pointer to the most derived type
|
||||
template<class T>
|
||||
void * object_identifier(T * t) const {
|
||||
const void * object_identifier(T * t) const {
|
||||
const boost::serialization::extended_type_info * true_type
|
||||
= boost::serialization::type_info_implementation<T>::type
|
||||
::get_const_instance().get_derived_extended_type_info(*t);
|
||||
// note:if this exception is thrown, be sure that derived pointer
|
||||
// is either registered or exported.
|
||||
if(NULL == true_type)
|
||||
boost::throw_exception(
|
||||
boost::serialization::throw_exception(
|
||||
boost::archive::archive_exception(
|
||||
boost::archive::archive_exception::unregistered_class
|
||||
)
|
||||
@@ -100,7 +101,11 @@ public:
|
||||
const boost::serialization::extended_type_info * this_type
|
||||
= & boost::serialization::type_info_implementation<T>::type
|
||||
::get_const_instance();
|
||||
void * vp = void_downcast(*true_type, *this_type, t);
|
||||
const void * vp = void_downcast(
|
||||
*true_type,
|
||||
*this_type,
|
||||
static_cast<const void *>(t)
|
||||
);
|
||||
return vp;
|
||||
}
|
||||
public:
|
||||
@@ -112,7 +117,7 @@ public:
|
||||
}
|
||||
// get pointer to the most derived object. This is effectively
|
||||
// the object identifer
|
||||
void * od = object_identifier(r);
|
||||
const void * od = object_identifier(r);
|
||||
|
||||
if(NULL == m_pointers)
|
||||
m_pointers = new collection_type;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstdlib> // getenv
|
||||
#include <cstddef> // NULL
|
||||
#include <cassert>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
+6
-61
@@ -6,69 +6,14 @@
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// pfto.hpp: workarounds for compilers which have problems supporting
|
||||
// Partial Function Template Ordering (PFTO).
|
||||
#error "This header is deprecated. Please use: boost/serialization/pfto.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.
|
||||
// PFTO version is used to specify the last argument of certain functions
|
||||
// Function it is used to support compilers that fail to support correct Partial
|
||||
// Template Ordering
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// some compilers can use an exta argument and use function overloading
|
||||
// to choose desired function. This extra argument is long in the default
|
||||
// function implementation and int for the rest. The function is called
|
||||
// with an int argument. This first attempts to match functions with an
|
||||
// int argument before the default one (with a long argument). This is
|
||||
// known to function with VC 6.0. On other compilers this fails (Borland)
|
||||
// or causes other problems (GCC). note: this
|
||||
|
||||
#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
|
||||
#define BOOST_PFTO long
|
||||
#else
|
||||
#define BOOST_PFTO
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
|
||||
# pragma message ("Warning: This header is deprecated. Please use: boost/serialization/pfto.hpp")
|
||||
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
|
||||
# warning "This header is deprecated. Please use: boost/serialization/pfto.hpp"
|
||||
#endif
|
||||
|
||||
// here's another approach. Rather than use a default function - make sure
|
||||
// there is no default at all by requiring that all function invocations
|
||||
// have a "wrapped" argument type. This solves a problem with VC 6.0
|
||||
// (and perhaps others) while implementing templated constructors.
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class T>
|
||||
struct pfto_wrapper {
|
||||
const T & t;
|
||||
operator const T & (){
|
||||
return t;
|
||||
}
|
||||
pfto_wrapper (const T & rhs) : t(rhs) {}
|
||||
};
|
||||
|
||||
template<class T>
|
||||
pfto_wrapper<T> make_pfto_wrapper(const T & t, BOOST_PFTO int){
|
||||
return pfto_wrapper<T>(t);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
pfto_wrapper<T> make_pfto_wrapper(const pfto_wrapper<T> & t, int){
|
||||
return t;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
#define BOOST_PFTO_WRAPPER(T) boost::pfto_wrapper<T>
|
||||
#define BOOST_MAKE_PFTO_WRAPPER(t) boost::make_pfto_wrapper(t, 0)
|
||||
#else
|
||||
#define BOOST_PFTO_WRAPPER(T) T
|
||||
#define BOOST_MAKE_PFTO_WRAPPER(t) t
|
||||
#endif
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#endif // BOOST_PFTO_HPP
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/pfto.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
|
||||
@@ -7,15 +7,40 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <boost/serialization/split_free.hpp>
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
#include <boost/serialization/wrapper.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/mpl/always.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <iostream>
|
||||
|
||||
#include <cstddef> // std::size_t
|
||||
#include <cstddef>
|
||||
#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 { namespace serialization {
|
||||
|
||||
// traits to specify whether to use an optimized array serialization
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
// workaround for Borland compiler
|
||||
template <class Archive>
|
||||
struct use_array_optimization {
|
||||
template <class T> struct apply : boost::mpl::false_ {};
|
||||
};
|
||||
|
||||
#else
|
||||
template <class Archive>
|
||||
struct use_array_optimization : boost::mpl::always<boost::mpl::false_> {};
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
class array
|
||||
: public wrapper_traits<array<T> >
|
||||
@@ -30,13 +55,45 @@ public:
|
||||
|
||||
// default implementation
|
||||
template<class Archive>
|
||||
void serialize(Archive &ar, const unsigned int) const
|
||||
void serialize_optimized(Archive &ar, const unsigned int, mpl::false_ ) const
|
||||
{
|
||||
// default implemention does the loop
|
||||
std::size_t c = count();
|
||||
value_type * t = address();
|
||||
while(0 < c--)
|
||||
ar & make_nvp("item", *t++);
|
||||
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 BOOST_DEDUCED_TYPENAME
|
||||
boost::serialization::use_array_optimization<Archive>::template apply<
|
||||
BOOST_DEDUCED_TYPENAME remove_const<T>::type
|
||||
>::type use_optimized;
|
||||
serialize_optimized(ar,version,use_optimized());
|
||||
}
|
||||
|
||||
value_type* address() const
|
||||
@@ -64,44 +121,30 @@ array<T> make_array( T* t, std::size_t s){
|
||||
return array<T>(t, s);
|
||||
}
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// T[N]
|
||||
|
||||
/*
|
||||
template <class Archive, class T, std::size_t N>
|
||||
|
||||
template<class Archive, class U, std::size_t N>
|
||||
void save( Archive & ar, U const (& t)[N], const unsigned int file_version )
|
||||
void serialize(Archive& ar, boost::array<T,N>& a, const unsigned int /* version */)
|
||||
{
|
||||
const serialization::collection_size_type count(N);
|
||||
ar << BOOST_SERIALIZATION_NVP(count);
|
||||
if (N)
|
||||
ar << serialization::make_array(&t[0],N);
|
||||
ar & boost::serialization::make_nvp("elems",a.elems);
|
||||
}
|
||||
|
||||
template<class Archive, class U, std::size_t N>
|
||||
void load( Archive & ar, U (& t)[N], const unsigned int file_version )
|
||||
{
|
||||
serialization::collection_size_type count;
|
||||
ar >> BOOST_SERIALIZATION_NVP(count);
|
||||
if(count > N)
|
||||
boost::throw_exception(archive::archive_exception(
|
||||
boost::archive::archive_exception::array_size_too_short
|
||||
));
|
||||
if (N)
|
||||
ar >> serialization::make_array(&t[0],count);
|
||||
}
|
||||
|
||||
|
||||
// split non-intrusive serialization function member into separate
|
||||
// non intrusive save/load member functions
|
||||
template<class Archive, class U, std::size_t N>
|
||||
inline void serialize( Archive & ar, U (& t)[N], const unsigned int file_version)
|
||||
{
|
||||
boost::serialization::split_free(ar, t, file_version);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
} } // end namespace boost::serialization
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
// ignore optimizations for Borland
|
||||
#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive)
|
||||
#else
|
||||
#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 \
|
||||
, BOOST_DEDUCED_TYPENAME boost::remove_const<ValueType>::type \
|
||||
>::type {}; \
|
||||
}; }}
|
||||
#endif // __BORLANDC__
|
||||
|
||||
#endif //BOOST_SERIALIZATION_ARRAY_HPP
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
|
||||
#define BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
|
||||
#ifndef BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
|
||||
#define BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
@@ -7,7 +7,7 @@
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// is_abstract_class.hpp:
|
||||
// assume_abstract_class.hpp:
|
||||
|
||||
// (C) Copyright 2008 Robert Ramey
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
@@ -56,4 +56,4 @@ struct is_abstract< const T > : boost::true_type {}; \
|
||||
|
||||
#endif // BOOST_NO_IS_ABSTRACT
|
||||
|
||||
#endif //BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
|
||||
#endif //BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/strong_typedef.hpp>
|
||||
#include <boost/serialization/strong_typedef.hpp>
|
||||
#include <boost/serialization/level.hpp>
|
||||
|
||||
namespace boost { namespace serialization {
|
||||
|
||||
@@ -54,8 +54,12 @@ struct implementation_level< C < T > > { \
|
||||
#if defined(BOOST_NO_INT64_T)
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#else
|
||||
#if defined(ULONG_MAX)
|
||||
#if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1
|
||||
#if defined(ULLONG_MAX)
|
||||
#if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#elif defined(ULONG_MAX)
|
||||
#if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1
|
||||
#define BOOST_NO_INTRINSIC_INT64_T
|
||||
#endif
|
||||
#else
|
||||
|
||||
@@ -23,7 +23,13 @@
|
||||
// helper function templates for serialization of collections
|
||||
|
||||
#include <cassert>
|
||||
#include <boost/config.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/serialization/access.hpp>
|
||||
@@ -31,6 +37,7 @@
|
||||
#include <boost/serialization/detail/stack_constructor.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
|
||||
|
||||
namespace boost{
|
||||
namespace serialization {
|
||||
namespace stl {
|
||||
@@ -57,9 +64,61 @@ struct archive_input_seq
|
||||
}
|
||||
};
|
||||
|
||||
// map and set input
|
||||
// map input
|
||||
template<class Archive, class Container>
|
||||
struct archive_input_unique
|
||||
struct archive_input_map
|
||||
{
|
||||
inline void operator()(
|
||||
Archive &ar,
|
||||
Container &s,
|
||||
const unsigned int v
|
||||
){
|
||||
typedef BOOST_DEDUCED_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<BOOST_DEDUCED_TYPENAME Container::const_iterator, bool> 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.
|
||||
if(result.second){
|
||||
ar.reset_object_address(
|
||||
& (result.first->second),
|
||||
& t.reference().second
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// multimap input
|
||||
template<class Archive, class Container>
|
||||
struct archive_input_multimap
|
||||
{
|
||||
inline void operator()(
|
||||
Archive &ar,
|
||||
Container &s,
|
||||
const unsigned int v
|
||||
){
|
||||
typedef BOOST_DEDUCED_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());
|
||||
BOOST_DEDUCED_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()
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// set input
|
||||
template<class Archive, class Container>
|
||||
struct archive_input_set
|
||||
{
|
||||
inline void operator()(
|
||||
Archive &ar,
|
||||
@@ -77,9 +136,9 @@ struct archive_input_unique
|
||||
}
|
||||
};
|
||||
|
||||
// multiset and multimap input
|
||||
// multiset input
|
||||
template<class Archive, class Container>
|
||||
struct archive_input_multi
|
||||
struct archive_input_multiset
|
||||
{
|
||||
inline void operator()(
|
||||
Archive &ar,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/checked_delete.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_mutex.hpp>
|
||||
|
||||
#if defined(BOOST_SP_USE_QUICK_ALLOCATOR)
|
||||
@@ -38,6 +38,13 @@
|
||||
#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
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn -8026 // Functions with excep. spec. are not expanded inline
|
||||
# pragma warn -8027 // Functions containing try are not expanded inline
|
||||
@@ -127,7 +134,7 @@ public:
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
mutex_type::scoped_lock lock(mtx_);
|
||||
#endif
|
||||
if(use_count_ == 0) boost::throw_exception(bad_weak_ptr());
|
||||
if(use_count_ == 0) boost::serialization::throw_exception(bad_weak_ptr());
|
||||
++use_count_;
|
||||
}
|
||||
|
||||
@@ -285,12 +292,12 @@ public:
|
||||
|
||||
void * operator new(std::size_t)
|
||||
{
|
||||
return quick_allocator<this_type>::alloc();
|
||||
return boost::detail::quick_allocator<this_type>::alloc();
|
||||
}
|
||||
|
||||
void operator delete(void * p)
|
||||
{
|
||||
quick_allocator<this_type>::dealloc(p);
|
||||
boost::detail::quick_allocator<this_type>::dealloc(p);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -350,7 +357,7 @@ public:
|
||||
if(pi_ == 0)
|
||||
{
|
||||
d(p); // delete p
|
||||
boost::throw_exception(std::bad_alloc());
|
||||
boost::serialization::throw_exception(std::bad_alloc());
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -544,7 +551,7 @@ inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::throw_exception(bad_weak_ptr());
|
||||
boost::serialization::throw_exception(bad_weak_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
#include <boost/config.hpp> // for broken compiler workarounds
|
||||
|
||||
#if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
|
||||
#include <boost/serializaition/detail/shared_ptr_nmt_132.hpp>
|
||||
#include <boost/serialization/detail/shared_ptr_nmt_132.hpp>
|
||||
#else
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/checked_delete.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/serialization/access.hpp>
|
||||
@@ -41,10 +41,6 @@
|
||||
|
||||
namespace boost_132 {
|
||||
|
||||
#if !BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x560) )
|
||||
using namespace boost;
|
||||
#endif
|
||||
|
||||
template<class T> class weak_ptr;
|
||||
template<class T> class enable_shared_from_this;
|
||||
|
||||
@@ -126,10 +122,10 @@ public:
|
||||
|
||||
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x564) )
|
||||
template<class Y>
|
||||
explicit shared_ptr(Y * p): px(p), pn(p,boost::checked_deleter<Y>()) // Y must be complete
|
||||
explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter<Y>()) // Y must be complete
|
||||
#else
|
||||
template<class Y>
|
||||
explicit shared_ptr(Y * p): px(p), pn(p, checked_deleter<Y>()) // Y must be complete
|
||||
explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter<Y>()) // Y must be complete
|
||||
#endif
|
||||
{
|
||||
detail::sp_enable_shared_from_this( pn, p, p );
|
||||
@@ -196,7 +192,7 @@ public:
|
||||
{
|
||||
if(px == 0)
|
||||
{
|
||||
boost::throw_exception(std::bad_cast());
|
||||
boost::serialization::throw_exception(std::bad_cast());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/checked_delete.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
|
||||
#ifndef BOOST_NO_AUTO_PTR
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
if(pn == 0)
|
||||
{
|
||||
boost::checked_delete(p);
|
||||
boost::throw_exception(std::bad_alloc());
|
||||
boost::serialization::throw_exception(std::bad_alloc());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,16 +22,17 @@
|
||||
// that are to be serialized through pointers.
|
||||
|
||||
#include <utility>
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/static_warning.hpp>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
#include <boost/type_traits/is_polymorphic.hpp>
|
||||
|
||||
#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
|
||||
#include <boost/serialization/extended_type_info_typeid.hpp>
|
||||
#endif
|
||||
#include <boost/serialization/static_warning.hpp>
|
||||
#include <boost/serialization/type_info_implementation.hpp>
|
||||
#include <boost/serialization/assume_abstract.hpp>
|
||||
#include <boost/serialization/force_include.hpp>
|
||||
@@ -62,14 +63,14 @@ struct export_impl
|
||||
{
|
||||
static const basic_pointer_iserializer &
|
||||
enable_load(mpl::true_){
|
||||
return /* BOOST_DEDUCED_TYPENAME */ boost::serialization::singleton<
|
||||
return boost::serialization::singleton<
|
||||
pointer_iserializer<Archive, Serializable>
|
||||
>::get_const_instance();
|
||||
}
|
||||
|
||||
static const basic_pointer_oserializer &
|
||||
enable_save(mpl::true_){
|
||||
return /* BOOST_DEDUCED_TYPENAME */ boost::serialization::singleton<
|
||||
return boost::serialization::singleton<
|
||||
pointer_oserializer<Archive, Serializable>
|
||||
>::get_const_instance();
|
||||
}
|
||||
@@ -87,13 +88,11 @@ struct ptr_serialization_support
|
||||
{
|
||||
# if defined(BOOST_MSVC)
|
||||
virtual BOOST_DLLEXPORT void instantiate() BOOST_USED;
|
||||
# elif defined(__INTEL_COMPILER)
|
||||
virtual BOOST_DLLEXPORT void instantiate() BOOST_USED;
|
||||
# elif defined(__BORLANDC__)
|
||||
static BOOST_DLLEXPORT void instantiate();
|
||||
static BOOST_DLLEXPORT void instantiate() BOOST_USED;
|
||||
enum { x = sizeof(instantiate(),3) };
|
||||
# else
|
||||
static void instantiate();
|
||||
static BOOST_DLLEXPORT void instantiate() BOOST_USED;
|
||||
typedef instantiate_function<
|
||||
&ptr_serialization_support::instantiate
|
||||
> x;
|
||||
@@ -101,21 +100,28 @@ struct ptr_serialization_support
|
||||
};
|
||||
|
||||
template <class Archive, class Serializable>
|
||||
BOOST_DLLEXPORT void ptr_serialization_support<Archive,Serializable>::instantiate()
|
||||
BOOST_DLLEXPORT void
|
||||
ptr_serialization_support<Archive,Serializable>::instantiate()
|
||||
{
|
||||
export_impl<Archive,Serializable>::enable_save(
|
||||
BOOST_DEDUCED_TYPENAME Archive::is_saving()
|
||||
#if ! defined(__BORLANDC__)
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
#endif
|
||||
Archive::is_saving()
|
||||
);
|
||||
|
||||
export_impl<Archive,Serializable>::enable_load(
|
||||
BOOST_DEDUCED_TYPENAME Archive::is_loading()
|
||||
#if ! defined(__BORLANDC__)
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
#endif
|
||||
Archive::is_loading()
|
||||
);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
struct guid_initializer
|
||||
{
|
||||
const guid_initializer & export_guid(char const* key, mpl::false_){
|
||||
const guid_initializer & export_guid(char const* /* key */, mpl::false_){
|
||||
// generates the statically-initialized objects whose constructors
|
||||
// register the information allowing serialization of T objects
|
||||
// through pointers to their base classes.
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// this could change in the future.
|
||||
#include <cstdarg>
|
||||
#include <cassert>
|
||||
#include <cstddef> // NULL
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/serialization/config.hpp>
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
|
||||
#include <typeinfo>
|
||||
#include <cstdarg>
|
||||
|
||||
#include <cassert>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/static_warning.hpp>
|
||||
#include <boost/serialization/static_warning.hpp>
|
||||
#include <boost/type_traits/is_polymorphic.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
@@ -112,8 +112,15 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
void destroy(void const * const p) const{
|
||||
delete static_cast<T const *>(p) ;
|
||||
void destroy(void const * const /* p */) const {
|
||||
// the only current usage of extended type info is in the
|
||||
// serialization library. The statement below requires
|
||||
// that destructor of type T be public and this creates
|
||||
// a problem for some users. So, for now, comment this
|
||||
// out
|
||||
//delete static_cast<T const *>(p);
|
||||
// and trap any attempt to invoke this function
|
||||
assert(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstdarg>
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/comparison/greater.hpp>
|
||||
|
||||
@@ -70,7 +70,7 @@ inline void load(
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_map<
|
||||
Key, HashFcn, EqualKey, Allocator
|
||||
>,
|
||||
boost::serialization::stl::archive_input_unique<
|
||||
boost::serialization::stl::archive_input_map<
|
||||
Archive,
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_map<
|
||||
Key, HashFcn, EqualKey, Allocator
|
||||
@@ -140,7 +140,7 @@ inline void load(
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
|
||||
Key, HashFcn, EqualKey, Allocator
|
||||
>,
|
||||
boost::serialization::stl::archive_input_multi<
|
||||
boost::serialization::stl::archive_input_multimap<
|
||||
Archive,
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_multimap<
|
||||
Key, HashFcn, EqualKey, Allocator
|
||||
|
||||
@@ -68,7 +68,7 @@ inline void load(
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_set<
|
||||
Key, HashFcn, EqualKey, Allocator
|
||||
>,
|
||||
boost::serialization::stl::archive_input_unique<
|
||||
boost::serialization::stl::archive_input_set<
|
||||
Archive,
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_set<
|
||||
Key, HashFcn, EqualKey, Allocator
|
||||
@@ -138,7 +138,7 @@ inline void load(
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
|
||||
Key, HashFcn, EqualKey, Allocator
|
||||
>,
|
||||
boost::serialization::stl::archive_input_multi<
|
||||
boost::serialization::stl::archive_input_multiset<
|
||||
Archive,
|
||||
BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<
|
||||
Key, HashFcn, EqualKey, Allocator
|
||||
|
||||
@@ -50,7 +50,7 @@ inline void load(
|
||||
boost::serialization::stl::load_collection<
|
||||
Archive,
|
||||
std::map<Key, Type, Compare, Allocator>,
|
||||
boost::serialization::stl::archive_input_unique<
|
||||
boost::serialization::stl::archive_input_map<
|
||||
Archive, std::map<Key, Type, Compare, Allocator> >,
|
||||
boost::serialization::stl::no_reserve_imp<std::map<
|
||||
Key, Type, Compare, Allocator
|
||||
@@ -92,7 +92,7 @@ inline void load(
|
||||
boost::serialization::stl::load_collection<
|
||||
Archive,
|
||||
std::multimap<Key, Type, Compare, Allocator>,
|
||||
boost::serialization::stl::archive_input_multi<
|
||||
boost::serialization::stl::archive_input_multimap<
|
||||
Archive, std::multimap<Key, Type, Compare, Allocator>
|
||||
>,
|
||||
boost::serialization::stl::no_reserve_imp<
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user