mirror of
https://github.com/boostorg/serialization.git
synced 2026-07-21 13:33:32 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f79d98377 | |||
| c0dc251074 | |||
| 628a0c5617 | |||
| c78a93fb4f | |||
| 01ebdab663 | |||
| c9b3b6f1b8 | |||
| e77824a75e | |||
| 07ffdca96c | |||
| e1a3663b78 | |||
| 4bd765004d | |||
| 4e0e3fa25f | |||
| c75affd38c | |||
| 64d8aca650 | |||
| 1582fe4f4f | |||
| 64fb92e164 | |||
| f9bcd5c6bd | |||
| b6dae88a3d | |||
| 085c44275b |
@@ -0,0 +1,17 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<title>Serialization - Configuration</title>
|
||||
</head>
|
||||
<body link="#0000ff" vlink="#800080">
|
||||
</body>
|
||||
</html>
|
||||
+1
-1
@@ -257,7 +257,7 @@ function initialize() {
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="static_warning.html"><code>BOOST_STATIC_WARNING</code></a>
|
||||
</dl></div></dd>
|
||||
<!--
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="doc/configuration.html">Configuration Information</a></dt>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="configuration.html">Configuration Information</a></dt>
|
||||
-->
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="rationale.html">Rationale</a></dt>
|
||||
<dt><img style="display:none" src="dot.gif"><a target="detail" href="history.html">History</a>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<title>Serialization - Definitions</title>
|
||||
</head>
|
||||
<body link="#0000ff" vlink="#800080">
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<title>Serialization - FAQ</title>
|
||||
</head>
|
||||
<body link="#0000ff" vlink="#800080">
|
||||
</body>
|
||||
</html>
|
||||
+2
-21
@@ -386,28 +386,9 @@ inline void load_construct_data(
|
||||
// previously allocated memory.
|
||||
::new(t)T();
|
||||
}
|
||||
|
||||
template<class Archive, class T>
|
||||
void load_object_ptr(
|
||||
Archive & ar,
|
||||
T * & t,
|
||||
const unsigned int file_version
|
||||
){
|
||||
t = static_cast<T *>(operator new(sizeof(T));
|
||||
load_construct_data(ar, t, file_version);
|
||||
ar >> * t;
|
||||
}
|
||||
</code></pre>
|
||||
This code
|
||||
<ol>
|
||||
<li>allocates memory from the heap large enough to hold the
|
||||
object.
|
||||
<li>invokes the overridable <code style="white-space: normal">load_construct_data</code>
|
||||
to initialize the object.
|
||||
<li>the default <code style="white-space: normal">load_construct_data</code> invoke the
|
||||
default constructor "in-place" to initialize the memory.
|
||||
</ol>
|
||||
which effectively creates a new object and returns its pointer.
|
||||
The default <code style="white-space: normal">load_construct_data</code> invokes the
|
||||
default constructor "in-place" to initialize the memory.
|
||||
<p>
|
||||
If there is no such default constructor, the function templates
|
||||
<code style="white-space: normal">load_construct_data</code> and
|
||||
|
||||
@@ -103,7 +103,12 @@ void xml_woarchive_impl<Archive>::save(const std::string & s){
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
void xml_woarchive_impl<Archive>::save(const std::wstring & ws){
|
||||
os << ws;
|
||||
typedef iterators::xml_escape<std::wstring::const_iterator> xmbtows;
|
||||
std::copy(
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data())),
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data() + ws.size())),
|
||||
boost::archive::iterators::ostream_iterator<wchar_t>(os)
|
||||
);
|
||||
}
|
||||
#endif //BOOST_NO_STD_WSTRING
|
||||
|
||||
@@ -116,6 +121,12 @@ void xml_woarchive_impl<Archive>::save(const char * s){
|
||||
template<class Archive>
|
||||
void xml_woarchive_impl<Archive>::save(const wchar_t * ws){
|
||||
os << ws;
|
||||
typedef iterators::xml_escape<const wchar_t *> xmbtows;
|
||||
std::copy(
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws)),
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws + std::wcslen(ws))),
|
||||
boost::archive::iterators::ostream_iterator<wchar_t>(os)
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,12 +23,16 @@
|
||||
|
||||
#ifndef BOOST_TT_IS_ABSTRACT_CLASS_HPP
|
||||
#if defined(__GNUC__) && (34 <= _GNUC__ * 10 + __GNU_MINOR) \
|
||||
|| defined(__MSVC_VER) && (1310 <= __MSVC_VER) \
|
||||
|| defined(_MSC_VER) && (1310 <= _MSC_VER) \
|
||||
|| defined(__EDG_VERSION__) \
|
||||
/**/
|
||||
#include <boost/type_traits/is_abstract.hpp>
|
||||
#else
|
||||
// default to false if not supported
|
||||
|
||||
// supplant boost/type_traits/is_abstract.hpp
|
||||
# define BOOST_TT_IS_ABSTRACT_CLASS_HPP
|
||||
|
||||
namespace boost {
|
||||
template<class T>
|
||||
struct is_abstract {
|
||||
|
||||
@@ -34,13 +34,6 @@ namespace archive {
|
||||
|
||||
namespace serialization {
|
||||
|
||||
#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
template<class Archive, class T>
|
||||
void save(Archive &ar, const T & t, const unsigned int);
|
||||
template<class Archive, class T>
|
||||
void load(Archive &ar, T & t, const unsigned int);
|
||||
#endif
|
||||
|
||||
//namespace detail {
|
||||
template<class Archive, class T>
|
||||
struct free_saver {
|
||||
|
||||
@@ -27,11 +27,11 @@ class IntValueHolder
|
||||
{
|
||||
public:
|
||||
IntValueHolder()
|
||||
: value(0)
|
||||
: value(0)
|
||||
{}
|
||||
|
||||
IntValueHolder(int newvalue)
|
||||
: value(newvalue)
|
||||
: value(newvalue)
|
||||
{}
|
||||
|
||||
int GetValue() const { return value; }
|
||||
@@ -52,11 +52,11 @@ class FloatValueHolder
|
||||
{
|
||||
public:
|
||||
FloatValueHolder()
|
||||
: value(0)
|
||||
: value(0)
|
||||
{}
|
||||
|
||||
FloatValueHolder(float newvalue)
|
||||
: value(newvalue)
|
||||
: value(newvalue)
|
||||
{}
|
||||
|
||||
float GetValue() const { return value; }
|
||||
@@ -77,7 +77,7 @@ class A
|
||||
{
|
||||
public:
|
||||
A(const IntValueHolder& initialValue)
|
||||
: value(initialValue), floatValue(new FloatValueHolder(10.0f))
|
||||
: value(initialValue), floatValue(new FloatValueHolder(10.0f))
|
||||
{}
|
||||
|
||||
~A()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user