Compare commits

...

1 Commits

Author SHA1 Message Date
Douglas Gregor 204e7a434a Merged from 1.33.0 release
[SVN r30540]
2005-08-12 13:02:37 +00:00
18 changed files with 122 additions and 113 deletions
+2 -2
View File
@@ -159,7 +159,7 @@ function initialize() {
<dt><img style="display:none" src="dot.gif"><a target="detail" href="wrappers.html#nvp">Name-Value Pairs</a>
<dt><img style="display:none" src="dot.gif"><a target="detail" href="wrappers.html#composition">Composition</a>
</dl></div></dd>
<dt><img style="display:none" src="plus.gif" id="traits"><a target="detail" href="traits.html#Traits">Class Serialization Traits</a>
<dt><img style="display:none" src="plus.gif" id="traits"><a target="detail" href="traits.html">Class Serialization Traits</a>
<dd><div id="traits_detail"><dl class="page-index">
<dt><img style="display:none" src="dot.gif"><a target="detail" href="traits.html#version">Version</a>
<dt><img style="display:none" src="dot.gif"><a target="detail" href="traits.html#level">Implementation Level</a>
@@ -194,7 +194,7 @@ function initialize() {
<dt><img style="display:none" src="dot.gif"><a target="detail" href="exceptions.html#stream_error"><code>stream_error</code></a>
<dt><img style="display:none" src="dot.gif"><a target="detail" href="exceptions.html#invalid_class_name"><code>invalid_class_name</code></a>
<dt><img style="display:none" src="dot.gif"><a target="detail" href="exceptions.html#unregistered_cast"><code>unregistered_cast</code></a>
<dt><img style="display:none" src="dot.gif"><a target="detail" href="exceptions.html#xml_archive_parse_error"><code>xml_archive_parse_error</code></a>
<dt><img style="display:none" src="dot.gif"><a target="detail" href="exceptions.html#xml_archive_parsing_error"><code>xml_archive_parsing_error</code></a>
<dt><img style="display:none" src="dot.gif"><a target="detail" href="exceptions.html#xml_archive_tag_mismatch"><code>xml_archive_tag_mismatch</code></a>
<dt><img style="display:none" src="dot.gif"><a target="detail" href="exceptions.html#xml_archive_tag_name_error"><code>xml_archive_tag_name_error</code></a>
</dl></div></dd>
+1 -1
View File
@@ -200,7 +200,7 @@ at runtime, a collection of legitimate conversions is maintained by the system.
Normally this collection is maintained without any explicit action
on the part of the user of the library. However, there are special cases
where this might have to be done explicitly and could be overlooked. This
is described in <a href="special.html#runtimecasting">Runtime Casting</a>.
is described in <a href="serialization.html#runtimecasting">Runtime Casting</a>.
This exception is thrown if an attempt is made to convert between two pointers
whose relationship has not been registered,
+3 -3
View File
@@ -212,7 +212,7 @@ All of the above plus:<br>
<li>Polymorphic archive tests fail.
<li>XML serialization only works with version 1.6x of spirit. In order to build
and use this library with this compiler, one must use version 1.6x rather than the
latest version shipped with boost. See Release Notes.
latest version shipped with boost. See <a href="release.html">Release Notes</a>.
</ul>
<h4><a name="Intel80">Intel C++ 8.0</a></h4>
No known issues. All tests compile and run in debug and release modes.
@@ -280,7 +280,7 @@ decided to use these configurations.
<li>The "pimpl" demo fails to link. Cause and workaround for this is unknown
<li>XML serialization only works with version 1.6x of spirit. In order to build and use this
library with this compiler, one must use version 1.6x rather than the latest version
shipped with boost. See <a href="release.html#Installation">Release Notes</a>.
shipped with boost. See <a href="release.html">Release Notes</a>.
<li>This compiler does not support partial template specialization.
The implementation of the new <code>shared_ptr</code> serialization depends upon
compiler support for partial template specialization. This compiler doesn't implement this
@@ -341,7 +341,7 @@ all the above issues for Visual C++ 7.0 plus:
with this compiler.
<li>XML serialization only works with version 1.6x of spirit. In order to build
and use this library with this compiler, one must use version 1.6x rather than the
latest version shipped with boost. See Release Notes.
latest version shipped with boost. See <a href="release.html">Release Notes</a>.
</ul>
<h4><a name="comeau">Comeau 4.3.3</a></h4>
<ul>
+1 -2
View File
@@ -285,8 +285,7 @@ shared_ptr.hpp
</a>
<!--
Only the most minimal change to
<a href="../../../boost/serialization/shared_count.hpp" target="shared_count_hpp">
shared_count.hpp</a>
<code>shared_count.hpp</code>
(to gain access to some private members) was necessary to achieve this.
This should demonstrate how easy it is to non-intrusively
implement serialization to any data type or template.
+1 -1
View File
@@ -445,7 +445,7 @@ struct load_pointer_type {
// virtual serialize functions used for plug-ins
typedef BOOST_DEDUCED_TYPENAME
mpl::eval_if<
is_abstract<T>,
serialization::is_abstract<T>,
mpl::identity<abstract<T> >,
mpl::identity<non_abstract<T> >
>::type typex;
+1 -1
View File
@@ -352,7 +352,7 @@ struct save_pointer_type {
// virtual serialize functions used for plug-ins
typedef
BOOST_DEDUCED_TYPENAME mpl::eval_if<
is_abstract<T>,
serialization::is_abstract<T>,
mpl::identity<abstract<T> >,
mpl::identity<non_abstract<T> >
>::type typex;
@@ -64,8 +64,8 @@ private:
){
return ArchiveImplementation::load_pointer(t, bpis_ptr, finder);
}
virtual void delete_created_pointers(){
ArchiveImplementation::delete_created_pointers();
virtual void set_library_version(unsigned int archive_library_version){
ArchiveImplementation::set_library_version(archive_library_version);
}
virtual unsigned int get_library_version() const{
return ArchiveImplementation::get_library_version();
@@ -73,6 +73,12 @@ private:
virtual unsigned int get_flags() const {
return ArchiveImplementation::get_flags();
}
virtual void reset_object_address(const void * new_address, const void * old_address){
ArchiveImplementation::reset_object_address(new_address, old_address);
}
virtual void delete_created_pointers(){
ArchiveImplementation::delete_created_pointers();
}
virtual void load_binary(void * t, std::size_t size){
ArchiveImplementation::load_binary(t, size);
}
@@ -94,8 +94,6 @@ public:
virtual void load_end(const char * name) = 0;
virtual void register_basic_serializer(const detail::basic_iserializer & bis) = 0;
virtual void delete_created_pointers() = 0;
// msvc and borland won't automatically pass these to the base class so
// make it explicit here
template<class T>
@@ -118,8 +116,11 @@ public:
}
public:
// utility function implemented by all legal archives
virtual void set_library_version(unsigned int archive_library_version) = 0;
virtual unsigned int get_library_version() const = 0;
virtual unsigned int get_flags() const = 0;
virtual void reset_object_address(const void * new_address, const void * old_address) = 0;
virtual void delete_created_pointers() = 0;
virtual void load_binary(void * t, std::size_t size) = 0;
+5 -3
View File
@@ -31,6 +31,7 @@
#include <boost/static_assert.hpp>
#include <boost/serialization/type_info_implementation.hpp>
#include <boost/serialization/force_include.hpp>
// if no archive headers have been included
// skip inclusion of void_cast.hpp . This is to avoid auto-link when
@@ -44,10 +45,11 @@
class void_caster;
} // namespace void_cast_detail
template<class Derived, class Base>
const void_cast_detail::void_caster & void_cast_register(
BOOST_DLLEXPORT
inline const void_cast_detail::void_caster & void_cast_register(
const Derived * /* dnull = NULL */,
const Base * /* bnull = NULL */
);
) BOOST_USED;
} // namespace serialization
} // namespace boost
#else
@@ -126,7 +128,7 @@ namespace detail {
static_cast<const Base *>(NULL)
);
}
} m_reg;
};
static void invoke(){
typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
BOOST_DEDUCED_TYPENAME type_info_implementation<Base>::type::is_polymorphic,
@@ -25,7 +25,6 @@
#include <cassert>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/archive/basic_archive.hpp>
#include <boost/aligned_storage.hpp>
@@ -35,11 +34,6 @@
namespace boost{
namespace serialization {
namespace stl {
//////////////////////////////////////////////////////////////////////
// implementation of serialization for STL containers
//
// reserve space on stack for an object of type T without actually
// construction such an object
@@ -77,6 +71,12 @@ struct stack_construct : public stack_allocate<T>
}
};
namespace stl {
//////////////////////////////////////////////////////////////////////
// implementation of serialization for STL containers
//
// sequential container input
template<class Archive, class Container>
struct archive_input_seq
@@ -18,8 +18,6 @@
// helper function templates for serialization of collections
#include <boost/archive/basic_archive.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/serialization.hpp>
+5 -5
View File
@@ -45,6 +45,7 @@
#include <boost/serialization/force_include.hpp>
#include <boost/serialization/type_info_implementation.hpp>
#include <boost/serialization/extended_type_info.hpp>
#include <boost/serialization/is_abstract.hpp>
namespace boost {
@@ -62,7 +63,6 @@ template<class Archive, class T>
BOOST_DLLEXPORT const basic_pointer_oserializer &
instantiate_pointer_oserializer(Archive * ar, T *) BOOST_USED;
namespace export_impl
{
struct nothing{
@@ -184,7 +184,7 @@ struct export_instance {
#else
invoke() {
typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
is_abstract<T>,
serialization::is_abstract<T>,
mpl::identity<abstract>,
mpl::identity<not_abstract>
>::type typex;
@@ -202,12 +202,12 @@ struct export_instance {
std::pair<const void *, const void *>
export_instance<T, ASeq>::invoke() {
typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
is_abstract<T>,
serialization::is_abstract<T>,
mpl::identity<abstract>,
mpl::identity<not_abstract>
>::type type;
>::type typex;
return std::pair<const void *, const void *>(
type::invoke(),
typex::invoke(),
& guid_initializer<T>::instance
);
}
+16 -12
View File
@@ -18,31 +18,35 @@
#include <boost/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_abstract.hpp>
#ifndef BOOST_NO_IS_ABSTRACT
#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 {
namespace boost {
namespace serialization {
template<class T>
struct is_abstract {
typedef mpl::bool_<false> type;
BOOST_STATIC_CONSTANT(bool, value = false);
// default to false if not supported
#ifdef BOOST_NO_IS_ABSTRACT
typedef BOOST_DEDUCED_TYPENAME mpl::bool_<false> type;
BOOST_STATIC_CONSTANT(bool, value = false);
#else
typedef BOOST_DEDUCED_TYPENAME boost::is_abstract<T>::type type;
BOOST_STATIC_CONSTANT(bool, value = type::value);
#endif
};
} // namespace boost
#endif
} // namespace serialization
} // namespace boost
// define a macro to make explicit designation of this more transparent
#define BOOST_IS_ABSTRACT(T) \
namespace boost { \
namespace serialization { \
template<> \
struct is_abstract< T > { \
typedef mpl::bool_<true> type; \
BOOST_STATIC_CONSTANT(bool, value = true); \
}; \
} // namespace boost
} \
} \
/**/
#endif //BOOST_SERIALIZATION_IS_ABSTRACT_CLASS_HPP
+65 -67
View File
@@ -16,88 +16,86 @@
#include <boost/config.hpp>
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/integral_c_tag.hpp>
#include <boost/optional.hpp>
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/level.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/assert.hpp>
#include <boost/serialization/collections_load_imp.hpp>
// function specializations must be defined in the appropriate
// namespace - boost::serialization
namespace boost {
namespace serialization {
template<class Archive, class T>
void save(
Archive & ar,
const boost::optional<T> & t,
const unsigned int /*version*/
){
const bool tflag = t;
ar << boost::serialization::make_nvp("initialized", tflag);
if (tflag)
ar << boost::serialization::make_nvp("value", *t);
namespace serialization {
template<class Archive, class T>
void save(
Archive & ar,
const boost::optional<T> & t,
const unsigned int /*version*/
){
const bool tflag = t;
ar << boost::serialization::make_nvp("initialized", tflag);
if (tflag)
ar << boost::serialization::make_nvp("value", *t);
}
template<class Archive, class T>
void load(
Archive & ar,
boost::optional<T> & t,
const unsigned int /*version*/
){
bool tflag;
ar >> boost::serialization::make_nvp("initialized", tflag);
if (tflag){
stack_construct<Archive, T> aux(ar);
ar >> boost::serialization::make_nvp("value", aux.reference());
t.reset(aux.reference());
}
template<class Archive, class T>
void load(
Archive & ar,
boost::optional<T> & t,
const unsigned int /*version*/
){
bool tflag;
ar >> boost::serialization::make_nvp("initialized", tflag);
if (tflag){
T aux;
ar >> boost::serialization::make_nvp("value", aux);
t.reset(aux);
}
else {
t.reset();
}
else {
t.reset();
}
}
template<class Archive, class T>
void serialize(
Archive & ar,
boost::optional<T> & t,
const unsigned int version
){
boost::serialization::split_free(ar, t, version);
}
template<class Archive, class T>
void serialize(
Archive & ar,
boost::optional<T> & t,
const unsigned int version
){
boost::serialization::split_free(ar, t, version);
}
// the following would be slightly more efficient. But it
// would mean that archives created with programs that support
// TPS wouldn't be readable by programs that don't support TPS.
// Hence we decline to support this otherwise convenient optimization.
//#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if 0
// the following would be slightly more efficient. But it
// would mean that archives created with programs that support
// TPS wouldn't be readable by programs that don't support TPS.
// Hence we decline to support this otherwise convenient optimization.
//#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if 0
template <class T>
struct implementation_level<optional<T> >
{
typedef mpl::integral_c_tag tag;
typedef mpl::int_<boost::serialization::object_serializable> type;
BOOST_STATIC_CONSTANT(
int ,
value = boost::serialization::implementation_level::type::value
);
};
template <class T>
struct implementation_level<optional<T> >
{
typedef mpl::integral_c_tag tag;
typedef mpl::int_<boost::serialization::object_serializable> type;
BOOST_STATIC_CONSTANT(
int ,
value = boost::serialization::implementation_level::type::value
);
};
template<class T>
struct tracking_level<optional<T> >
{
typedef mpl::integral_c_tag tag;
typedef mpl::int_<boost::serialization::track_never> type;
BOOST_STATIC_CONSTANT(
int ,
value = boost::serialization::tracking_level::type::value
);
};
template<class T>
struct tracking_level<optional<T> >
{
typedef mpl::integral_c_tag tag;
typedef mpl::int_<boost::serialization::track_never> type;
BOOST_STATIC_CONSTANT(
int ,
value = boost::serialization::tracking_level::type::value
);
};
#endif
#endif
} // serialization
} // namespace boost
+2 -2
View File
@@ -182,7 +182,7 @@ inline void save(
// is never tracked by default. Wrap int in a trackable type
BOOST_STATIC_ASSERT((tracking_level<T>::value != track_never));
const T * t_ptr = t.get();
ar << boost::serialization::make_nvp("px", t_ptr);
ar << boost::serialization::make_nvp("px", t_ptr);
}
template<class Archive, class T>
@@ -195,7 +195,7 @@ inline void load(
// something like shared_ptr<int>. This occurs because int
// is never tracked by default. Wrap int in a trackable type
BOOST_STATIC_ASSERT((tracking_level<T>::value != track_never));
T* r;
T* r;
#ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
if(file_version < 1){
ar.register_type(static_cast<
+2 -2
View File
@@ -60,13 +60,13 @@ inline void load(
if(0 == count)
return;
boost::serialization::stl::stack_construct<Archive, U> u(ar);
boost::serialization::stack_construct<Archive, U> u(ar);
ar >> boost::serialization::make_nvp("item", u.reference());
t.push_front(u.reference());
BOOST_DEDUCED_TYPENAME BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator>::iterator last;
last = t.begin();
while(--count > 0){
boost::serialization::stl::stack_construct<Archive, U> u(ar);
boost::serialization::stack_construct<Archive, U> u(ar);
ar >> boost::serialization::make_nvp("item", u.reference());
last = t.insert_after(last, u.reference());
ar.reset_object_address(& (*last), & u);
+1
View File
@@ -26,6 +26,7 @@
#include <boost/mpl/integral_c_tag.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/serialization/traits.hpp>
#include <boost/serialization/level.hpp>
#include <boost/serialization/tracking_enum.hpp>