mirror of
https://github.com/boostorg/serialization.git
synced 2026-07-21 13:33:32 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e3dbf04d3 | |||
| fd4a394159 | |||
| ada0172801 | |||
| ba2c05cfa9 |
@@ -112,6 +112,26 @@ way the data are rendered <a href="serialization.html">serializable</a>.
|
||||
might be conditioned on the library version to make sure that libraries created by
|
||||
previous versions of the library can still be read.
|
||||
</dd>
|
||||
<dt><h4><code>
|
||||
sa.get_helper<Helper>()
|
||||
<br>
|
||||
sa.get_helper(u)
|
||||
</code></h4></dt>
|
||||
<dd>
|
||||
The first time <code style="white-space: normal">sa.get_helper<Helper>()</code>
|
||||
is invoked for a given <code style="white-space: normal">sa</code> with a particular copyable type
|
||||
<code style="white-space: normal">Helper</code>, a default-constructed
|
||||
<code style="white-space: normal">Helper</code> object is created, attached to
|
||||
<code style="white-space: normal">sa</code> and a reference to it is returned. Subsequent
|
||||
invocations of <code style="white-space: normal">sa.get_helper<Helper>()</code> return
|
||||
a reference to the formerly constructed object. All objects created in this manner are
|
||||
destroyed upon <code style="white-space: normal">sa</code> destruction time. The purpose
|
||||
of helper objects is discussed in
|
||||
<a href="special.html#helpersupport">Special Considerations - Helper Support</a>.
|
||||
The second syntax is included to permit this function to be called on non-conforming
|
||||
compilers when <code style="white-space: normal">sa</code> is a template argument.
|
||||
For more information, see <a target="detail" href="implementation.html#tempatesyntax">Template Invocation syntax</a>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4><a name="loading_interface">Loading Archive Concept</a></h4>
|
||||
@@ -182,6 +202,26 @@ equivalent to the original.
|
||||
The code that loads collections might be conditioned on the library version to make
|
||||
sure that libraries created by previous versions of the library can still be read.
|
||||
</dd>
|
||||
<dt><h4><code>
|
||||
la.get_helper<Helper>()
|
||||
<br>
|
||||
la.get_helper(u)
|
||||
</code></h4></dt>
|
||||
<dd>
|
||||
The first time <code style="white-space: normal">la.get_helper<Helper>()</code>
|
||||
is invoked for a given <code style="white-space: normal">la</code> with a particular copyable type
|
||||
<code style="white-space: normal">Helper</code>, a default-constructed
|
||||
<code style="white-space: normal">Helper</code> object is created, attached to
|
||||
<code style="white-space: normal">la</code> and a reference to it is returned. Subsequent
|
||||
invocations of <code style="white-space: normal">la.get_helper<Helper>()</code> return
|
||||
a reference to the formerly constructed object. All objects created in this manner are
|
||||
destroyed upon <code style="white-space: normal">la</code> destruction time. The purpose
|
||||
of helper objects is discussed in
|
||||
<a href="special.html#helpersupport">Special Considerations - Helper Support</a>.
|
||||
The second syntax is included to permit this function to be called on non-conforming
|
||||
compilers when <code style="white-space: normal">la</code> is a template argument.
|
||||
For more information, see <a target="detail" href="implementation.html#tempatesyntax">Template Invocation syntax</a>
|
||||
</dd>
|
||||
<dt><h4><code>
|
||||
la.reset_object_address(v, u)
|
||||
</code></h4></dt>
|
||||
|
||||
@@ -182,6 +182,7 @@ function initialize() {
|
||||
<dd><div id="special_detail"><dl class="page-index">
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="special.html#objecttracking">Object Tracking</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="special.html#classinfo">Class Information</a>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="special.html#helpersupport">Helper Support</a>
|
||||
<dt><img style="display:none" src="plus.gif" id="portability"><a target="detail" href="special.html#portability">Archive Portability</a>
|
||||
<dd><div id="portability_detail"><dl class="page-index">
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="special.html#numerics">Numerics</a>
|
||||
|
||||
@@ -197,6 +197,16 @@ void register_type(T * t = NULL);
|
||||
</code></pre>
|
||||
so that one may write <code style="white-space: normal">ar.register_type(static_cast<T *>(NULL))</code> instead of
|
||||
the syntax described above.
|
||||
<p>
|
||||
Similarly, the expression
|
||||
<pre><code>
|
||||
ar.template get_helper<Helper>();
|
||||
</code></pre>
|
||||
that recovers a helper object of type <code>Helper</code> might pose problems,
|
||||
in which case the following alternative syntax can be used:
|
||||
<pre><code>
|
||||
ar.get_helper(static_cast<Helper *>(NULL));
|
||||
</code></pre>
|
||||
</ul>
|
||||
<h3><a name="othercompilerissues">Specific Compiler/Library Issues</a></h3>
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
<dl class="page-index">
|
||||
<dt><a href="#objecttracking">Object Tracking</a>
|
||||
<dt><a href="#classinfo">Class Information</a>
|
||||
<dt><a href="#helpersupport">Helper Support</a>
|
||||
<dt><a href="#portability">Archive Portability</a>
|
||||
<dl class="page-index">
|
||||
<dt><a href="#numerics">Numerics</a>
|
||||
@@ -202,6 +203,65 @@ BOOST_CLASS_IMPLEMENTATION(pixel, boost::serialization::object_serializable);
|
||||
BOOST_CLASS_TRACKING(pixel, boost::serialization::track_never)
|
||||
</code></pre>
|
||||
|
||||
<h3><a name="helpersupport">Helper Support</a></h3>
|
||||
Some types, specially those with complicated lifetime behavior or limited
|
||||
access to their internal state, might need or benefit from elaborate serialization
|
||||
algorithms. In these cases, it can be advantageous to have a <i>helper object</i>
|
||||
associated to the current archive that can be used to store contextual
|
||||
information relevant to the particular type serialization algorithm.
|
||||
|
||||
<pre><code>
|
||||
class complex_type
|
||||
{
|
||||
...
|
||||
};
|
||||
|
||||
BOOST_SERIALIZATION_SPLIT_FREE(complex_type)
|
||||
|
||||
class complex_type_serialization_helper
|
||||
{
|
||||
// maintain contextual information for complex_type
|
||||
// serialization algorithm
|
||||
};
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
|
||||
template<class Archive>
|
||||
void save(Archive & ar, const complex_type & x, unsigned int /* version */)
|
||||
{
|
||||
complex_type_serialization_helper & hlp =
|
||||
ar.template get_helper<complex_type_serialization_helper>();
|
||||
|
||||
// implement complex_type save algorithm with the aid of hlp
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void load(Archive & ar, complex_type & x, unsigned int /* version */)
|
||||
{
|
||||
complex_type_serialization_helper & hlp =
|
||||
ar.template get_helper<complex_type_serialization_helper>();
|
||||
|
||||
// implement complex_type load algorithm with the aid of hlp
|
||||
}
|
||||
|
||||
} // namespace serialization
|
||||
} // namespace boost
|
||||
</code></pre>
|
||||
<code style="white-space: normal">get_helper<complex_type_serialization_helper>();</code>
|
||||
creates a helper object associated to the archive the first time it is invoked;
|
||||
subsequent invocations return a reference to the object created in the first
|
||||
place, so that <code style="white-space: normal">hlp</code> can effectively be
|
||||
used to store contextual information persisting through the serialization
|
||||
of different <code style="white-space: normal">complex_type</code> objects on
|
||||
the same archive.
|
||||
Although the example code does not show it, the helper types used for saving and loading
|
||||
can be different. A notable example of a type whose serialization routines use helper support
|
||||
is <code style="white-space: normal">boost::shared_ptr</code>. The test
|
||||
program <a href="../test/test_helper_support.cpp" target="test_helper_support_cpp"><code style="white-space: normal">test_helper_support.cpp</code></a>
|
||||
shows how to use helper support to implement a serialization algorithm
|
||||
for a string type that avoids emitting duplicate contents.
|
||||
|
||||
<h3><a name="portability">Archive Portability</a></h3>
|
||||
Several archive classes create their data in the form of text or portable a binary format.
|
||||
It should be possible to save such an of such a class on one platform and load it on another.
|
||||
|
||||
@@ -36,20 +36,22 @@ class fast_binary_oarchive :
|
||||
public binary_oarchive_impl<
|
||||
fast_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
std::ostream::traits_type,
|
||||
true // helper support
|
||||
>
|
||||
{
|
||||
typedef fast_binary_oarchive derived_t;
|
||||
typedef binary_oarchive_impl<
|
||||
fast_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
std::ostream::traits_type,
|
||||
true
|
||||
> base_t;
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class boost::archive::detail::interface_oarchive<derived_t>;
|
||||
friend class basic_binary_oarchive<derived_t>;
|
||||
friend class boost::archive::detail::interface_oarchive<derived_t, true>;
|
||||
friend class basic_binary_oarchive<derived_t, true>;
|
||||
friend class basic_binary_oprimitive<
|
||||
derived_t,
|
||||
std::ostream::char_type,
|
||||
@@ -101,20 +103,22 @@ class fast_binary_iarchive :
|
||||
public binary_iarchive_impl<
|
||||
fast_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
std::istream::traits_type,
|
||||
true // helper support
|
||||
>
|
||||
{
|
||||
typedef fast_binary_iarchive derived_t;
|
||||
typedef binary_iarchive_impl<
|
||||
fast_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
std::istream::traits_type,
|
||||
true
|
||||
> base_t;
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class boost::archive::detail::interface_iarchive<derived_t>;
|
||||
friend class basic_binary_iarchive<derived_t>;
|
||||
friend class boost::archive::detail::interface_iarchive<derived_t, true>;
|
||||
friend class basic_binary_iarchive<derived_t, true>;
|
||||
friend class basic_binary_iprimitive<
|
||||
derived_t,
|
||||
std::ostream::char_type,
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
#include <boost/archive/basic_binary_iprimitive.hpp>
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
#include <boost/archive/detail/register_archive.hpp>
|
||||
|
||||
#include "portable_binary_archive.hpp"
|
||||
@@ -69,8 +68,6 @@ class portable_binary_iarchive :
|
||||
public boost::archive::detail::common_iarchive<
|
||||
portable_binary_iarchive
|
||||
>
|
||||
,
|
||||
public boost::archive::detail::shared_ptr_helper
|
||||
{
|
||||
typedef boost::archive::basic_binary_iprimitive<
|
||||
portable_binary_iarchive,
|
||||
@@ -86,7 +83,8 @@ public:
|
||||
friend archive_base_t;
|
||||
friend primitive_base_t; // since with override load below
|
||||
friend class boost::archive::detail::interface_iarchive<
|
||||
portable_binary_iarchive
|
||||
portable_binary_iarchive,
|
||||
true // helper support
|
||||
>;
|
||||
friend class boost::archive::load_access;
|
||||
protected:
|
||||
|
||||
@@ -84,7 +84,8 @@ public:
|
||||
friend archive_base_t;
|
||||
friend primitive_base_t; // since with override save below
|
||||
friend class boost::archive::detail::interface_oarchive<
|
||||
portable_binary_oarchive
|
||||
portable_binary_oarchive,
|
||||
true // helper support
|
||||
>;
|
||||
friend class boost::archive::save_access;
|
||||
protected:
|
||||
|
||||
@@ -38,9 +38,9 @@ namespace archive {
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_binary_iarchive - read serialized objects from a input binary stream
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class basic_binary_iarchive :
|
||||
public detail::common_iarchive<Archive>
|
||||
public detail::common_iarchive<Archive, HelperSupport>
|
||||
{
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
@@ -48,15 +48,15 @@ public:
|
||||
#elif defined(BOOST_MSVC)
|
||||
// for some inexplicable reason insertion of "class" generates compile erro
|
||||
// on msvc 7.1
|
||||
friend detail::interface_iarchive<Archive>;
|
||||
friend detail::interface_iarchive<Archive, HelperSupport>;
|
||||
#else
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class detail::interface_iarchive<Archive, HelperSupport>;
|
||||
#endif
|
||||
// intermediate level to support override of operators
|
||||
// fot templates in the absence of partial function
|
||||
// template ordering. If we get here pass to base class
|
||||
// note extra nonsense to sneak it pass the borland compiers
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
typedef detail::common_iarchive<Archive, HelperSupport> detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int version){
|
||||
this->detail_common_iarchive::load_override(t, static_cast<int>(version));
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
init();
|
||||
|
||||
basic_binary_iarchive(unsigned int flags) :
|
||||
detail::common_iarchive<Archive>(flags)
|
||||
detail::common_iarchive<Archive, HelperSupport>(flags)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ namespace archive {
|
||||
// by a program built with the same tools for the same machne. This class
|
||||
// does have the virtue of buiding the smalles archive in the minimum amount
|
||||
// of time. So under some circumstances it may be he right choice.
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class basic_binary_oarchive :
|
||||
public archive::detail::common_oarchive<Archive>
|
||||
public archive::detail::common_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
@@ -52,12 +52,12 @@ public:
|
||||
#elif defined(BOOST_MSVC)
|
||||
// for some inexplicable reason insertion of "class" generates compile erro
|
||||
// on msvc 7.1
|
||||
friend detail::interface_oarchive<Archive>;
|
||||
friend detail::interface_oarchive<Archive, HelperSupport>;
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
#endif
|
||||
// any datatype not specifed below will be handled by base class
|
||||
typedef detail::common_oarchive<Archive> detail_common_oarchive;
|
||||
typedef detail::common_oarchive<Archive, HelperSupport> detail_common_oarchive;
|
||||
template<class T>
|
||||
void save_override(const T & t, BOOST_PFTO int version){
|
||||
this->detail_common_oarchive::save_override(t, static_cast<int>(version));
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
init();
|
||||
|
||||
basic_binary_oarchive(unsigned int flags) :
|
||||
detail::common_oarchive<Archive>(flags)
|
||||
detail::common_oarchive<Archive, HelperSupport>(flags)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ namespace archive {
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_text_iarchive - read serialized objects from a input text stream
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class basic_text_iarchive :
|
||||
public detail::common_iarchive<Archive>
|
||||
public detail::common_iarchive<Archive, HelperSupport>
|
||||
{
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
@@ -48,14 +48,14 @@ public:
|
||||
#elif defined(BOOST_MSVC)
|
||||
// for some inexplicable reason insertion of "class" generates compile erro
|
||||
// on msvc 7.1
|
||||
friend detail::interface_iarchive<Archive>;
|
||||
friend detail::interface_iarchive<Archive, HelperSupport>;
|
||||
#else
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class detail::interface_iarchive<Archive, HelperSupport>;
|
||||
#endif
|
||||
// intermediate level to support override of operators
|
||||
// fot templates in the absence of partial function
|
||||
// template ordering
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
typedef detail::common_iarchive<Archive, HelperSupport> detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int)
|
||||
{
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
init(void);
|
||||
|
||||
basic_text_iarchive(unsigned int flags) :
|
||||
detail::common_iarchive<Archive>(flags)
|
||||
detail::common_iarchive<Archive, HelperSupport>(flags)
|
||||
{}
|
||||
~basic_text_iarchive(){}
|
||||
};
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace archive {
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_text_oarchive
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class basic_text_oarchive :
|
||||
public detail::common_oarchive<Archive>
|
||||
public detail::common_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|
||||
@@ -50,9 +50,9 @@ public:
|
||||
#elif defined(BOOST_MSVC)
|
||||
// for some inexplicable reason insertion of "class" generates compile erro
|
||||
// on msvc 7.1
|
||||
friend detail::interface_oarchive<Archive>;
|
||||
friend detail::interface_oarchive<Archive, HelperSupport>;
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
#endif
|
||||
enum {
|
||||
none,
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
// default processing - kick back to base class. Note the
|
||||
// extra stuff to get it passed borland compilers
|
||||
typedef detail::common_oarchive<Archive> detail_common_oarchive;
|
||||
typedef detail::common_oarchive<Archive, HelperSupport> detail_common_oarchive;
|
||||
template<class T>
|
||||
void save_override(T & t, BOOST_PFTO int){
|
||||
this->detail_common_oarchive::save_override(t, 0);
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
init();
|
||||
|
||||
basic_text_oarchive(unsigned int flags) :
|
||||
detail::common_oarchive<Archive>(flags),
|
||||
detail::common_oarchive<Archive, HelperSupport>(flags),
|
||||
delimiter(none)
|
||||
{}
|
||||
~basic_text_oarchive(){}
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace archive {
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class xml_iarchive - read serialized objects from a input text stream
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class basic_xml_iarchive :
|
||||
public detail::common_iarchive<Archive>
|
||||
public detail::common_iarchive<Archive, HelperSupport>
|
||||
{
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
@@ -44,9 +44,9 @@ public:
|
||||
#elif defined(BOOST_MSVC)
|
||||
// for some inexplicable reason insertion of "class" generates compile erro
|
||||
// on msvc 7.1
|
||||
friend detail::interface_oarchive<Archive>;
|
||||
friend detail::interface_oarchive<Archive, HelperSupport>;
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
#endif
|
||||
unsigned int depth;
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
// Anything not an attribute - see below - should be a name value
|
||||
// pair and be processed here
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
typedef detail::common_iarchive<Archive, HelperSupport> detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace archive {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// class basic_xml_oarchive - write serialized objects to a xml output stream
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class basic_xml_oarchive :
|
||||
public detail::common_oarchive<Archive>
|
||||
public detail::common_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
protected:
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
@@ -44,10 +44,10 @@ public:
|
||||
#elif defined(BOOST_MSVC)
|
||||
// for some inexplicable reason insertion of "class" generates compile erro
|
||||
// on msvc 7.1
|
||||
friend detail::interface_oarchive<Archive>;
|
||||
friend detail::interface_oarchive<Archive, HelperSupport>;
|
||||
friend class save_access;
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
friend class save_access;
|
||||
#endif
|
||||
// special stuff for xml output
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
}
|
||||
|
||||
// special treatment for name-value pairs.
|
||||
typedef detail::common_oarchive<Archive> detail_common_oarchive;
|
||||
typedef detail::common_oarchive<Archive, HelperSupport> detail_common_oarchive;
|
||||
template<class T>
|
||||
void save_override(
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
@@ -26,39 +26,34 @@ namespace archive {
|
||||
// via inhertance, derived from text_iarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as binary_iarchive below - without the shared_ptr_helper
|
||||
// same as binary_iarchive below - without helper support
|
||||
class naked_binary_iarchive :
|
||||
public binary_iarchive_impl<
|
||||
boost::archive::naked_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
std::istream::traits_type,
|
||||
false // no helper support
|
||||
>
|
||||
{
|
||||
public:
|
||||
naked_binary_iarchive(std::istream & is, unsigned int flags = 0) :
|
||||
binary_iarchive_impl<
|
||||
naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
|
||||
naked_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type,
|
||||
false
|
||||
>(is, flags)
|
||||
{}
|
||||
naked_binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
|
||||
binary_iarchive_impl<
|
||||
naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
|
||||
naked_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type,
|
||||
false
|
||||
>(bsb, flags)
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// note special treatment of shared_ptr. This type needs a special
|
||||
// structure associated with every archive. We created a "mix-in"
|
||||
// class to provide this functionality. Since shared_ptr holds a
|
||||
// special esteem in the boost library - we included it here by default.
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from binary_iarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
@@ -66,19 +61,25 @@ class binary_iarchive :
|
||||
public binary_iarchive_impl<
|
||||
boost::archive::binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
>,
|
||||
public detail::shared_ptr_helper
|
||||
std::istream::traits_type,
|
||||
true // helper support
|
||||
>
|
||||
{
|
||||
public:
|
||||
binary_iarchive(std::istream & is, unsigned int flags = 0) :
|
||||
binary_iarchive_impl<
|
||||
binary_iarchive, std::istream::char_type, std::istream::traits_type
|
||||
binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type,
|
||||
true
|
||||
>(is, flags)
|
||||
{}
|
||||
binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
|
||||
binary_iarchive_impl<
|
||||
binary_iarchive, std::istream::char_type, std::istream::traits_type
|
||||
binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type,
|
||||
true
|
||||
>(bsb, flags)
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -24,16 +24,16 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
template<class Archive, class Elem, class Tr, bool HelperSupport>
|
||||
class binary_iarchive_impl :
|
||||
public basic_binary_iprimitive<Archive, Elem, Tr>,
|
||||
public basic_binary_iarchive<Archive>
|
||||
public basic_binary_iarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class basic_binary_iarchive<Archive>;
|
||||
friend class detail::interface_iarchive<Archive, HelperSupport>;
|
||||
friend class basic_binary_iarchive<Archive, HelperSupport>;
|
||||
friend class load_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -42,16 +42,16 @@ protected:
|
||||
// make this protected so it can be called from a derived archive
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
this->basic_binary_iarchive<Archive>::load_override(t, 0L);
|
||||
this->basic_binary_iarchive<Archive, HelperSupport>::load_override(t, 0L);
|
||||
}
|
||||
void init(unsigned int flags){
|
||||
if(0 != (flags & no_header))
|
||||
return;
|
||||
#if ! defined(__MWERKS__)
|
||||
this->basic_binary_iarchive<Archive>::init();
|
||||
this->basic_binary_iarchive<Archive, HelperSupport>::init();
|
||||
this->basic_binary_iprimitive<Archive, Elem, Tr>::init();
|
||||
#else
|
||||
basic_binary_iarchive<Archive>::init();
|
||||
basic_binary_iarchive<Archive, HelperSupport>::init();
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::init();
|
||||
#endif
|
||||
}
|
||||
@@ -63,7 +63,7 @@ protected:
|
||||
bsb,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_binary_iarchive<Archive>(flags)
|
||||
basic_binary_iarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ protected:
|
||||
* is.rdbuf(),
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_binary_iarchive<Archive>(flags)
|
||||
basic_binary_iarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
|
||||
@@ -25,26 +25,62 @@ namespace archive {
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from binary_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as binary_oarchive below - without helper support
|
||||
class naked_binary_oarchive :
|
||||
public binary_oarchive_impl<
|
||||
naked_binary_oarchive ,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type,
|
||||
false // no helper_support
|
||||
>
|
||||
{
|
||||
public:
|
||||
naked_binary_oarchive(std::ostream & os, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
naked_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type,
|
||||
false
|
||||
>(os, flags)
|
||||
{}
|
||||
naked_binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
naked_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type,
|
||||
false
|
||||
>(bsb, flags)
|
||||
{}
|
||||
};
|
||||
|
||||
class binary_oarchive :
|
||||
public binary_oarchive_impl<
|
||||
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
|
||||
binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type,
|
||||
true // helper support
|
||||
>
|
||||
{
|
||||
public:
|
||||
binary_oarchive(std::ostream & os, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
|
||||
binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type,
|
||||
true
|
||||
>(os, flags)
|
||||
{}
|
||||
binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
|
||||
binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type,
|
||||
true
|
||||
>(bsb, flags)
|
||||
{}
|
||||
};
|
||||
|
||||
typedef binary_oarchive naked_binary_oarchive;
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -24,16 +24,16 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
template<class Archive, class Elem, class Tr, bool HelperSupport>
|
||||
class binary_oarchive_impl :
|
||||
public basic_binary_oprimitive<Archive, Elem, Tr>,
|
||||
public basic_binary_oarchive<Archive>
|
||||
public basic_binary_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class basic_binary_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
friend class basic_binary_oarchive<Archive, HelperSupport>;
|
||||
friend class save_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -42,13 +42,13 @@ protected:
|
||||
// make this protected so it can be called from a derived archive
|
||||
template<class T>
|
||||
void save_override(T & t, BOOST_PFTO int){
|
||||
this->basic_binary_oarchive<Archive>::save_override(t, 0L);
|
||||
this->basic_binary_oarchive<Archive, HelperSupport>::save_override(t, 0L);
|
||||
}
|
||||
void init(unsigned int flags) {
|
||||
if(0 != (flags & no_header))
|
||||
return;
|
||||
#if ! defined(__MWERKS__)
|
||||
this->basic_binary_oarchive<Archive>::init();
|
||||
this->basic_binary_oarchive<Archive, HelperSupport>::init();
|
||||
this->basic_binary_oprimitive<Archive, Elem, Tr>::init();
|
||||
#else
|
||||
basic_binary_oarchive<Archive>::init();
|
||||
@@ -63,7 +63,7 @@ protected:
|
||||
bsb,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_binary_oarchive<Archive>(flags)
|
||||
basic_binary_oarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ protected:
|
||||
* os.rdbuf(),
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_binary_oarchive<Archive>(flags)
|
||||
basic_binary_oarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
init(flags);
|
||||
}
|
||||
|
||||
@@ -27,12 +27,13 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
// same as binary_wiarchive below - without the shared_ptr_helper
|
||||
// same as binary_wiarchive below - without helper support
|
||||
class naked_binary_wiarchive :
|
||||
public binary_iarchive_impl<
|
||||
boost::archive::naked_binary_wiarchive,
|
||||
std::wistream::char_type,
|
||||
std::wistream::traits_type
|
||||
std::wistream::traits_type,
|
||||
false // no helper support
|
||||
>
|
||||
{
|
||||
public:
|
||||
@@ -40,44 +41,43 @@ public:
|
||||
binary_iarchive_impl<
|
||||
naked_binary_wiarchive,
|
||||
std::wistream::char_type,
|
||||
std::wistream::traits_type
|
||||
std::wistream::traits_type,
|
||||
false
|
||||
>(is, flags)
|
||||
{}
|
||||
naked_binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
|
||||
binary_iarchive_impl<
|
||||
naked_binary_wiarchive,
|
||||
std::wistream::char_type,
|
||||
std::wistream::traits_type
|
||||
std::wistream::traits_type,
|
||||
false
|
||||
>(bsb, flags)
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// note special treatment of shared_ptr. This type needs a special
|
||||
// structure associated with every archive. We created a "mix-in"
|
||||
// class to provide this functionality. Since shared_ptr holds a
|
||||
// special esteem in the boost library - we included it here by default.
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class binary_wiarchive :
|
||||
public binary_iarchive_impl<
|
||||
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
|
||||
binary_wiarchive,
|
||||
std::wistream::char_type,
|
||||
std::wistream::traits_type,
|
||||
true // helper support
|
||||
>
|
||||
{
|
||||
public:
|
||||
binary_wiarchive(std::wistream & is, unsigned int flags = 0) :
|
||||
binary_iarchive_impl<
|
||||
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
|
||||
binary_wiarchive,
|
||||
std::wistream::char_type,
|
||||
std::wistream::traits_type,
|
||||
true
|
||||
>(is, flags)
|
||||
{}
|
||||
binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
|
||||
binary_iarchive_impl<
|
||||
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
|
||||
binary_wiarchive,
|
||||
std::wistream::char_type,
|
||||
std::wistream::traits_type,
|
||||
true
|
||||
>(bsb, flags)
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -30,25 +30,64 @@ namespace archive {
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from binary_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class binary_woarchive :
|
||||
|
||||
// same as binary_iarchive below - without helper support
|
||||
class naked_binary_woarchive :
|
||||
public binary_oarchive_impl<
|
||||
binary_woarchive, std::wostream::char_type, std::wostream::traits_type
|
||||
>
|
||||
naked_binary_woarchive,
|
||||
std::wostream::char_type,
|
||||
std::wostream::traits_type,
|
||||
false // no helper support
|
||||
>
|
||||
{
|
||||
public:
|
||||
binary_woarchive(std::wostream & os, unsigned int flags = 0) :
|
||||
naked_binary_woarchive(std::wostream & os, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
binary_woarchive, std::wostream::char_type, std::wostream::traits_type
|
||||
naked_binary_woarchive,
|
||||
std::wostream::char_type,
|
||||
std::wostream::traits_type,
|
||||
false
|
||||
>(os, flags)
|
||||
{}
|
||||
binary_woarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
|
||||
naked_binary_woarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
binary_woarchive, std::wostream::char_type, std::wostream::traits_type
|
||||
naked_binary_woarchive,
|
||||
std::wostream::char_type,
|
||||
std::wostream::traits_type,
|
||||
false
|
||||
>(bsb, flags)
|
||||
{}
|
||||
};
|
||||
|
||||
typedef binary_woarchive naked_binary_woarchive;
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from binary_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class binary_woarchive :
|
||||
public binary_oarchive_impl<
|
||||
binary_woarchive,
|
||||
std::wostream::char_type,
|
||||
std::wostream::traits_type,
|
||||
true // helper support
|
||||
>
|
||||
{
|
||||
public:
|
||||
binary_woarchive(std::wostream & os, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
binary_woarchive,
|
||||
std::wostream::char_type,
|
||||
std::wostream::traits_type,
|
||||
true
|
||||
>(os, flags)
|
||||
{}
|
||||
binary_woarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
|
||||
binary_oarchive_impl<
|
||||
binary_woarchive,
|
||||
std::wostream::char_type,
|
||||
std::wostream::traits_type,
|
||||
true
|
||||
>(bsb, flags)
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
@@ -27,12 +27,12 @@ namespace archive {
|
||||
namespace detail {
|
||||
|
||||
// note: referred to as Curiously Recurring Template Patter (CRTP)
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport = true>
|
||||
class common_iarchive :
|
||||
public basic_iarchive,
|
||||
public interface_iarchive<Archive>
|
||||
public interface_iarchive<Archive, HelperSupport>
|
||||
{
|
||||
friend class interface_iarchive<Archive>;
|
||||
friend class interface_iarchive<Archive, HelperSupport>;
|
||||
private:
|
||||
virtual void vload(version_type & t){
|
||||
* this->This() >> t;
|
||||
@@ -65,7 +65,7 @@ protected:
|
||||
// default archive initialization
|
||||
common_iarchive(unsigned int flags = 0) :
|
||||
basic_iarchive(flags),
|
||||
interface_iarchive<Archive>()
|
||||
interface_iarchive<Archive, HelperSupport>()
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace archive {
|
||||
namespace detail {
|
||||
|
||||
// note: referred to as Curiously Recurring Template Patter (CRTP)
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport = true>
|
||||
class common_oarchive :
|
||||
public basic_oarchive,
|
||||
public interface_oarchive<Archive>
|
||||
public interface_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
friend class interface_oarchive<Archive>;
|
||||
friend class interface_oarchive<Archive, HelperSupport>;
|
||||
private:
|
||||
virtual void vsave(const version_type t){
|
||||
* this->This() << t;
|
||||
@@ -67,7 +67,7 @@ protected:
|
||||
void save_end(const char * /*name*/){}
|
||||
common_oarchive(unsigned int flags = 0) :
|
||||
basic_oarchive(flags),
|
||||
interface_oarchive<Archive>()
|
||||
interface_oarchive<Archive, HelperSupport>()
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
#ifndef BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP
|
||||
#define BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// helper_collection.hpp: archive support for run-time helpers
|
||||
|
||||
// (C) Copyright 2002-2008 Robert Ramey and Joaquin M Lopez Munoz
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstddef> // NULL
|
||||
#include <map>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class helper_collection
|
||||
{
|
||||
helper_collection(const helper_collection&); // non-copyable
|
||||
helper_collection& operator = (const helper_collection&); // non-copyable
|
||||
|
||||
typedef std::map<
|
||||
const boost::serialization::extended_type_info *,
|
||||
shared_ptr<void> > collection;
|
||||
typedef collection::value_type helper_value_type;
|
||||
typedef collection::iterator helper_iterator;
|
||||
|
||||
// dynamically allocated to minimize penalty when not used
|
||||
collection * m_helpers;
|
||||
|
||||
collection& helpers()
|
||||
{
|
||||
if(!m_helpers) m_helpers = new collection;
|
||||
return *m_helpers;
|
||||
};
|
||||
protected:
|
||||
helper_collection(): m_helpers(NULL){}
|
||||
~helper_collection()
|
||||
{
|
||||
delete m_helpers;
|
||||
}
|
||||
public:
|
||||
template<typename Helper>
|
||||
Helper& get_helper(Helper * = NULL)
|
||||
{
|
||||
const boost::serialization::extended_type_info * eti =
|
||||
&boost::serialization::type_info_implementation<Helper>::
|
||||
type::get_const_instance();
|
||||
helper_iterator it = helpers().find(eti);
|
||||
if(it == helpers().end())
|
||||
it = helpers().insert(
|
||||
helper_value_type(
|
||||
eti,
|
||||
shared_ptr<void>(new Helper))).first;
|
||||
return *static_cast<Helper *>(it->second.get());
|
||||
}
|
||||
};
|
||||
|
||||
// conditionally derive from helper_collection
|
||||
template<bool Derive>
|
||||
struct derive_from_helper_collection{};
|
||||
|
||||
template<>
|
||||
struct derive_from_helper_collection<true>: helper_collection{};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace serialization
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_ARCHIVE_DETAIL_HELPER_COLLECTION_HPP
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/detail/helper_collection.hpp>
|
||||
#include <boost/archive/detail/iserializer.hpp>
|
||||
#include <boost/serialization/singleton.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
@@ -30,8 +31,9 @@ namespace detail {
|
||||
|
||||
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
|
||||
|
||||
template<class Archive>
|
||||
class interface_iarchive
|
||||
template<class Archive, bool HelperSupport>
|
||||
class interface_iarchive :
|
||||
public derive_from_helper_collection<HelperSupport>
|
||||
{
|
||||
protected:
|
||||
interface_iarchive(){};
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/detail/helper_collection.hpp>
|
||||
#include <boost/archive/detail/oserializer.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
@@ -32,8 +33,9 @@ namespace detail {
|
||||
|
||||
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
|
||||
|
||||
template<class Archive>
|
||||
class interface_oarchive
|
||||
template<class Archive, bool HelperSupport>
|
||||
class interface_oarchive :
|
||||
public derive_from_helper_collection<HelperSupport>
|
||||
{
|
||||
protected:
|
||||
interface_oarchive(){};
|
||||
|
||||
@@ -28,9 +28,9 @@ namespace archive {
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// implementation of binary_binary_archive
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_binary_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
basic_binary_iarchive<Archive, HelperSupport>::load_override(class_name_type & t, int){
|
||||
std::string cn;
|
||||
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
|
||||
load_override(cn, 0);
|
||||
@@ -43,9 +43,9 @@ basic_binary_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
t.t[cn.size()] = '\0';
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_binary_iarchive<Archive>::init(){
|
||||
basic_binary_iarchive<Archive, HelperSupport>::init(){
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
* this->This() >> file_signature;
|
||||
|
||||
@@ -27,13 +27,13 @@ namespace archive {
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// implementation of binary_binary_oarchive
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
#if !defined(__BORLANDC__)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
basic_binary_oarchive<Archive>::init(){
|
||||
basic_binary_oarchive<Archive, HelperSupport>::init(){
|
||||
// write signature in an archive version independent manner
|
||||
const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
|
||||
* this->This() << file_signature;
|
||||
|
||||
@@ -28,9 +28,9 @@ namespace archive {
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// implementation of text_text_archive
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_text_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
basic_text_iarchive<Archive, HelperSupport>::load_override(class_name_type & t, int){
|
||||
std::string cn;
|
||||
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
|
||||
load_override(cn, 0);
|
||||
@@ -43,9 +43,9 @@ basic_text_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
t.t[cn.size()] = '\0';
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_text_iarchive<Archive>::init(void){
|
||||
basic_text_iarchive<Archive, HelperSupport>::init(void){
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
* this->This() >> file_signature;
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace archive {
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// implementation of basic_text_oarchive
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_text_oarchive<Archive>::newtoken()
|
||||
basic_text_oarchive<Archive, HelperSupport>::newtoken()
|
||||
{
|
||||
switch(delimiter){
|
||||
default:
|
||||
@@ -47,9 +47,9 @@ basic_text_oarchive<Archive>::newtoken()
|
||||
}
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_text_oarchive<Archive>::init(){
|
||||
basic_text_oarchive<Archive, HelperSupport>::init(){
|
||||
// write signature in an archive version independent manner
|
||||
const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
|
||||
* this->This() << file_signature;
|
||||
|
||||
@@ -23,9 +23,9 @@ namespace archive {
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// implementation of xml_text_archive
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_start(const char *name){
|
||||
basic_xml_iarchive<Archive, HelperSupport>::load_start(const char *name){
|
||||
// if there's no name
|
||||
if(NULL == name)
|
||||
return;
|
||||
@@ -40,9 +40,9 @@ basic_xml_iarchive<Archive>::load_start(const char *name){
|
||||
return;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_end(const char *name){
|
||||
basic_xml_iarchive<Archive, HelperSupport>::load_end(const char *name){
|
||||
// if there's no name
|
||||
if(NULL == name)
|
||||
return;
|
||||
@@ -73,39 +73,39 @@ basic_xml_iarchive<Archive>::load_end(const char *name){
|
||||
}
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_override(object_id_type & t, int){
|
||||
basic_xml_iarchive<Archive, HelperSupport>::load_override(object_id_type & t, int){
|
||||
t = this->This()->gimpl->rv.object_id;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_override(version_type & t, int){
|
||||
basic_xml_iarchive<Archive, HelperSupport>::load_override(version_type & t, int){
|
||||
t = this->This()->gimpl->rv.version;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_override(class_id_type & t, int){
|
||||
basic_xml_iarchive<Archive, HelperSupport>::load_override(class_id_type & t, int){
|
||||
t = this->This()->gimpl->rv.class_id;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_override(tracking_type & t, int){
|
||||
basic_xml_iarchive<Archive, HelperSupport>::load_override(tracking_type & t, int){
|
||||
t = this->This()->gimpl->rv.tracking_level;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
basic_xml_iarchive<Archive>::basic_xml_iarchive(unsigned int flags) :
|
||||
detail::common_iarchive<Archive>(flags),
|
||||
basic_xml_iarchive<Archive, HelperSupport>::basic_xml_iarchive(unsigned int flags) :
|
||||
detail::common_iarchive<Archive, HelperSupport>(flags),
|
||||
depth(0)
|
||||
{}
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
basic_xml_iarchive<Archive>::~basic_xml_iarchive(){}
|
||||
basic_xml_iarchive<Archive, HelperSupport>::~basic_xml_iarchive(){}
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
@@ -57,9 +57,9 @@ struct XML_name {
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// implemenations of functions common to both types of xml output
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::write_attribute(
|
||||
basic_xml_oarchive<Archive, HelperSupport>::write_attribute(
|
||||
const char *attribute_name,
|
||||
int t,
|
||||
const char *conjunction
|
||||
@@ -71,9 +71,9 @@ basic_xml_oarchive<Archive>::write_attribute(
|
||||
this->This()->put('"');
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::write_attribute(
|
||||
basic_xml_oarchive<Archive, HelperSupport>::write_attribute(
|
||||
const char *attribute_name,
|
||||
const char *key
|
||||
){
|
||||
@@ -84,17 +84,17 @@ basic_xml_oarchive<Archive>::write_attribute(
|
||||
this->This()->put('"');
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::indent(){
|
||||
basic_xml_oarchive<Archive, HelperSupport>::indent(){
|
||||
int i;
|
||||
for(i = depth; i-- > 0;)
|
||||
this->This()->put('\t');
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_start(const char *name)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_start(const char *name)
|
||||
{
|
||||
if(NULL == name)
|
||||
return;
|
||||
@@ -114,9 +114,9 @@ basic_xml_oarchive<Archive>::save_start(const char *name)
|
||||
indent_next = false;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_end(const char *name)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_end(const char *name)
|
||||
{
|
||||
if(NULL == name)
|
||||
return;
|
||||
@@ -138,90 +138,90 @@ basic_xml_oarchive<Archive>::save_end(const char *name)
|
||||
this->This()->put('\n');
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::end_preamble(){
|
||||
basic_xml_oarchive<Archive, HelperSupport>::end_preamble(){
|
||||
if(pending_preamble){
|
||||
this->This()->put('>');
|
||||
pending_preamble = false;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const object_id_type & t, int)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(const object_id_type & t, int)
|
||||
{
|
||||
int i = t.t; // extra .t is for borland
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(
|
||||
const object_reference_type & t,
|
||||
int
|
||||
){
|
||||
int i = t.t; // extra .t is for borland
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(const version_type & t, int)
|
||||
{
|
||||
int i = t.t; // extra .t is for borland
|
||||
write_attribute(VBOOST_ARCHIVE_XML_ERSION(), i);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const object_id_type & t, int)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(const object_id_type & t, int)
|
||||
{
|
||||
// borland doesn't do conversion of STRONG_TYPEDEFs very well
|
||||
const unsigned int i = t;
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(
|
||||
const object_reference_type & t,
|
||||
int
|
||||
){
|
||||
const unsigned int i = t;
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(const version_type & t, int)
|
||||
{
|
||||
const unsigned int i = t;
|
||||
write_attribute(BOOST_ARCHIVE_XML_VERSION(), i);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const class_id_type & t, int)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(const class_id_type & t, int)
|
||||
{
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(
|
||||
const class_id_reference_type & t,
|
||||
int
|
||||
){
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(
|
||||
const class_id_optional_type & t,
|
||||
int
|
||||
){
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const class_name_type & t, int)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(const class_name_type & t, int)
|
||||
{
|
||||
const char * key = t;
|
||||
if(NULL == key)
|
||||
@@ -229,16 +229,16 @@ basic_xml_oarchive<Archive>::save_override(const class_name_type & t, int)
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_NAME(), key);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const tracking_type & t, int)
|
||||
basic_xml_oarchive<Archive, HelperSupport>::save_override(const tracking_type & t, int)
|
||||
{
|
||||
write_attribute(BOOST_ARCHIVE_XML_TRACKING(), t.t);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::init(){
|
||||
basic_xml_oarchive<Archive, HelperSupport>::init(){
|
||||
// xml header
|
||||
this->This()->put("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n");
|
||||
this->This()->put("<!DOCTYPE boost_serialization>\n");
|
||||
@@ -249,19 +249,19 @@ basic_xml_oarchive<Archive>::init(){
|
||||
this->This()->put(">\n");
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
basic_xml_oarchive<Archive>::basic_xml_oarchive(unsigned int flags) :
|
||||
detail::common_oarchive<Archive>(flags),
|
||||
basic_xml_oarchive<Archive, HelperSupport>::basic_xml_oarchive(unsigned int flags) :
|
||||
detail::common_oarchive<Archive, HelperSupport>(flags),
|
||||
depth(0),
|
||||
indent_next(false),
|
||||
pending_preamble(false)
|
||||
{
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
basic_xml_oarchive<Archive>::~basic_xml_oarchive(){
|
||||
basic_xml_oarchive<Archive, HelperSupport>::~basic_xml_oarchive(){
|
||||
if(0 == (this->get_flags() & no_header)){
|
||||
BOOST_TRY{
|
||||
this->This()->put("</boost_serialization>\n");
|
||||
|
||||
@@ -27,9 +27,9 @@ namespace std{
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_iarchive_impl<Archive>::load(char *s)
|
||||
text_iarchive_impl<Archive, HelperSupport>::load(char *s)
|
||||
{
|
||||
std::size_t size;
|
||||
* this->This() >> size;
|
||||
@@ -40,9 +40,9 @@ text_iarchive_impl<Archive>::load(char *s)
|
||||
s[size] = '\0';
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_iarchive_impl<Archive>::load(std::string &s)
|
||||
text_iarchive_impl<Archive, HelperSupport>::load(std::string &s)
|
||||
{
|
||||
std::size_t size;
|
||||
* this->This() >> size;
|
||||
@@ -59,9 +59,9 @@ text_iarchive_impl<Archive>::load(std::string &s)
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_iarchive_impl<Archive>::load(wchar_t *ws)
|
||||
text_iarchive_impl<Archive, HelperSupport>::load(wchar_t *ws)
|
||||
{
|
||||
std::size_t size;
|
||||
* this->This() >> size;
|
||||
@@ -73,9 +73,9 @@ text_iarchive_impl<Archive>::load(wchar_t *ws)
|
||||
#endif // BOOST_NO_INTRINSIC_WCHAR_T
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_iarchive_impl<Archive>::load(std::wstring &ws)
|
||||
text_iarchive_impl<Archive, HelperSupport>::load(std::wstring &ws)
|
||||
{
|
||||
std::size_t size;
|
||||
* this->This() >> size;
|
||||
@@ -92,21 +92,21 @@ text_iarchive_impl<Archive>::load(std::wstring &ws)
|
||||
#endif // BOOST_NO_STD_WSTRING
|
||||
#endif // BOOST_NO_CWCHAR
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_iarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
basic_text_iarchive<Archive>::load_override(t, 0);
|
||||
text_iarchive_impl<Archive, HelperSupport>::load_override(class_name_type & t, int){
|
||||
basic_text_iarchive<Archive, HelperSupport>::load_override(t, 0);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_iarchive_impl<Archive>::init(){
|
||||
basic_text_iarchive<Archive>::init();
|
||||
text_iarchive_impl<Archive, HelperSupport>::init(){
|
||||
basic_text_iarchive<Archive, HelperSupport>::init();
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
text_iarchive_impl<Archive>::text_iarchive_impl(
|
||||
text_iarchive_impl<Archive, HelperSupport>::text_iarchive_impl(
|
||||
std::istream & is,
|
||||
unsigned int flags
|
||||
) :
|
||||
@@ -114,13 +114,13 @@ text_iarchive_impl<Archive>::text_iarchive_impl(
|
||||
is,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_text_iarchive<Archive>(flags)
|
||||
basic_text_iarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
if(0 == (flags & no_header))
|
||||
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
|
||||
this->init();
|
||||
#else
|
||||
this->basic_text_iarchive<Archive>::init();
|
||||
this->basic_text_iarchive<Archive, HelperSupport>::init();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ namespace archive {
|
||||
// implementation of basic_text_oprimitive overrides for the combination
|
||||
// of template parameters used to create a text_oprimitive
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_oarchive_impl<Archive>::save(const char * s)
|
||||
text_oarchive_impl<Archive, HelperSupport>::save(const char * s)
|
||||
{
|
||||
const std::size_t len = std::ostream::traits_type::length(s);
|
||||
*this->This() << len;
|
||||
@@ -47,9 +47,9 @@ text_oarchive_impl<Archive>::save(const char * s)
|
||||
os << s;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_oarchive_impl<Archive>::save(const std::string &s)
|
||||
text_oarchive_impl<Archive, HelperSupport>::save(const std::string &s)
|
||||
{
|
||||
const std::size_t size = s.size();
|
||||
*this->This() << size;
|
||||
@@ -59,9 +59,9 @@ text_oarchive_impl<Archive>::save(const std::string &s)
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_oarchive_impl<Archive>::save(const wchar_t * ws)
|
||||
text_oarchive_impl<Archive, HelperSupport>::save(const wchar_t * ws)
|
||||
{
|
||||
const std::size_t l = std::wcslen(ws);
|
||||
* this->This() << l;
|
||||
@@ -71,9 +71,9 @@ text_oarchive_impl<Archive>::save(const wchar_t * ws)
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_oarchive_impl<Archive>::save(const std::wstring &ws)
|
||||
text_oarchive_impl<Archive, HelperSupport>::save(const std::wstring &ws)
|
||||
{
|
||||
const std::size_t l = ws.size();
|
||||
* this->This() << l;
|
||||
@@ -83,9 +83,9 @@ text_oarchive_impl<Archive>::save(const std::wstring &ws)
|
||||
#endif
|
||||
#endif // BOOST_NO_CWCHAR
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
text_oarchive_impl<Archive>::text_oarchive_impl(
|
||||
text_oarchive_impl<Archive, HelperSupport>::text_oarchive_impl(
|
||||
std::ostream & os,
|
||||
unsigned int flags
|
||||
) :
|
||||
@@ -93,19 +93,19 @@ text_oarchive_impl<Archive>::text_oarchive_impl(
|
||||
os,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_text_oarchive<Archive>(flags)
|
||||
basic_text_oarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
if(0 == (flags & no_header))
|
||||
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
|
||||
this->init();
|
||||
#else
|
||||
this->basic_text_oarchive<Archive>::init();
|
||||
this->basic_text_oarchive<Archive, HelperSupport>::init();
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_oarchive_impl<Archive>::save_binary(const void *address, std::size_t count){
|
||||
text_oarchive_impl<Archive, HelperSupport>::save_binary(const void *address, std::size_t count){
|
||||
put('\n');
|
||||
this->end_preamble();
|
||||
#if ! defined(__MWERKS__)
|
||||
|
||||
@@ -28,9 +28,9 @@ namespace archive {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// implementation of wiprimtives functions
|
||||
//
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
text_wiarchive_impl<Archive>::load(char *s)
|
||||
text_wiarchive_impl<Archive, HelperSupport>::load(char *s)
|
||||
{
|
||||
std::size_t size;
|
||||
* this->This() >> size;
|
||||
@@ -42,9 +42,9 @@ text_wiarchive_impl<Archive>::load(char *s)
|
||||
*s = '\0';
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
text_wiarchive_impl<Archive>::load(std::string &s)
|
||||
text_wiarchive_impl<Archive, HelperSupport>::load(std::string &s)
|
||||
{
|
||||
std::size_t size;
|
||||
* this->This() >> size;
|
||||
@@ -62,9 +62,9 @@ text_wiarchive_impl<Archive>::load(std::string &s)
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
text_wiarchive_impl<Archive>::load(wchar_t *s)
|
||||
text_wiarchive_impl<Archive, HelperSupport>::load(wchar_t *s)
|
||||
{
|
||||
std::size_t size;
|
||||
* this->This() >> size;
|
||||
@@ -77,9 +77,9 @@ text_wiarchive_impl<Archive>::load(wchar_t *s)
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
text_wiarchive_impl<Archive>::load(std::wstring &ws)
|
||||
text_wiarchive_impl<Archive, HelperSupport>::load(std::wstring &ws)
|
||||
{
|
||||
std::size_t size;
|
||||
* this->This() >> size;
|
||||
@@ -96,9 +96,9 @@ text_wiarchive_impl<Archive>::load(std::wstring &ws)
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
text_wiarchive_impl<Archive>::text_wiarchive_impl(
|
||||
text_wiarchive_impl<Archive, HelperSupport>::text_wiarchive_impl(
|
||||
std::wistream & is,
|
||||
unsigned int flags
|
||||
) :
|
||||
@@ -106,10 +106,10 @@ text_wiarchive_impl<Archive>::text_wiarchive_impl(
|
||||
is,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_text_iarchive<Archive>(flags)
|
||||
basic_text_iarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
if(0 == (flags & no_header))
|
||||
basic_text_iarchive<Archive>::init();
|
||||
basic_text_iarchive<Archive, HelperSupport>::init();
|
||||
}
|
||||
|
||||
} // archive
|
||||
|
||||
@@ -30,9 +30,9 @@ namespace archive {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// implementation of woarchive functions
|
||||
//
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
text_woarchive_impl<Archive>::save(const char *s)
|
||||
text_woarchive_impl<Archive, HelperSupport>::save(const char *s)
|
||||
{
|
||||
// note: superfluous local variable fixes borland warning
|
||||
const std::size_t size = std::strlen(s);
|
||||
@@ -42,9 +42,9 @@ text_woarchive_impl<Archive>::save(const char *s)
|
||||
os.put(os.widen(*s++));
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
text_woarchive_impl<Archive>::save(const std::string &s)
|
||||
text_woarchive_impl<Archive, HelperSupport>::save(const std::string &s)
|
||||
{
|
||||
const std::size_t size = s.size();
|
||||
* this->This() << size;
|
||||
@@ -55,9 +55,9 @@ text_woarchive_impl<Archive>::save(const std::string &s)
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
text_woarchive_impl<Archive>::save(const wchar_t *ws)
|
||||
text_woarchive_impl<Archive, HelperSupport>::save(const wchar_t *ws)
|
||||
{
|
||||
const std::size_t size = std::wostream::traits_type::length(ws);
|
||||
* this->This() << size;
|
||||
@@ -67,9 +67,9 @@ text_woarchive_impl<Archive>::save(const wchar_t *ws)
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
text_woarchive_impl<Archive>::save(const std::wstring &ws)
|
||||
text_woarchive_impl<Archive, HelperSupport>::save(const std::wstring &ws)
|
||||
{
|
||||
const std::size_t size = ws.length();
|
||||
* this->This() << size;
|
||||
|
||||
@@ -50,9 +50,9 @@ namespace archive {
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::load(std::wstring &ws){
|
||||
xml_iarchive_impl<Archive, HelperSupport>::load(std::wstring &ws){
|
||||
std::string s;
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
if(! result)
|
||||
@@ -84,9 +84,9 @@ xml_iarchive_impl<Archive>::load(std::wstring &ws){
|
||||
#endif // BOOST_NO_STD_WSTRING
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::load(wchar_t * ws){
|
||||
xml_iarchive_impl<Archive, HelperSupport>::load(wchar_t * ws){
|
||||
std::string s;
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
if(! result)
|
||||
@@ -116,9 +116,9 @@ xml_iarchive_impl<Archive>::load(wchar_t * ws){
|
||||
|
||||
#endif // BOOST_NO_CWCHAR
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::load(std::string &s){
|
||||
xml_iarchive_impl<Archive, HelperSupport>::load(std::string &s){
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
if(! result)
|
||||
boost::serialization::throw_exception(
|
||||
@@ -126,9 +126,9 @@ xml_iarchive_impl<Archive>::load(std::string &s){
|
||||
);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::load(char * s){
|
||||
xml_iarchive_impl<Archive, HelperSupport>::load(char * s){
|
||||
std::string tstring;
|
||||
bool result = gimpl->parse_string(is, tstring);
|
||||
if(! result)
|
||||
@@ -139,9 +139,9 @@ xml_iarchive_impl<Archive>::load(char * s){
|
||||
s[tstring.size()] = 0;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
xml_iarchive_impl<Archive, HelperSupport>::load_override(class_name_type & t, int){
|
||||
const std::string & s = gimpl->rv.class_name;
|
||||
if(s.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
|
||||
boost::serialization::throw_exception(
|
||||
@@ -152,16 +152,16 @@ xml_iarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
tptr[s.size()] = '\0';
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::init(){
|
||||
xml_iarchive_impl<Archive, HelperSupport>::init(){
|
||||
gimpl->init(is);
|
||||
this->set_library_version(gimpl->rv.version);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
xml_iarchive_impl<Archive>::xml_iarchive_impl(
|
||||
xml_iarchive_impl<Archive, HelperSupport>::xml_iarchive_impl(
|
||||
std::istream &is_,
|
||||
unsigned int flags
|
||||
) :
|
||||
@@ -169,7 +169,7 @@ xml_iarchive_impl<Archive>::xml_iarchive_impl(
|
||||
is_,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_xml_iarchive<Archive>(flags),
|
||||
basic_xml_iarchive<Archive, HelperSupport>(flags),
|
||||
gimpl(new xml_grammar())
|
||||
{
|
||||
if(0 == (flags & no_header)){
|
||||
@@ -186,9 +186,9 @@ xml_iarchive_impl<Archive>::xml_iarchive_impl(
|
||||
}
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
xml_iarchive_impl<Archive>::~xml_iarchive_impl(){
|
||||
xml_iarchive_impl<Archive, HelperSupport>::~xml_iarchive_impl(){
|
||||
if(0 == (this->get_flags() & no_header)){
|
||||
BOOST_TRY{
|
||||
gimpl->windup(is);
|
||||
|
||||
@@ -49,9 +49,9 @@ void save_iterator(std::ostream &os, InputIterator begin, InputIterator end){
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_oarchive_impl<Archive>::save(const std::wstring & ws){
|
||||
xml_oarchive_impl<Archive, HelperSupport>::save(const std::wstring & ws){
|
||||
// at least one library doesn't typedef value_type for strings
|
||||
// so rather than using string directly make a pointer iterator out of it
|
||||
// save_iterator(os, ws.data(), ws.data() + std::wcslen(ws.data()));
|
||||
@@ -60,18 +60,18 @@ xml_oarchive_impl<Archive>::save(const std::wstring & ws){
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_oarchive_impl<Archive>::save(const wchar_t * ws){
|
||||
xml_oarchive_impl<Archive, HelperSupport>::save(const wchar_t * ws){
|
||||
save_iterator(os, ws, ws + std::wcslen(ws));
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // BOOST_NO_CWCHAR
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_oarchive_impl<Archive>::save(const std::string & s){
|
||||
xml_oarchive_impl<Archive, HelperSupport>::save(const std::string & s){
|
||||
// at least one library doesn't typedef value_type for strings
|
||||
// so rather than using string directly make a pointer iterator out of it
|
||||
typedef boost::archive::iterators::xml_escape<
|
||||
@@ -84,9 +84,9 @@ xml_oarchive_impl<Archive>::save(const std::string & s){
|
||||
);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_oarchive_impl<Archive>::save(const char * s){
|
||||
xml_oarchive_impl<Archive, HelperSupport>::save(const char * s){
|
||||
typedef boost::archive::iterators::xml_escape<
|
||||
const char *
|
||||
> xml_escape_translator;
|
||||
@@ -97,9 +97,9 @@ xml_oarchive_impl<Archive>::save(const char * s){
|
||||
);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
xml_oarchive_impl<Archive>::xml_oarchive_impl(
|
||||
xml_oarchive_impl<Archive, HelperSupport>::xml_oarchive_impl(
|
||||
std::ostream & os_,
|
||||
unsigned int flags
|
||||
) :
|
||||
@@ -107,7 +107,7 @@ xml_oarchive_impl<Archive>::xml_oarchive_impl(
|
||||
os_,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_xml_oarchive<Archive>(flags)
|
||||
basic_xml_oarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
if(0 == (flags & no_header))
|
||||
this->init();
|
||||
|
||||
@@ -67,9 +67,9 @@ void copy_to_ptr(char * s, const std::wstring & ws){
|
||||
|
||||
} // anonymous
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::load(std::string & s){
|
||||
xml_wiarchive_impl<Archive, HelperSupport>::load(std::string & s){
|
||||
std::wstring ws;
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
if(! result)
|
||||
@@ -93,9 +93,9 @@ xml_wiarchive_impl<Archive>::load(std::string & s){
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::load(std::wstring & ws){
|
||||
xml_wiarchive_impl<Archive, HelperSupport>::load(std::wstring & ws){
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
if(! result)
|
||||
boost::serialization::throw_exception(
|
||||
@@ -104,9 +104,9 @@ xml_wiarchive_impl<Archive>::load(std::wstring & ws){
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::load(char * s){
|
||||
xml_wiarchive_impl<Archive, HelperSupport>::load(char * s){
|
||||
std::wstring ws;
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
if(! result)
|
||||
@@ -117,9 +117,9 @@ xml_wiarchive_impl<Archive>::load(char * s){
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::load(wchar_t * ws){
|
||||
xml_wiarchive_impl<Archive, HelperSupport>::load(wchar_t * ws){
|
||||
std::wstring twstring;
|
||||
bool result = gimpl->parse_string(is, twstring);
|
||||
if(! result)
|
||||
@@ -131,9 +131,9 @@ xml_wiarchive_impl<Archive>::load(wchar_t * ws){
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
xml_wiarchive_impl<Archive, HelperSupport>::load_override(class_name_type & t, int){
|
||||
const std::wstring & ws = gimpl->rv.class_name;
|
||||
if(ws.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
|
||||
boost::serialization::throw_exception(
|
||||
@@ -142,16 +142,16 @@ xml_wiarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
copy_to_ptr(t, ws);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::init(){
|
||||
xml_wiarchive_impl<Archive, HelperSupport>::init(){
|
||||
gimpl->init(is);
|
||||
this->set_library_version(gimpl->rv.version);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
|
||||
xml_wiarchive_impl<Archive, HelperSupport>::xml_wiarchive_impl(
|
||||
std::wistream &is_,
|
||||
unsigned int flags
|
||||
) :
|
||||
@@ -159,7 +159,7 @@ xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
|
||||
is_,
|
||||
true // don't change the codecvt - use the one below
|
||||
),
|
||||
basic_xml_iarchive<Archive>(flags),
|
||||
basic_xml_iarchive<Archive, HelperSupport>(flags),
|
||||
gimpl(new xml_wgrammar())
|
||||
{
|
||||
if(0 == (flags & no_codecvt)){
|
||||
@@ -185,9 +185,9 @@ xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
|
||||
}
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
xml_wiarchive_impl<Archive>::~xml_wiarchive_impl(){
|
||||
xml_wiarchive_impl<Archive, HelperSupport>::~xml_wiarchive_impl(){
|
||||
if(0 == (this->get_flags() & no_header)){
|
||||
BOOST_TRY{
|
||||
gimpl->windup(is);
|
||||
|
||||
@@ -60,9 +60,9 @@ void save_iterator(std::wostream &os, InputIterator begin, InputIterator end){
|
||||
);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_woarchive_impl<Archive>::save(const std::string & s){
|
||||
xml_woarchive_impl<Archive, HelperSupport>::save(const std::string & s){
|
||||
// note: we don't use s.begin() and s.end() because dinkumware
|
||||
// doesn't have string::value_type defined. So use a wrapper
|
||||
// around these values to implement the definitions.
|
||||
@@ -72,9 +72,9 @@ xml_woarchive_impl<Archive>::save(const std::string & s){
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_woarchive_impl<Archive>::save(const std::wstring & ws){
|
||||
xml_woarchive_impl<Archive, HelperSupport>::save(const std::wstring & ws){
|
||||
#if 0
|
||||
typedef iterators::xml_escape<std::wstring::const_iterator> xmbtows;
|
||||
std::copy(
|
||||
@@ -92,16 +92,16 @@ xml_woarchive_impl<Archive>::save(const std::wstring & ws){
|
||||
}
|
||||
#endif //BOOST_NO_STD_WSTRING
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_woarchive_impl<Archive>::save(const char * s){
|
||||
xml_woarchive_impl<Archive, HelperSupport>::save(const char * s){
|
||||
save_iterator(os, s, s + std::strlen(s));
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_woarchive_impl<Archive>::save(const wchar_t * ws){
|
||||
xml_woarchive_impl<Archive, HelperSupport>::save(const wchar_t * ws){
|
||||
os << ws;
|
||||
typedef iterators::xml_escape<const wchar_t *> xmbtows;
|
||||
std::copy(
|
||||
@@ -112,9 +112,9 @@ xml_woarchive_impl<Archive>::save(const wchar_t * ws){
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
xml_woarchive_impl<Archive>::xml_woarchive_impl(
|
||||
xml_woarchive_impl<Archive, HelperSupport>::xml_woarchive_impl(
|
||||
std::wostream & os_,
|
||||
unsigned int flags
|
||||
) :
|
||||
@@ -122,7 +122,7 @@ xml_woarchive_impl<Archive>::xml_woarchive_impl(
|
||||
os_,
|
||||
true // don't change the codecvt - use the one below
|
||||
),
|
||||
basic_xml_oarchive<Archive>(flags)
|
||||
basic_xml_oarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
// Standard behavior is that imbue can be called
|
||||
// a) before output is invoked or
|
||||
|
||||
@@ -27,7 +27,8 @@ typedef detail::polymorphic_oarchive_route<
|
||||
binary_oarchive_impl<
|
||||
naked_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
std::ostream::traits_type,
|
||||
false // no helper support
|
||||
>
|
||||
> polymorphic_binary_oarchive;
|
||||
|
||||
|
||||
@@ -66,12 +66,12 @@ namespace detail {
|
||||
class polymorphic_iarchive;
|
||||
|
||||
class polymorphic_iarchive_impl :
|
||||
public detail::interface_iarchive<polymorphic_iarchive>
|
||||
public detail::interface_iarchive<polymorphic_iarchive, true /* helper support */>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_iarchive<polymorphic_iarchive>;
|
||||
friend class detail::interface_iarchive<polymorphic_iarchive, true>;
|
||||
friend class load_access;
|
||||
#endif
|
||||
// primitive types the only ones permitted by polymorphic archives
|
||||
@@ -162,18 +162,11 @@ public:
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// note special treatment of shared_ptr. This type needs a special
|
||||
// structure associated with every archive. We created a "mix-in"
|
||||
// class to provide this functionality. Since shared_ptr holds a
|
||||
// special esteem in the boost library - we included it here by default.
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class polymorphic_iarchive :
|
||||
public polymorphic_iarchive_impl,
|
||||
public detail::shared_ptr_helper
|
||||
public polymorphic_iarchive_impl
|
||||
{
|
||||
public:
|
||||
virtual ~polymorphic_iarchive(){};
|
||||
|
||||
@@ -65,12 +65,12 @@ namespace detail {
|
||||
class polymorphic_oarchive;
|
||||
|
||||
class polymorphic_oarchive_impl :
|
||||
public detail::interface_oarchive<polymorphic_oarchive>
|
||||
public detail::interface_oarchive<polymorphic_oarchive, true /* helper support */>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_oarchive<polymorphic_oarchive>;
|
||||
friend class detail::interface_oarchive<polymorphic_oarchive, true>;
|
||||
friend class save_access;
|
||||
#endif
|
||||
// primitive types the only ones permitted by polymorphic archives
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace boost {
|
||||
namespace archive {
|
||||
|
||||
typedef detail::polymorphic_oarchive_route<
|
||||
text_oarchive_impl<naked_text_oarchive>
|
||||
text_oarchive_impl<naked_text_oarchive, false /* no helper support */>
|
||||
> polymorphic_text_oarchive;
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -28,16 +28,16 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class text_iarchive_impl :
|
||||
public basic_text_iprimitive<std::istream>,
|
||||
public basic_text_iarchive<Archive>
|
||||
public basic_text_iarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class basic_text_iarchive<Archive>;
|
||||
friend class detail::interface_iarchive<Archive, HelperSupport>;
|
||||
friend class basic_text_iarchive<Archive, HelperSupport>;
|
||||
friend class load_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -62,7 +62,7 @@ protected:
|
||||
// make this protected so it can be called from a derived archive
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
basic_text_iarchive<Archive>::load_override(t, 0);
|
||||
basic_text_iarchive<Archive, HelperSupport>::load_override(t, 0);
|
||||
}
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
load_override(class_name_type & t, int);
|
||||
@@ -78,36 +78,23 @@ protected:
|
||||
// via inhertance, derived from text_iarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as text_iarchive below - without the shared_ptr_helper
|
||||
// same as text_iarchive below - without helper support
|
||||
class naked_text_iarchive :
|
||||
public text_iarchive_impl<naked_text_iarchive>
|
||||
public text_iarchive_impl<naked_text_iarchive, false /* no helper support*/>
|
||||
{
|
||||
public:
|
||||
naked_text_iarchive(std::istream & is, unsigned int flags = 0) :
|
||||
text_iarchive_impl<naked_text_iarchive>(is, flags)
|
||||
text_iarchive_impl<naked_text_iarchive, false>(is, flags)
|
||||
{}
|
||||
~naked_text_iarchive(){}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// note special treatment of shared_ptr. This type needs a special
|
||||
// structure associated with every archive. We created a "mix-in"
|
||||
// class to provide this functionality. Since shared_ptr holds a
|
||||
// special esteem in the boost library - we included it here by default.
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class text_iarchive :
|
||||
public text_iarchive_impl<text_iarchive>,
|
||||
public detail::shared_ptr_helper
|
||||
public text_iarchive_impl<text_iarchive, true /* helper support */>
|
||||
{
|
||||
public:
|
||||
text_iarchive(std::istream & is, unsigned int flags = 0) :
|
||||
text_iarchive_impl<text_iarchive>(is, flags)
|
||||
text_iarchive_impl<text_iarchive,true>(is, flags)
|
||||
{}
|
||||
~text_iarchive(){}
|
||||
};
|
||||
|
||||
@@ -35,16 +35,16 @@ namespace std{
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class text_oarchive_impl :
|
||||
/* protected ? */ public basic_text_oprimitive<std::ostream>,
|
||||
public basic_text_oarchive<Archive>
|
||||
public basic_text_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class basic_text_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
friend class basic_text_oarchive<Archive, HelperSupport>;
|
||||
friend class save_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -77,19 +77,30 @@ public:
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from text_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as text_oarchive below - without helper support
|
||||
class naked_text_oarchive :
|
||||
public text_oarchive_impl<naked_text_oarchive, false /* no helper support*/>
|
||||
{
|
||||
public:
|
||||
|
||||
naked_text_oarchive(std::ostream & os, unsigned int flags = 0) :
|
||||
text_oarchive_impl<naked_text_oarchive, false>(os, flags)
|
||||
{}
|
||||
~naked_text_oarchive(){}
|
||||
};
|
||||
|
||||
class text_oarchive :
|
||||
public text_oarchive_impl<text_oarchive>
|
||||
public text_oarchive_impl<text_oarchive, true /* helper support */>
|
||||
{
|
||||
public:
|
||||
|
||||
text_oarchive(std::ostream & os, unsigned int flags = 0) :
|
||||
text_oarchive_impl<text_oarchive>(os, flags)
|
||||
text_oarchive_impl<text_oarchive, true>(os, flags)
|
||||
{}
|
||||
~text_oarchive(){}
|
||||
};
|
||||
|
||||
typedef text_oarchive naked_text_oarchive;
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -32,16 +32,16 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class text_wiarchive_impl :
|
||||
public basic_text_iprimitive<std::wistream>,
|
||||
public basic_text_iarchive<Archive>
|
||||
public basic_text_iarchive<Archive,HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class basic_text_iarchive<Archive>;
|
||||
friend class detail::interface_iarchive<Archive, HelperSupport>;
|
||||
friend class basic_text_iarchive<Archive, HelperSupport>;
|
||||
friend class load_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -65,7 +65,7 @@ protected:
|
||||
// fails to compile one test (test_shared_ptr) without it !!!
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
basic_text_iarchive<Archive>::load_override(t, 0);
|
||||
basic_text_iarchive<Archive, HelperSupport>::load_override(t, 0);
|
||||
}
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
text_wiarchive_impl(std::wistream & is, unsigned int flags);
|
||||
@@ -76,36 +76,23 @@ protected:
|
||||
// via inhertance, derived from text_iarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as text_wiarchive below - without the shared_ptr_helper
|
||||
// same as text_wiarchive below - without helper support
|
||||
class naked_text_wiarchive :
|
||||
public text_wiarchive_impl<naked_text_wiarchive>
|
||||
public text_wiarchive_impl<naked_text_wiarchive, false /* no helper support */>
|
||||
{
|
||||
public:
|
||||
naked_text_wiarchive(std::wistream & is, unsigned int flags = 0) :
|
||||
text_wiarchive_impl<naked_text_wiarchive>(is, flags)
|
||||
text_wiarchive_impl<naked_text_wiarchive, false>(is, flags)
|
||||
{}
|
||||
~naked_text_wiarchive(){}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// note special treatment of shared_ptr. This type needs a special
|
||||
// structure associated with every archive. We created a "mix-in"
|
||||
// class to provide this functionality. Since shared_ptr holds a
|
||||
// special esteem in the boost library - we included it here by default.
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class text_wiarchive :
|
||||
public text_wiarchive_impl<text_wiarchive>,
|
||||
public detail::shared_ptr_helper
|
||||
public text_wiarchive_impl<text_wiarchive, true /* helper support */>
|
||||
{
|
||||
public:
|
||||
text_wiarchive(std::wistream & is, unsigned int flags = 0) :
|
||||
text_wiarchive_impl<text_wiarchive>(is, flags)
|
||||
text_wiarchive_impl<text_wiarchive,true >(is, flags)
|
||||
{}
|
||||
~text_wiarchive(){}
|
||||
};
|
||||
|
||||
@@ -40,16 +40,16 @@ namespace std{
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class text_woarchive_impl :
|
||||
public basic_text_oprimitive<std::wostream>,
|
||||
public basic_text_oarchive<Archive>
|
||||
public basic_text_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class basic_text_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
friend class basic_text_oarchive<Archive, HelperSupport>;
|
||||
friend class save_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -75,10 +75,10 @@ protected:
|
||||
os,
|
||||
0 != (flags & no_codecvt)
|
||||
),
|
||||
basic_text_oarchive<Archive>(flags)
|
||||
basic_text_oarchive<Archive, HelperSupport>(flags)
|
||||
{
|
||||
if(0 == (flags & no_header))
|
||||
basic_text_oarchive<Archive>::init();
|
||||
basic_text_oarchive<Archive, HelperSupport>::init();
|
||||
}
|
||||
public:
|
||||
void save_binary(const void *address, std::size_t count){
|
||||
@@ -104,18 +104,28 @@ public:
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from text_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as text_woarchive below - without helper support
|
||||
class naked_text_woarchive :
|
||||
public text_woarchive_impl<naked_text_woarchive, false /* no helper support*/>
|
||||
{
|
||||
public:
|
||||
naked_text_woarchive(std::wostream & os, unsigned int flags = 0) :
|
||||
text_woarchive_impl<naked_text_woarchive, false>(os, flags)
|
||||
{}
|
||||
~naked_text_woarchive(){}
|
||||
};
|
||||
|
||||
class text_woarchive :
|
||||
public text_woarchive_impl<text_woarchive>
|
||||
public text_woarchive_impl<text_woarchive, true /* helper support */>
|
||||
{
|
||||
public:
|
||||
text_woarchive(std::wostream & os, unsigned int flags = 0) :
|
||||
text_woarchive_impl<text_woarchive>(os, flags)
|
||||
text_woarchive_impl<text_woarchive, true>(os, flags)
|
||||
{}
|
||||
~text_woarchive(){}
|
||||
};
|
||||
|
||||
typedef text_woarchive naked_text_woarchive;
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -32,16 +32,16 @@ template<class CharType>
|
||||
class basic_xml_grammar;
|
||||
typedef basic_xml_grammar<char> xml_grammar;
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class xml_iarchive_impl :
|
||||
public basic_text_iprimitive<std::istream>,
|
||||
public basic_xml_iarchive<Archive>
|
||||
public basic_xml_iarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class basic_xml_iarchive<Archive>;
|
||||
friend class detail::interface_iarchive<Archive, HelperSupport>;
|
||||
friend class basic_xml_iarchive<Archive, HelperSupport>;
|
||||
friend class load_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -71,7 +71,7 @@ protected:
|
||||
#endif
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
basic_xml_iarchive<Archive>::load_override(t, 0);
|
||||
basic_xml_iarchive<Archive, HelperSupport>::load_override(t, 0);
|
||||
}
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
load_override(class_name_type & t, int);
|
||||
@@ -87,36 +87,23 @@ protected:
|
||||
// via inhertance, derived from text_iarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as xml_iarchive below - without the shared_ptr_helper
|
||||
// same as xml_iarchive below - without helper support
|
||||
class naked_xml_iarchive :
|
||||
public xml_iarchive_impl<naked_xml_iarchive>
|
||||
public xml_iarchive_impl<naked_xml_iarchive, false /* no helper support */>
|
||||
{
|
||||
public:
|
||||
naked_xml_iarchive(std::istream & is, unsigned int flags = 0) :
|
||||
xml_iarchive_impl<naked_xml_iarchive>(is, flags)
|
||||
xml_iarchive_impl<naked_xml_iarchive, false>(is, flags)
|
||||
{}
|
||||
~naked_xml_iarchive(){}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// note special treatment of shared_ptr. This type needs a special
|
||||
// structure associated with every archive. We created a "mix-in"
|
||||
// class to provide this functionality. Since shared_ptr holds a
|
||||
// special esteem in the boost library - we included it here by default.
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class xml_iarchive :
|
||||
public xml_iarchive_impl<xml_iarchive>,
|
||||
public detail::shared_ptr_helper
|
||||
public xml_iarchive_impl<xml_iarchive, true /* helper support */>
|
||||
{
|
||||
public:
|
||||
xml_iarchive(std::istream & is, unsigned int flags = 0) :
|
||||
xml_iarchive_impl<xml_iarchive>(is, flags)
|
||||
xml_iarchive_impl<xml_iarchive, true>(is, flags)
|
||||
{}
|
||||
~xml_iarchive(){};
|
||||
};
|
||||
|
||||
@@ -35,16 +35,16 @@ namespace std{
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class xml_oarchive_impl :
|
||||
public basic_text_oprimitive<std::ostream>,
|
||||
public basic_xml_oarchive<Archive>
|
||||
public basic_xml_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class basic_xml_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
friend class basic_xml_oarchive<Archive, HelperSupport>;
|
||||
friend class save_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -91,18 +91,28 @@ public:
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from xml_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as xml_oarchive below - without helper support
|
||||
class naked_xml_oarchive :
|
||||
public xml_oarchive_impl<naked_xml_oarchive, false /* helper support */>
|
||||
{
|
||||
public:
|
||||
naked_xml_oarchive(std::ostream & os, unsigned int flags = 0) :
|
||||
xml_oarchive_impl<naked_xml_oarchive, false>(os, flags)
|
||||
{}
|
||||
~naked_xml_oarchive(){}
|
||||
};
|
||||
|
||||
class xml_oarchive :
|
||||
public xml_oarchive_impl<xml_oarchive>
|
||||
public xml_oarchive_impl<xml_oarchive, true /* helper support*/>
|
||||
{
|
||||
public:
|
||||
xml_oarchive(std::ostream & os, unsigned int flags = 0) :
|
||||
xml_oarchive_impl<xml_oarchive>(os, flags)
|
||||
xml_oarchive_impl<xml_oarchive, true>(os, flags)
|
||||
{}
|
||||
~xml_oarchive(){}
|
||||
};
|
||||
|
||||
typedef xml_oarchive naked_xml_oarchive;
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -37,16 +37,16 @@ template<class CharType>
|
||||
class basic_xml_grammar;
|
||||
typedef basic_xml_grammar<wchar_t> xml_wgrammar;
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class xml_wiarchive_impl :
|
||||
public basic_text_iprimitive<std::wistream>,
|
||||
public basic_xml_iarchive<Archive>
|
||||
public basic_xml_iarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class basic_xml_iarchive<Archive>;
|
||||
friend class detail::interface_iarchive<Archive, HelperSupport>;
|
||||
friend class basic_xml_iarchive<Archive, HelperSupport>;
|
||||
friend class load_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -75,7 +75,7 @@ protected:
|
||||
#endif
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
basic_xml_iarchive<Archive>::load_override(t, 0);
|
||||
basic_xml_iarchive<Archive, HelperSupport>::load_override(t, 0);
|
||||
}
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
load_override(class_name_type & t, int);
|
||||
@@ -91,36 +91,23 @@ protected:
|
||||
// via inhertance, derived from xml_wiarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as xml_wiarchive below - without the shared_ptr_helper
|
||||
// same as xml_wiarchive below - without helper support
|
||||
class naked_xml_wiarchive :
|
||||
public xml_wiarchive_impl<naked_xml_wiarchive>
|
||||
public xml_wiarchive_impl<naked_xml_wiarchive, false /* helper support */>
|
||||
{
|
||||
public:
|
||||
naked_xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
|
||||
xml_wiarchive_impl<naked_xml_wiarchive>(is, flags)
|
||||
xml_wiarchive_impl<naked_xml_wiarchive, false>(is, flags)
|
||||
{}
|
||||
~naked_xml_wiarchive(){}
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// note special treatment of shared_ptr. This type needs a special
|
||||
// structure associated with every archive. We created a "mix-in"
|
||||
// class to provide this functionality. Since shared_ptr holds a
|
||||
// special esteem in the boost library - we included it here by default.
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class xml_wiarchive :
|
||||
public xml_wiarchive_impl<xml_wiarchive>,
|
||||
public detail::shared_ptr_helper
|
||||
public xml_wiarchive_impl<xml_wiarchive, true /* helper support*/>
|
||||
{
|
||||
public:
|
||||
xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
|
||||
xml_wiarchive_impl<xml_wiarchive>(is, flags)
|
||||
xml_wiarchive_impl<xml_wiarchive, true>(is, flags)
|
||||
{}
|
||||
~xml_wiarchive(){}
|
||||
};
|
||||
|
||||
@@ -47,16 +47,16 @@ BOOST_WARCHIVE_DECL(std::wostream &)
|
||||
operator<<(std::wostream &os, const char t);
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
template<class Archive, bool HelperSupport>
|
||||
class xml_woarchive_impl :
|
||||
public basic_text_oprimitive<std::wostream>,
|
||||
public basic_xml_oarchive<Archive>
|
||||
public basic_xml_oarchive<Archive, HelperSupport>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class detail::interface_oarchive<Archive>;
|
||||
friend class basic_xml_oarchive<Archive>;
|
||||
friend class detail::interface_oarchive<Archive, HelperSupport>;
|
||||
friend class basic_xml_oarchive<Archive, HelperSupport>;
|
||||
friend class save_access;
|
||||
protected:
|
||||
#endif
|
||||
@@ -105,18 +105,28 @@ public:
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from xml_woarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
|
||||
// same as xml_woarchive below - without helper support
|
||||
class naked_xml_woarchive :
|
||||
public xml_woarchive_impl<naked_xml_woarchive, false /* helper support */>
|
||||
{
|
||||
public:
|
||||
naked_xml_woarchive(std::wostream & os, unsigned int flags = 0) :
|
||||
xml_woarchive_impl<naked_xml_woarchive, false>(os, flags)
|
||||
{}
|
||||
~naked_xml_woarchive(){}
|
||||
};
|
||||
|
||||
class xml_woarchive :
|
||||
public xml_woarchive_impl<xml_woarchive>
|
||||
public xml_woarchive_impl<xml_woarchive, true /* helper support*/>
|
||||
{
|
||||
public:
|
||||
xml_woarchive(std::wostream & os, unsigned int flags = 0) :
|
||||
xml_woarchive_impl<xml_woarchive>(os, flags)
|
||||
xml_woarchive_impl<xml_woarchive, true>(os, flags)
|
||||
{}
|
||||
~xml_woarchive(){}
|
||||
};
|
||||
|
||||
typedef xml_woarchive naked_xml_woarchive;
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef BOOST_PFTO_HPP
|
||||
#define BOOST_PFTO_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#error "This header is deprecated. Please use: boost/serialization/pfto.hpp"
|
||||
|
||||
#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
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#endif // BOOST_PFTO_HPP
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <boost/serialization/shared_ptr_helper.hpp>
|
||||
#include <boost/serialization/split_free.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <boost/serialization/version.hpp>
|
||||
@@ -121,13 +122,13 @@ inline void load(
|
||||
// boost_132::detail::sp_counted_base_impl<T *, boost::checked_deleter<T> > *
|
||||
//>(NULL));
|
||||
ar.register_type(static_cast<
|
||||
boost_132::detail::sp_counted_base_impl<T *, boost::archive::detail::null_deleter > *
|
||||
boost_132::detail::sp_counted_base_impl<T *, boost::serialization::detail::null_deleter > *
|
||||
>(NULL));
|
||||
boost_132::shared_ptr<T> sp;
|
||||
ar >> boost::serialization::make_nvp("px", sp.px);
|
||||
ar >> boost::serialization::make_nvp("pn", sp.pn);
|
||||
// got to keep the sps around so the sp.pns don't disappear
|
||||
ar.append(sp);
|
||||
ar.template get_helper<boost::serialization::detail::shared_ptr_helper>().append(sp);
|
||||
r = sp.get();
|
||||
}
|
||||
else
|
||||
@@ -135,7 +136,7 @@ inline void load(
|
||||
{
|
||||
ar >> boost::serialization::make_nvp("px", r);
|
||||
}
|
||||
ar.reset(t,r);
|
||||
ar.template get_helper<boost::serialization::detail::shared_ptr_helper>().reset(t,r);
|
||||
}
|
||||
|
||||
template<class Archive, class T>
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
#ifndef BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
|
||||
#define BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// shared_ptr_helper.hpp: serialization for boost shared pointer
|
||||
|
||||
// (C) Copyright 2004-2008 Robert Ramey, Martin Ecker and Joaquin M Lopez Munoz
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <cstddef> // NULL
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/serialization/type_info_implementation.hpp>
|
||||
#include <boost/serialization/shared_ptr_132.hpp>
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
namespace boost_132 {
|
||||
template<class T> class shared_ptr;
|
||||
}
|
||||
namespace boost {
|
||||
|
||||
template<class T> class shared_ptr;
|
||||
|
||||
namespace serialization {
|
||||
|
||||
class extended_type_info;
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct null_deleter {
|
||||
void operator()(void const *) const {}
|
||||
};
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// a common class for holding various types of shared pointers
|
||||
|
||||
class shared_ptr_helper {
|
||||
typedef std::map<const void *, shared_ptr<void> > collection_type;
|
||||
typedef collection_type::const_iterator iterator_type;
|
||||
// list of shared_pointers create accessable by raw pointer. This
|
||||
// is used to "match up" shared pointers loaded at different
|
||||
// points in the archive.
|
||||
collection_type m_pointers;
|
||||
|
||||
// list of loaded pointers. This is used to be sure that the pointers
|
||||
// stay around long enough to be "matched" with other pointers loaded
|
||||
// by the same archive. These are created with a "null_deleter" so that
|
||||
// when this list is destroyed - the underlaying raw pointers are not
|
||||
// destroyed. This has to be done because the pointers are also held by
|
||||
// new system which is disjoint from this set. This is implemented
|
||||
// by a change in load_construct_data below. It makes this file suitable
|
||||
// only for loading pointers into a 1.33 or later boost system.
|
||||
std::list<boost_132::shared_ptr<void> > m_pointers_132;
|
||||
|
||||
// return a void pointer to the most derived type
|
||||
template<class T>
|
||||
const void * object_identifier(T * t) const {
|
||||
const boost::serialization::extended_type_info * true_type
|
||||
= boost::serialization::type_info_implementation<T>::type
|
||||
::get_const_instance().get_derived_extended_type_info(*t);
|
||||
// note:if this exception is thrown, be sure that derived pointer
|
||||
// is either registered or exported.
|
||||
if(NULL == true_type)
|
||||
boost::serialization::throw_exception(
|
||||
boost::archive::archive_exception(
|
||||
boost::archive::archive_exception::unregistered_class
|
||||
)
|
||||
);
|
||||
const boost::serialization::extended_type_info * this_type
|
||||
= & boost::serialization::type_info_implementation<T>::type
|
||||
::get_const_instance();
|
||||
const void * vp = void_downcast(
|
||||
*true_type,
|
||||
*this_type,
|
||||
static_cast<const void *>(t)
|
||||
);
|
||||
return vp;
|
||||
}
|
||||
public:
|
||||
template<class T>
|
||||
void reset(shared_ptr<T> & s, T * r){
|
||||
if(NULL == r){
|
||||
s.reset();
|
||||
return;
|
||||
}
|
||||
// get pointer to the most derived object. This is effectively
|
||||
// the object identifer
|
||||
const void * od = object_identifier(r);
|
||||
|
||||
iterator_type it = m_pointers.find(od);
|
||||
|
||||
if(it == m_pointers.end()){
|
||||
s.reset(r);
|
||||
m_pointers.insert(collection_type::value_type(od,s));
|
||||
}
|
||||
else{
|
||||
s = static_pointer_cast<T>((*it).second);
|
||||
}
|
||||
}
|
||||
void append(const boost_132::shared_ptr<void> & t){
|
||||
m_pointers_132.push_back(t);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace serialization
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
|
||||
@@ -24,8 +24,8 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
template<class Archive> class interface_oarchive;
|
||||
template<class Archive> class interface_iarchive;
|
||||
template<class Archive, bool HelperSupport> class interface_oarchive;
|
||||
template<class Archive, bool HelperSupport> class interface_iarchive;
|
||||
} // namespace detail
|
||||
} // namespace archive
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
template<class Archive> class interface_oarchive;
|
||||
template<class Archive> class interface_iarchive;
|
||||
template<class Archive, bool HelperSupport> class interface_oarchive;
|
||||
template<class Archive, bool HelperSupport> class interface_iarchive;
|
||||
} // namespace detail
|
||||
} // namespace archive
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef BOOST_SMART_CAST_HPP
|
||||
#define BOOST_SMART_CAST_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#error "This header is deprecated. Please use: boost/serialization/smart_cast.hpp"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
|
||||
# pragma message ("Warning: This header is deprecated. Please use: boost/serialization/smart_cast.hpp")
|
||||
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
|
||||
# warning "This header is deprecated. Please use: boost/serialization/smart_cast.hpp"
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/smart_cast.hpp>
|
||||
|
||||
#endif // BOOST_SMART_CAST_HPP
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef BOOST_STATE_SAVER_HPP
|
||||
#define BOOST_STATE_SAVER_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#error "This header is deprecated. Please use: boost/serialization/state_saver.hpp"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
|
||||
# pragma message ("Warning: This header is deprecated. Please use: boost/serialization/state_saver.hpp")
|
||||
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
|
||||
# warning "This header is deprecated. Please use: boost/serialization/state_saver.hpp"
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/state_saver.hpp>
|
||||
|
||||
#endif //BOOST_STATE_SAVER_HPP
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef BOOST_STATIC_WARNING_HPP
|
||||
#define BOOST_STATIC_WARNING_HPP
|
||||
|
||||
// (C) Copyright Robert Ramey 2003. Jonathan Turkanis 2004.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#error "This header is deprecated. Please use: boost/serialization/static_warning.hpp"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
|
||||
# pragma message ("Warning: This header is deprecated. Please use: boost/serialization/static_warning.hpp")
|
||||
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
|
||||
# warning "This header is deprecated. Please use: boost/serialization/static_warning.hpp"
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/static_warning.hpp>
|
||||
|
||||
#endif // BOOST_STATIC_WARNING_HPP
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef BOOST_STRONG_TYPEDEF_HPP
|
||||
#define BOOST_STRONG_TYPEDEF_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#error "This header is deprecated. Please use: boost/serialization/strong_typedef.hpp"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
|
||||
# pragma message ("Warning: This header is deprecated. Please use: boost/serialization/strong_typedef.hpp")
|
||||
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
|
||||
# warning "This header is deprecated. Please use: boost/serialization/strong_typedef.hpp"
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#endif // BOOST_STRONG_TYPEDEF_HPP
|
||||
@@ -26,11 +26,12 @@ template class basic_binary_iprimitive<
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
>;
|
||||
template class basic_binary_iarchive<naked_binary_iarchive> ;
|
||||
template class basic_binary_iarchive<naked_binary_iarchive, false> ;
|
||||
template class binary_iarchive_impl<
|
||||
naked_binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
std::istream::traits_type,
|
||||
false
|
||||
>;
|
||||
template class detail::archive_pointer_iserializer<naked_binary_iarchive> ;
|
||||
|
||||
@@ -40,11 +41,12 @@ template class basic_binary_iprimitive<
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
>;
|
||||
template class basic_binary_iarchive<binary_iarchive> ;
|
||||
template class basic_binary_iarchive<binary_iarchive, true> ;
|
||||
template class binary_iarchive_impl<
|
||||
binary_iarchive,
|
||||
std::istream::char_type,
|
||||
std::istream::traits_type
|
||||
std::istream::traits_type,
|
||||
true
|
||||
>;
|
||||
template class detail::archive_pointer_iserializer<binary_iarchive> ;
|
||||
|
||||
|
||||
+18
-2
@@ -20,17 +20,33 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
// explicitly instantiate for this type of binary stream
|
||||
template class basic_binary_oprimitive<
|
||||
naked_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
>;
|
||||
template class basic_binary_oarchive<naked_binary_oarchive, false> ;
|
||||
template class binary_oarchive_impl<
|
||||
naked_binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type,
|
||||
false
|
||||
>;
|
||||
template class detail::archive_pointer_oserializer<naked_binary_oarchive> ;
|
||||
|
||||
// explicitly instantiate for this type of binary stream
|
||||
template class basic_binary_oprimitive<
|
||||
binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
>;
|
||||
template class basic_binary_oarchive<binary_oarchive> ;
|
||||
template class basic_binary_oarchive<binary_oarchive, true> ;
|
||||
template class binary_oarchive_impl<
|
||||
binary_oarchive,
|
||||
std::ostream::char_type,
|
||||
std::ostream::traits_type
|
||||
std::ostream::traits_type,
|
||||
true
|
||||
>;
|
||||
template class detail::archive_pointer_oserializer<binary_oarchive> ;
|
||||
|
||||
|
||||
@@ -30,11 +30,12 @@ template class basic_binary_iprimitive<
|
||||
wchar_t,
|
||||
std::char_traits<wchar_t>
|
||||
>;
|
||||
template class basic_binary_iarchive<naked_binary_wiarchive> ;
|
||||
template class basic_binary_iarchive<naked_binary_wiarchive, false> ;
|
||||
template class binary_iarchive_impl<
|
||||
naked_binary_wiarchive,
|
||||
wchar_t,
|
||||
std::char_traits<wchar_t>
|
||||
std::char_traits<wchar_t>,
|
||||
false
|
||||
>;
|
||||
template class detail::archive_pointer_iserializer<naked_binary_wiarchive> ;
|
||||
|
||||
@@ -44,11 +45,12 @@ template class basic_binary_iprimitive<
|
||||
wchar_t,
|
||||
std::char_traits<wchar_t>
|
||||
>;
|
||||
template class basic_binary_iarchive<binary_wiarchive> ;
|
||||
template class basic_binary_iarchive<binary_wiarchive, true> ;
|
||||
template class binary_iarchive_impl<
|
||||
binary_wiarchive,
|
||||
wchar_t,
|
||||
std::char_traits<wchar_t>
|
||||
std::char_traits<wchar_t>,
|
||||
true
|
||||
>;
|
||||
template class detail::archive_pointer_iserializer<binary_wiarchive> ;
|
||||
|
||||
|
||||
@@ -24,17 +24,33 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
// explicitly instantiate for this type of text stream
|
||||
template class basic_binary_oprimitive<
|
||||
naked_binary_woarchive,
|
||||
wchar_t,
|
||||
std::char_traits<wchar_t>
|
||||
>;
|
||||
template class basic_binary_oarchive<naked_binary_woarchive, false> ;
|
||||
template class binary_oarchive_impl<
|
||||
naked_binary_woarchive,
|
||||
wchar_t,
|
||||
std::char_traits<wchar_t>,
|
||||
false
|
||||
>;
|
||||
template class detail::archive_pointer_oserializer<naked_binary_woarchive> ;
|
||||
|
||||
// explicitly instantiate for this type of text stream
|
||||
template class basic_binary_oprimitive<
|
||||
binary_woarchive,
|
||||
wchar_t,
|
||||
std::char_traits<wchar_t>
|
||||
>;
|
||||
template class basic_binary_oarchive<binary_woarchive> ;
|
||||
template class basic_binary_oarchive<binary_woarchive, true> ;
|
||||
template class binary_oarchive_impl<
|
||||
binary_woarchive,
|
||||
wchar_t,
|
||||
std::char_traits<wchar_t>
|
||||
std::char_traits<wchar_t>,
|
||||
true
|
||||
>;
|
||||
template class detail::archive_pointer_oserializer<binary_woarchive> ;
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template class basic_text_iarchive<naked_text_iarchive> ;
|
||||
template class text_iarchive_impl<naked_text_iarchive> ;
|
||||
template class basic_text_iarchive<naked_text_iarchive, false> ;
|
||||
template class text_iarchive_impl<naked_text_iarchive, false> ;
|
||||
template class detail::archive_pointer_iserializer<naked_text_iarchive> ;
|
||||
|
||||
template class basic_text_iarchive<text_iarchive> ;
|
||||
template class text_iarchive_impl<text_iarchive> ;
|
||||
template class basic_text_iarchive<text_iarchive, true> ;
|
||||
template class text_iarchive_impl<text_iarchive, true> ;
|
||||
template class detail::archive_pointer_iserializer<text_iarchive> ;
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -23,9 +23,13 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template class basic_text_oarchive<naked_text_oarchive, false> ;
|
||||
template class text_oarchive_impl<naked_text_oarchive, false> ;
|
||||
template class detail::archive_pointer_oserializer<naked_text_oarchive> ;
|
||||
|
||||
//template class basic_text_oprimitive<std::ostream> ;
|
||||
template class basic_text_oarchive<text_oarchive> ;
|
||||
template class text_oarchive_impl<text_oarchive> ;
|
||||
template class basic_text_oarchive<text_oarchive, true> ;
|
||||
template class text_oarchive_impl<text_oarchive, true> ;
|
||||
template class detail::archive_pointer_oserializer<text_oarchive> ;
|
||||
|
||||
} // namespace serialization
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template class basic_text_iarchive<naked_text_wiarchive> ;
|
||||
template class text_wiarchive_impl<naked_text_wiarchive> ;
|
||||
template class basic_text_iarchive<naked_text_wiarchive, false> ;
|
||||
template class text_wiarchive_impl<naked_text_wiarchive, false> ;
|
||||
template class detail::archive_pointer_iserializer<naked_text_wiarchive> ;
|
||||
|
||||
template class basic_text_iarchive<text_wiarchive> ;
|
||||
template class text_wiarchive_impl<text_wiarchive> ;
|
||||
template class basic_text_iarchive<text_wiarchive, true> ;
|
||||
template class text_wiarchive_impl<text_wiarchive, true> ;
|
||||
template class detail::archive_pointer_iserializer<text_wiarchive> ;
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -23,8 +23,12 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template class basic_text_oarchive<text_woarchive> ;
|
||||
template class text_woarchive_impl<text_woarchive> ;
|
||||
template class basic_text_oarchive<naked_text_woarchive, false> ;
|
||||
template class text_woarchive_impl<naked_text_woarchive, false> ;
|
||||
template class detail::archive_pointer_oserializer<naked_text_woarchive> ;
|
||||
|
||||
template class basic_text_oarchive<text_woarchive, true> ;
|
||||
template class text_woarchive_impl<text_woarchive, true> ;
|
||||
template class detail::archive_pointer_oserializer<text_woarchive> ;
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template class basic_xml_iarchive<naked_xml_iarchive> ;
|
||||
template class basic_xml_iarchive<naked_xml_iarchive, false> ;
|
||||
template class detail::archive_pointer_iserializer<naked_xml_iarchive> ;
|
||||
template class xml_iarchive_impl<naked_xml_iarchive> ;
|
||||
template class xml_iarchive_impl<naked_xml_iarchive, false> ;
|
||||
|
||||
template class basic_xml_iarchive<xml_iarchive> ;
|
||||
template class basic_xml_iarchive<xml_iarchive, true> ;
|
||||
template class detail::archive_pointer_iserializer<xml_iarchive> ;
|
||||
template class xml_iarchive_impl<xml_iarchive> ;
|
||||
template class xml_iarchive_impl<xml_iarchive, true> ;
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
@@ -23,9 +23,14 @@ namespace boost {
|
||||
namespace archive {
|
||||
|
||||
// explicitly instantiate for this type of xml stream
|
||||
template class basic_xml_oarchive<xml_oarchive> ;
|
||||
template class basic_xml_oarchive<naked_xml_oarchive, false> ;
|
||||
template class detail::archive_pointer_oserializer<naked_xml_oarchive> ;
|
||||
template class xml_oarchive_impl<naked_xml_oarchive, false> ;
|
||||
|
||||
// explicitly instantiate for this type of xml stream
|
||||
template class basic_xml_oarchive<xml_oarchive, true> ;
|
||||
template class detail::archive_pointer_oserializer<xml_oarchive> ;
|
||||
template class xml_oarchive_impl<xml_oarchive> ;
|
||||
template class xml_oarchive_impl<xml_oarchive, true> ;
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template class basic_xml_iarchive<naked_xml_wiarchive> ;
|
||||
template class xml_wiarchive_impl<naked_xml_wiarchive> ;
|
||||
template class basic_xml_iarchive<naked_xml_wiarchive, false> ;
|
||||
template class xml_wiarchive_impl<naked_xml_wiarchive, false> ;
|
||||
template class detail::archive_pointer_iserializer<naked_xml_wiarchive> ;
|
||||
|
||||
template class basic_xml_iarchive<xml_wiarchive> ;
|
||||
template class xml_wiarchive_impl<xml_wiarchive> ;
|
||||
template class basic_xml_iarchive<xml_wiarchive, true> ;
|
||||
template class xml_wiarchive_impl<xml_wiarchive, true> ;
|
||||
template class detail::archive_pointer_iserializer<xml_wiarchive> ;
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -56,8 +56,12 @@ operator<<(std::wostream &os, const char t){
|
||||
}
|
||||
#endif
|
||||
|
||||
template class basic_xml_oarchive<xml_woarchive> ;
|
||||
template class xml_woarchive_impl<xml_woarchive> ;
|
||||
template class basic_xml_oarchive<naked_xml_woarchive, false> ;
|
||||
template class xml_woarchive_impl<naked_xml_woarchive, false> ;
|
||||
template class detail::archive_pointer_oserializer<naked_xml_woarchive> ;
|
||||
|
||||
template class basic_xml_oarchive<xml_woarchive, true> ;
|
||||
template class xml_woarchive_impl<xml_woarchive, true> ;
|
||||
template class detail::archive_pointer_oserializer<xml_woarchive> ;
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -42,6 +42,7 @@ test-suite "serialization" :
|
||||
[ test-bsl-run_files test_class_info_save ]
|
||||
[ test-bsl-run_files test_object ]
|
||||
[ test-bsl-run_files test_primitive ]
|
||||
[ test-bsl-run_files test_helper_support ]
|
||||
[ test-bsl-run_files test_list : A ]
|
||||
[ test-bsl-run_files test_list_ptrs : A ]
|
||||
[ test-bsl-run_files test_map : A ]
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// test_helper_support.cpp
|
||||
|
||||
// (C) Copyright 2008 Joaquin M Lopez Munoz.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// should pass compilation and execution
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/serialization/split_free.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class my_string:public std::string
|
||||
{
|
||||
typedef std::string super;
|
||||
|
||||
public:
|
||||
my_string(){}
|
||||
my_string(const super & str): super(str){}
|
||||
my_string & operator=(const super& str)
|
||||
{
|
||||
super::operator=(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
const std::string& to_string() const { return *this; }
|
||||
};
|
||||
|
||||
struct my_string_helper
|
||||
{
|
||||
typedef std::vector<my_string> table;
|
||||
table t;
|
||||
};
|
||||
|
||||
BOOST_SERIALIZATION_SPLIT_FREE(my_string)
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
|
||||
template<class Archive>
|
||||
void save(Archive & ar, const my_string & str, unsigned int /* version */)
|
||||
{
|
||||
typedef my_string_helper::table table;
|
||||
table& t = ar.get_helper(static_cast<my_string_helper *>(NULL)).t;
|
||||
|
||||
table::iterator it = std::find(t.begin(), t.end(), str);
|
||||
if(it == t.end()){
|
||||
table::size_type s = t.size();
|
||||
ar << make_nvp("index", s);
|
||||
t.push_back(str);
|
||||
ar << make_nvp("string", str.to_string());
|
||||
}
|
||||
else{
|
||||
table::size_type s = (table::size_type)(it - t.begin());
|
||||
ar << make_nvp("index", s);
|
||||
}
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void load(Archive & ar, my_string & str, unsigned int /* version */)
|
||||
{
|
||||
typedef my_string_helper::table table;
|
||||
table& t = ar.get_helper(static_cast<my_string_helper *>(NULL)).t;
|
||||
|
||||
table::size_type s = 0;
|
||||
ar >> make_nvp("index", s);
|
||||
if(s >= t.size()){
|
||||
std::string tmp;
|
||||
ar>>make_nvp("string", tmp);
|
||||
str = tmp;
|
||||
t.push_back(str);
|
||||
}
|
||||
else{
|
||||
str = t[s];
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace serialization
|
||||
} // namespace boost
|
||||
|
||||
int test_helper_support()
|
||||
{
|
||||
const char * testfile = boost::archive::tmpnam(NULL);
|
||||
BOOST_REQUIRE(NULL != testfile);
|
||||
|
||||
std::vector<my_string> v1;
|
||||
for(int i=0; i<1000; ++i){
|
||||
v1.push_back(my_string(boost::lexical_cast<std::string>(i % 100)));
|
||||
}
|
||||
const std::vector<my_string>& cv1 = v1;
|
||||
{
|
||||
test_ostream os(testfile, TEST_STREAM_FLAGS);
|
||||
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
|
||||
oa << boost::serialization::make_nvp("vector", cv1);
|
||||
}
|
||||
{
|
||||
std::vector<my_string> v2;
|
||||
test_istream is(testfile, TEST_STREAM_FLAGS);
|
||||
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
|
||||
ia >> boost::serialization::make_nvp("vector", v2);
|
||||
BOOST_CHECK(cv1 == v2);
|
||||
}
|
||||
std::remove(testfile);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int test_main( int /* argc */, char* /* argv */[] )
|
||||
{
|
||||
return test_helper_support();
|
||||
}
|
||||
|
||||
// EOF
|
||||
Reference in New Issue
Block a user