Compare commits

..

1 Commits

Author SHA1 Message Date
Peter Dimov 9bfcdb2106 Remove explicit check for <forward_list> 2016-11-10 14:44:08 +02:00
68 changed files with 657 additions and 1090 deletions
+3 -18
View File
@@ -26,7 +26,7 @@ add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
add_definitions( -ftemplate-depth=300 )
# we use gcc to test for C++03 compatibility
add_definitions( -std=c++03 )
add_definitions( std=c++03 )
message(STATUS "compiler is g++ c++03")
set(COMPILER_SUPPORTS_CXX11 FALSE)
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
@@ -112,7 +112,6 @@ set(Boost_DETAILED_FAILURE_MSG true)
set(Boost_FOUND true)
find_package(Boost REQUIRED COMPONENTS system filesystem)
include(CheckIncludeFileCXX)
message(STATUS "Boost_FOUND is ${Boost_FOUND}")
@@ -321,14 +320,6 @@ archive_test(test_shared_ptr_multi_base)
archive_test(test_shared_ptr_132)
archive_test(test_simple_class A)
archive_test(test_simple_class_ptr A)
CHECK_INCLUDE_FILE_CXX(slist SLIST_FOUND)
if(SLIST_FOUND)
message(STATUS "slist header found")
archive_test(test_slist A)
archive_test(test_slist_ptr A)
else()
message(STATUS "slist header NOT found")
endif()
archive_test(test_stack A)
archive_test(test_split)
archive_test(test_tracking)
@@ -342,18 +333,12 @@ archive_test(test_set_boost_unordered A)
if(COMPILER_SUPPORTS_CXX11)
archive_test(test_set_unordered A)
else()
CHECK_INCLUDE_FILE_CXX(hash_set HASH_SET_FOUND)
if(HASH_SET_FOUND)
archive_test(test_set_hashed A)
endif()
archive_test(test_set_hashed A)
endif()
if(COMPILER_SUPPORTS_CXX11)
archive_test(test_map_unordered A)
else()
CHECK_INCLUDE_FILE_CXX(hash_map HASH_MAP_FOUND)
if(HASH_MAP_FOUND)
archive_test(test_map_hashed A)
endif()
archive_test(test_map_hashed A)
endif()
polymorphic_archive_test(test_polymorphic test_polymorphic_A A)
-67
View File
@@ -1,67 +0,0 @@
# Copyright 2016 Peter Dimov
# Copyright 2016 Robert Ramey
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- develop
# - master
install:
- cd ..
- git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule init libs/align
- git submodule init libs/array
- git submodule init libs/assert
- git submodule init libs/bind
- git submodule init libs/compatibility
- git submodule init libs/concept_check
- git submodule init libs/config
- git submodule init libs/container
- git submodule init libs/core
- git submodule init libs/detail
- git submodule init libs/filesystem
- git submodule init libs/function
- git submodule init libs/functional
- git submodule init libs/integer
- git submodule init libs/intrusive
- git submodule init libs/io
- git submodule init libs/iterator
- git submodule init libs/lexical_cast
- git submodule init libs/math
- git submodule init libs/move
- git submodule init libs/mpl
- git submodule init libs/numeric/conversion
- git submodule init libs/optional
- git submodule init libs/predef
- git submodule init libs/preprocessor
- git submodule init libs/range
- git submodule init libs/smart_ptr
- git submodule init libs/spirit
- git submodule init libs/static_assert
- git submodule init libs/system
- git submodule init libs/throw_exception
- git submodule init libs/tuple
- git submodule init libs/type_index
- git submodule init libs/type_traits
- git submodule init libs/unordered
- git submodule init libs/utility
- git submodule init libs/variant
- git submodule init tools/build
- git submodule update
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\serialization
- set PATH=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1;%PATH%
- bootstrap mingw
- tools\build\v2\b2 headers
build: off
test_script:
- cd libs/serialization/test
- tools\build\v2\b2 toolset=gcc link=static,shared
+1 -1
View File
@@ -292,7 +292,7 @@ included in the code module containing the serialization code.
</code></pre>
All of these archives implement the same interface. Hence, it should suffice to describe only one
All of these archives implement the same inteface. Hence, it should suffice to describe only one
of them in detail. For this purpose we will use the text archive.
+2 -2
View File
@@ -568,10 +568,10 @@ void myclass::serialize(Archive & ar, const unsigned int version){
...
}
BOOST_CLASS_EXPORT_IMPLEMENT(my_class)
BOOST_EXPORT_CLASS_IMPLEMENT(my_class)
#include &lt;boost/archive/text_oarchive&gt;
#include &lt;boost/archive/text_iarchive&gt;
#include &lt;boost/archive/text_iarchive&lt;
template myclass::serialize(boost::archive::text_oarchive & ar, const unsigned int version);
template myclass::serialize(boost::archive::text_iarchive & ar, const unsigned int version);
... // repeat for each archive class to be used.
@@ -50,7 +50,7 @@ namespace std{
//#include <boost/mpl/placeholders.hpp>
#include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/serialization/array_wrapper.hpp>
#include <boost/serialization/array.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/codecvt_null.hpp>
@@ -45,7 +45,7 @@ namespace std{
//#include <boost/mpl/placeholders.hpp>
#include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/serialization/array_wrapper.hpp>
#include <boost/serialization/array.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/codecvt_null.hpp>
@@ -21,7 +21,7 @@
//
// note the fact that on libraries without wide characters, ostream is
// is not a specialization of basic_ostream which in fact is not defined
// in such cases. So we can't use basic_istream<IStream::char_type> but rather
// in such cases. So we can't use basic_ostream<IStream::char_type> but rather
// use two template parameters
#include <boost/config.hpp>
+2 -1
View File
@@ -89,7 +89,8 @@ protected:
// leaving the archive in an undetermined state
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load_override(class_id_type & t);
void load_override(class_id_optional_type & /* t */){}
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load_override(class_id_optional_type & /* t */){}
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load_override(object_id_type & t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
+5 -8
View File
@@ -18,11 +18,8 @@
#include <locale>
#include <cstddef> // NULL, size_t
#ifndef BOOST_NO_CWCHAR
#include <cwchar> // for mbstate_t
#endif
#include <boost/config.hpp>
#include <boost/serialization/force_include.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
@@ -65,7 +62,7 @@ public:
template<>
class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> : public std::codecvt<wchar_t, char, std::mbstate_t>
{
virtual BOOST_WARCHIVE_DECL BOOST_DLLEXPORT std::codecvt_base::result
virtual BOOST_WARCHIVE_DECL std::codecvt_base::result
do_out(
std::mbstate_t & state,
const wchar_t * first1,
@@ -74,8 +71,8 @@ class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> : public std::codecvt<wchar_t,
char * first2,
char * last2,
char * & next2
) const BOOST_USED;
virtual BOOST_WARCHIVE_DECL BOOST_DLLEXPORT std::codecvt_base::result
) const;
virtual BOOST_WARCHIVE_DECL std::codecvt_base::result
do_in(
std::mbstate_t & state,
const char * first1,
@@ -84,7 +81,7 @@ class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> : public std::codecvt<wchar_t,
wchar_t * first2,
wchar_t * last2,
wchar_t * & next2
) const BOOST_USED;
) const;
virtual int do_encoding( ) const throw( ){
return sizeof(wchar_t) / sizeof(char);
}
@@ -92,7 +89,7 @@ class BOOST_SYMBOL_VISIBLE codecvt_null<wchar_t> : public std::codecvt<wchar_t,
return do_encoding();
}
public:
BOOST_DLLEXPORT explicit codecvt_null(std::size_t no_locale_manage = 0) :
explicit codecvt_null(std::size_t no_locale_manage = 0) :
std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
{}
virtual ~codecvt_null(){};
+2 -2
View File
@@ -77,10 +77,10 @@ namespace std{
#include <boost/serialization/type_info_implementation.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/void_cast.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/singleton.hpp>
#include <boost/serialization/wrapper.hpp>
#include <boost/serialization/array_wrapper.hpp>
// the following is need only for dynamic cast of polymorphic pointers
#include <boost/archive/archive_exception.hpp>
@@ -605,7 +605,7 @@ template<class Archive, class T>
inline void load(Archive & ar, T &t){
// if this assertion trips. It means we're trying to load a
// const object with a compiler that doesn't have correct
// function template ordering. On other compilers, this is
// funtion template ordering. On other compilers, this is
// handled below.
detail::check_const_loading< T >();
typedef
+1 -2
View File
@@ -56,9 +56,8 @@
#include <boost/serialization/type_info_implementation.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/void_cast.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/array_wrapper.hpp>
#include <boost/serialization/singleton.hpp>
#include <boost/archive/archive_exception.hpp>
@@ -9,14 +9,11 @@
#include <boost/config.hpp>
#ifdef BOOST_NO_STD_WSTREAMBUF
#error "wide char i/o not supported on this platform"
#endif
// std::codecvt_utf8 doesn't seem to work for msvc
// versions prior to MSVC 14.0
// std::codecvt_utf8 doesn't seem to work for any versions of msvc
#if defined(_MSC_VER) || defined(BOOST_NO_CXX11_HDR_CODECVT)
// use boost's utf8 codecvt facet
#if defined(_MSC_VER) && _MSC_VER < 1900 \
|| defined( BOOST_NO_CXX11_HDR_CODECVT )
#include <boost/archive/detail/decl.hpp>
#define BOOST_UTF8_BEGIN_NAMESPACE \
namespace boost { namespace archive { namespace detail {
@@ -29,11 +26,9 @@
#undef BOOST_UTF8_DECL
#undef BOOST_UTF8_BEGIN_NAMESPACE
#else
// use the standard vendor supplied facet
#include <codecvt>
namespace boost { namespace archive { namespace detail {
typedef std::codecvt_utf8<wchar_t> utf8_codecvt_facet;
} } }
#endif
#endif // BOOST_NO_CXX11_HDR_CODECVT
#endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP
@@ -47,10 +47,6 @@ archive_serializer_map<Archive>::insert(const basic_serializer * bs){
template<class Archive>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
archive_serializer_map<Archive>::erase(const basic_serializer * bs){
BOOST_ASSERT(! boost::serialization::singleton<
extra_detail::map<Archive>
>::is_destroyed()
);
if(boost::serialization::singleton<
extra_detail::map<Archive>
>::is_destroyed())
@@ -84,7 +84,6 @@ basic_binary_iprimitive<Archive, Elem, Tr>::init()
);
}
#ifndef BOOST_NO_CWCHAR
template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws)
@@ -94,7 +93,6 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws)
load_binary(ws, l * sizeof(wchar_t) / sizeof(char));
ws[l] = L'\0';
}
#endif
template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
@@ -112,6 +110,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(std::string & s)
load_binary(&(*s.begin()), l);
}
#ifndef BOOST_NO_CWCHAR
template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
basic_binary_iprimitive<Archive, Elem, Tr>::load(char * s)
@@ -121,6 +120,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(char * s)
load_binary(s, l);
s[l] = '\0';
}
#endif
#ifndef BOOST_NO_STD_WSTRING
template<class Archive, class Elem, class Tr>
@@ -71,7 +71,6 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::string &s)
}
#ifndef BOOST_NO_CWCHAR
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
basic_binary_oprimitive<Archive, Elem, Tr>::save(const wchar_t * ws)
@@ -92,7 +91,6 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::wstring &ws)
save_binary(ws.data(), l * sizeof(wchar_t) / sizeof(char));
}
#endif
#endif // BOOST_NO_CWCHAR
template<class Archive, class Elem, class Tr>
BOOST_ARCHIVE_OR_WARCHIVE_DECL
@@ -56,7 +56,7 @@ text_wiarchive_impl<Archive>::load(std::string &s)
s.resize(0);
s.reserve(size);
while(size-- > 0){
char x = is.narrow(is.get(), '\0');
int x = is.narrow(is.get(), '\0');
s += x;
}
}
@@ -17,9 +17,7 @@
#include <cstring> // strlen
#include <cstdlib> // mbtowc
#ifndef BOOST_NO_CWCHAR
#include <cwchar> // wcslen
#endif
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
@@ -41,7 +41,7 @@ template<class CharType>
struct from_6_bit {
typedef CharType result_type;
CharType operator()(CharType t) const{
static const char * lookup_table =
const char * lookup_table =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
@@ -37,7 +37,7 @@ template<class CharType>
struct to_6_bit {
typedef CharType result_type;
CharType operator()(CharType t) const{
static const signed char lookup_table[] = {
const signed char lookup_table[] = {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,
+1 -2
View File
@@ -102,8 +102,7 @@ public:
super_t(base),
m_bnext(NULL),
m_bend(NULL),
m_full(false),
m_current_value(0)
m_full(false)
{
}
};
@@ -56,7 +56,7 @@ class istream_iterator :
//Access the value referred to
Elem dereference() const {
return static_cast<Elem>(m_istream->peek());
return m_istream->peek();
}
void increment(){
@@ -75,14 +75,14 @@ public:
}
istream_iterator() :
m_istream(NULL),
m_current_value(NULL)
m_istream(NULL)
{}
istream_iterator(const istream_iterator<Elem> & rhs) :
m_istream(rhs.m_istream),
m_current_value(rhs.m_current_value)
{}
};
} // namespace iterators
@@ -18,16 +18,14 @@
#include <boost/assert.hpp>
#include <cstddef> // size_t
#ifndef BOOST_NO_CWCHAR
#include <cwchar> // mbstate_t
#endif
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::mbstate_t;
} // namespace std
#endif
#include <boost/archive/detail/utf8_codecvt_facet.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
@@ -111,7 +111,6 @@ public:
transform_width(T start) :
super_t(Base(static_cast< T >(start))),
m_buffer_out_full(false),
m_buffer_out(0),
// To disable GCC warning, but not truly necessary
//(m_buffer_in will be initialized later before being
//used because m_remaining_bits == 0)
@@ -19,9 +19,7 @@
#include <boost/assert.hpp>
#include <cctype>
#include <cstddef> // size_t
#ifndef BOOST_NO_CWCHAR
#include <cwchar> // mbstate_t
#endif
#include <algorithm> // copy
#include <boost/config.hpp>
-2
View File
@@ -44,9 +44,7 @@ inline std::size_t wcslen(const wchar_t * ws)
#else
#ifndef BOOST_NO_CWCHAR
#include <cwchar>
#endif
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std{ using ::wcslen; }
#endif
+137 -14
View File
@@ -6,32 +6,135 @@
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// for serialization of <array>. If <array> not supported by the standard
// library - this file becomes empty. This is to avoid breaking backward
// compatibiliy for applications which used this header to support
// serialization of native arrays. Code to serialize native arrays is
// now always include by default. RR
//#include <iostream>
#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
#if defined(BOOST_NO_STDC_NAMESPACE)
#include <iostream>
#include <cstddef> // std::size_t
namespace std{
using ::size_t;
} // namespace std
#endif
#include <boost/serialization/array_wrapper.hpp>
#ifndef BOOST_NO_CXX11_HDR_ARRAY
#include <array>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
#include <boost/serialization/wrapper.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/mpl/always.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/bool_fwd.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/static_assert.hpp>
namespace boost { namespace serialization {
// traits to specify whether to use an optimized array serialization
template <class Archive>
struct use_array_optimization : boost::mpl::always<boost::mpl::false_> {};
template<class T>
class array_wrapper :
public wrapper_traits<const array_wrapper< T > >
{
private:
array_wrapper & operator=(const array_wrapper & rhs);
// note: I would like to make the copy constructor private but this breaks
// make_array. So I make make_array a friend
template<class Tx, class S>
friend const boost::serialization::array_wrapper<Tx> make_array(Tx * t, S s);
public:
array_wrapper(const array_wrapper & rhs) :
m_t(rhs.m_t),
m_element_count(rhs.m_element_count)
{}
public:
array_wrapper(T * t, std::size_t s) :
m_t(t),
m_element_count(s)
{}
// default implementation
template<class Archive>
void serialize_optimized(Archive &ar, const unsigned int, mpl::false_ ) const
{
// default implemention does the loop
std::size_t c = count();
T * t = address();
while(0 < c--)
ar & boost::serialization::make_nvp("item", *t++);
}
// optimized implementation
template<class Archive>
void serialize_optimized(Archive &ar, const unsigned int version, mpl::true_ )
{
boost::serialization::split_member(ar, *this, version);
}
// default implementation
template<class Archive>
void save(Archive &ar, const unsigned int version) const
{
ar.save_array(*this,version);
}
// default implementation
template<class Archive>
void load(Archive &ar, const unsigned int version)
{
ar.load_array(*this,version);
}
// default implementation
template<class Archive>
void serialize(Archive &ar, const unsigned int version)
{
typedef typename
boost::serialization::use_array_optimization<Archive>::template apply<
typename remove_const< T >::type
>::type use_optimized;
serialize_optimized(ar,version,use_optimized());
}
T * address() const
{
return m_t;
}
std::size_t count() const
{
return m_element_count;
}
private:
T * const m_t;
const std::size_t m_element_count;
};
template<class T, class S>
inline
const array_wrapper< T > make_array(T* t, S s){
const array_wrapper< T > a(t, s);
return a;
}
} } // end namespace boost::serialization
// I can't figure out why BOOST_NO_CXX11_HDR_ARRAY
// has been set for clang-11. So just make sure
// it's reset now. Needs further research!!!
#if defined(_LIBCPP_VERSION)
#undef BOOST_NO_CXX11_HDR_ARRAY
#endif
#ifndef BOOST_NO_CXX11_HDR_ARRAY
#include <array>
namespace boost { namespace serialization {
// implement serialization for std::array
template <class Archive, class T, std::size_t N>
void serialize(Archive& ar, std::array<T,N>& a, const unsigned int /* version */)
{
@@ -42,7 +145,27 @@ void serialize(Archive& ar, std::array<T,N>& a, const unsigned int /* version */
}
} } // end namespace boost::serialization
#endif
#endif // BOOST_NO_CXX11_HDR_ARRAY
#include <boost/array.hpp>
namespace boost { namespace serialization {
// implement serialization for boost::array
template <class Archive, class T, std::size_t N>
void serialize(Archive& ar, boost::array<T,N>& a, const unsigned int /* version */)
{
ar & boost::serialization::make_nvp("elems", a.elems);
}
} } // end namespace boost::serialization
#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) \
namespace boost { namespace serialization { \
template <> struct use_array_optimization<Archive> { \
template <class ValueType> \
struct apply : boost::mpl::apply1<Archive::use_array_optimization \
, typename boost::remove_const<ValueType>::type \
>::type {}; \
}; }}
#endif //BOOST_SERIALIZATION_ARRAY_HPP
@@ -1,37 +0,0 @@
#ifndef BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP
#define BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP
// (C) Copyright 2005 Matthias Troyer and Dave Abrahams
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
} // namespace std
#endif
#include <boost/mpl/always.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace serialization {
template <class Archive>
struct use_array_optimization : boost::mpl::always<boost::mpl::false_> {};
} } // end namespace boost::serialization
#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) \
namespace boost { namespace serialization { \
template <> struct use_array_optimization<Archive> { \
template <class ValueType> \
struct apply : boost::mpl::apply1<Archive::use_array_optimization \
, typename boost::remove_const<ValueType>::type \
>::type {}; \
}; }}
#endif //BOOST_SERIALIZATION_ARRAY_OPTIMIZATON_HPP
@@ -1,121 +0,0 @@
#ifndef BOOST_SERIALIZATION_ARRAY_WRAPPER_HPP
#define BOOST_SERIALIZATION_ARRAY_WRAPPER_HPP
// (C) Copyright 2005 Matthias Troyer and Dave Abrahams
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//#include <iostream>
#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
} // namespace std
#endif
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
#include <boost/serialization/wrapper.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/array_optimization.hpp>
#include <boost/mpl/always.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/bool_fwd.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace serialization {
template<class T>
class array_wrapper :
public wrapper_traits<const array_wrapper< T > >
{
private:
array_wrapper & operator=(const array_wrapper & rhs);
// note: I would like to make the copy constructor private but this breaks
// make_array. So I make make_array a friend
template<class Tx, class S>
friend const boost::serialization::array_wrapper<Tx> make_array(Tx * t, S s);
public:
array_wrapper(const array_wrapper & rhs) :
m_t(rhs.m_t),
m_element_count(rhs.m_element_count)
{}
public:
array_wrapper(T * t, std::size_t s) :
m_t(t),
m_element_count(s)
{}
// default implementation
template<class Archive>
void serialize_optimized(Archive &ar, const unsigned int, mpl::false_ ) const
{
// default implemention does the loop
std::size_t c = count();
T * t = address();
while(0 < c--)
ar & boost::serialization::make_nvp("item", *t++);
}
// optimized implementation
template<class Archive>
void serialize_optimized(Archive &ar, const unsigned int version, mpl::true_ )
{
boost::serialization::split_member(ar, *this, version);
}
// default implementation
template<class Archive>
void save(Archive &ar, const unsigned int version) const
{
ar.save_array(*this,version);
}
// default implementation
template<class Archive>
void load(Archive &ar, const unsigned int version)
{
ar.load_array(*this,version);
}
// default implementation
template<class Archive>
void serialize(Archive &ar, const unsigned int version)
{
typedef typename
boost::serialization::use_array_optimization<Archive>::template apply<
typename remove_const< T >::type
>::type use_optimized;
serialize_optimized(ar,version,use_optimized());
}
T * address() const
{
return m_t;
}
std::size_t count() const
{
return m_element_count;
}
private:
T * const m_t;
const std::size_t m_element_count;
};
template<class T, class S>
inline
const array_wrapper< T > make_array(T* t, S s){
const array_wrapper< T > a(t, s);
return a;
}
} } // end namespace boost::serialization
#endif //BOOST_SERIALIZATION_ARRAY_WRAPPER_HPP
@@ -55,7 +55,7 @@ struct binary_object :
m_size = rhs.m_size;
return *this;
}
binary_object(const void * const t, std::size_t size) :
binary_object(/* const */ void * const t, std::size_t size) :
m_t(t),
m_size(size)
{}
@@ -69,7 +69,7 @@ struct binary_object :
// wrappers follow the naming convention make_xxxxx
inline
const binary_object
make_binary_object(const void * t, std::size_t size){
make_binary_object(/* const */ void * t, std::size_t size){
return binary_object(t, size);
}
@@ -1,33 +0,0 @@
#ifndef BOOST_SERIALIZATION_ARRAY_HPP
#define BOOST_SERIALIZATION_ARRAY_HPP
// (C) Copyright 2005 Matthias Troyer and Dave Abrahams
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//#include <iostream>
#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
} // namespace std
#endif
#include <boost/serialization/nvp.hpp>
#include <boost/array.hpp>
namespace boost { namespace serialization {
// implement serialization for boost::array
template <class Archive, class T, std::size_t N>
void serialize(Archive& ar, boost::array<T,N>& a, const unsigned int /* version */)
{
ar & boost::serialization::make_nvp("elems", a.elems);
}
} } // end namespace boost::serialization
#endif //BOOST_SERIALIZATION_ARRAY_HPP
@@ -64,7 +64,7 @@ collection_load_impl(
Archive & ar,
T & t,
collection_size_type count,
item_version_type /*item_version*/
item_version_type
){
t.resize(count);
typename T::iterator hint;
@@ -0,0 +1,59 @@
// (C) Copyright 2005 Matthias Troyer
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#ifndef BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP
#define BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
#define STD _STLP_STD
#else
#define STD std
#endif
#include <vector>
#include <valarray>
namespace boost {
namespace serialization {
namespace detail {
template <class T, class Allocator>
T* get_data(STD::vector<T,Allocator>& v)
{
return v.empty() ? 0 : &(v[0]);
}
template <class T, class Allocator>
T* get_data(STD::vector<T,Allocator> const & v)
{
return get_data(const_cast<STD::vector<T,Allocator>&>(v));
}
template <class T>
T* get_data(STD::valarray<T>& v)
{
return v.size()==0 ? 0 : &(v[0]);
}
template <class T>
const T* get_data(STD::valarray<T> const& v)
{
return get_data(const_cast<STD::valarray<T>&>(v));
}
} // detail
} // serialization
} // boost
#undef STD
#endif // BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP
@@ -18,37 +18,31 @@
#include <boost/config.hpp>
#if ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 1101) \
|| ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
#include <type_traits>
namespace boost{
namespace serialization {
namespace detail {
template<typename T>
struct is_default_constructible : public std::is_default_constructible<T> {};
struct is_default_constructible : std::is_default_constructible<T> {};
} // detail
} // serializaition
} // boost
#else
// we don't have standard library support for is_default_constructible
// so we fake it by using boost::has_trivial_construtor. But this is not
// actually correct because it's possible that a default constructor
// to be non trivial. So when using this, make sure you're not using your
// own definition of of T() but are using the actual default one!
#include <boost/type_traits/has_trivial_constructor.hpp>
namespace boost{
namespace serialization {
namespace detail {
template<typename T>
struct is_default_constructible : public boost::has_trivial_constructor<T> {};
struct is_default_constructible : boost::has_trivial_constructor<T> {};
} // detail
} // serializaition
} // boost
#endif
#endif // BOOST_SERIALIZATION_DETAIL_IS_DEFAULT_CONSTRUCTIBLE_HPP
+22 -23
View File
@@ -48,33 +48,32 @@ namespace boost { \
namespace serialization { \
template<> \
T * factory<T, N>(std::va_list ap){ \
BOOST_PP_IF(BOOST_PP_GREATER(N, 0) \
, A0 a0 = va_arg(ap, A0);, BOOST_PP_EMPTY()) \
BOOST_PP_IF(BOOST_PP_GREATER(N, 1) \
, A1 a1 = va_arg(ap, A1);, BOOST_PP_EMPTY()) \
BOOST_PP_IF(BOOST_PP_GREATER(N, 2) \
, A2 a2 = va_arg(ap, A2);, BOOST_PP_EMPTY()) \
BOOST_PP_IF(BOOST_PP_GREATER(N, 3) \
, A3 a3 = va_arg(ap, A3);, BOOST_PP_EMPTY()) \
BOOST_PP_IF(BOOST_PP_GREATER(N,0) \
,A0 a0 = va_arg(ap, A0); \
,BOOST_PP_IF(BOOST_PP_GREATER(N,1) \
,A1 a1 = va_arg(ap, A1); \
,BOOST_PP_IF(BOOST_PP_GREATER(N,2) \
,A2 a2 = va_arg(ap, A2); \
,BOOST_PP_IF(BOOST_PP_GREATER(N,3) \
,A3 a3 = va_arg(ap, A3); \
,BOOST_PP_EMPTY() \
)))) \
return new T( \
BOOST_PP_IF(BOOST_PP_GREATER(N, 0) \
, a0, BOOST_PP_EMPTY()) \
BOOST_PP_IF(BOOST_PP_GREATER(N, 1)) \
, BOOST_PP_COMMA, BOOST_PP_EMPTY)() \
BOOST_PP_IF(BOOST_PP_GREATER(N, 1) \
, a1, BOOST_PP_EMPTY()) \
BOOST_PP_IF(BOOST_PP_GREATER(N, 2)) \
, BOOST_PP_COMMA, BOOST_PP_EMPTY)() \
BOOST_PP_IF(BOOST_PP_GREATER(N, 2) \
, a2, BOOST_PP_EMPTY()) \
BOOST_PP_IF(BOOST_PP_GREATER(N, 3)) \
, BOOST_PP_COMMA, BOOST_PP_EMPTY)() \
BOOST_PP_IF(BOOST_PP_GREATER(N, 3) \
, a3, BOOST_PP_EMPTY()) \
BOOST_PP_IF(BOOST_PP_GREATER(N,0) \
,a0 \
,BOOST_PP_IF(BOOST_PP_GREATER(N,1) \
,a1 \
,BOOST_PP_IF(BOOST_PP_GREATER(N,2) \
,a2 \
,BOOST_PP_IF(BOOST_PP_GREATER(N,3) \
,a3 \
,BOOST_PP_EMPTY() \
)))) \
); \
} \
} \
} /**/
} \
/**/
#define BOOST_SERIALIZATION_FACTORY_4(T, A0, A1, A2, A3) \
BOOST_SERIALIZATION_FACTORY(4, T, A0, A1, A2, A3)
+30 -25
View File
@@ -29,7 +29,6 @@
#include <boost/type_traits/is_pointer.hpp>
#include <boost/serialization/detail/stack_constructor.hpp>
#include <boost/serialization/detail/is_default_constructible.hpp>
#include <boost/serialization/force_include.hpp>
// function specializations must be defined in the appropriate
// namespace - boost::serialization
@@ -47,15 +46,24 @@ void save(
// default constructor. It's possible that this could change sometime
// in the future, but for now, one will have to work around it. This can
// be done by serialization the optional<T> as optional<T *>
#if ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
BOOST_STATIC_ASSERT(
boost::serialization::detail::is_default_constructible<T>::value
|| boost::is_pointer<T>::value
);
#endif
BOOST_STATIC_ASSERT(
boost::serialization::detail::is_default_constructible<T>::value
|| boost::is_pointer<T>::value
);
const bool tflag = t.is_initialized();
ar << boost::serialization::make_nvp("initialized", tflag);
if (tflag){
const boost::serialization::item_version_type item_version(version< T >::value);
#if 0
const boost::archive::library_version_type library_version(
ar.get_library_version()
};
if(boost::archive::library_version_type(3) < library_version){
ar << BOOST_SERIALIZATION_NVP(item_version);
}
#else
ar << BOOST_SERIALIZATION_NVP(item_version);
#endif
ar << boost::serialization::make_nvp("value", *t);
}
}
@@ -64,7 +72,7 @@ template<class Archive, class T>
void load(
Archive & ar,
boost::optional< T > & t,
const unsigned int version
const unsigned int /*version*/
){
bool tflag;
ar >> boost::serialization::make_nvp("initialized", tflag);
@@ -73,18 +81,20 @@ void load(
return;
}
if(0 == version){
boost::serialization::item_version_type item_version(0);
boost::archive::library_version_type library_version(
ar.get_library_version()
);
if(boost::archive::library_version_type(3) < library_version){
ar >> BOOST_SERIALIZATION_NVP(item_version);
}
boost::serialization::item_version_type item_version(0);
boost::archive::library_version_type library_version(
ar.get_library_version()
);
if(boost::archive::library_version_type(3) < library_version){
ar >> BOOST_SERIALIZATION_NVP(item_version);
}
if(! t.is_initialized())
t = T();
ar >> boost::serialization::make_nvp("value", *t);
detail::stack_allocate<T> tp;
ar >> boost::serialization::make_nvp("value", tp.reference());
t.reset(boost::move(tp.reference()));
ar.reset_object_address(
t.get_ptr(),
& tp.reference()
);
}
template<class Archive, class T>
@@ -96,12 +106,7 @@ void serialize(
boost::serialization::split_free(ar, t, version);
}
template<class T>
struct version<boost::optional<T> > {
BOOST_STATIC_CONSTANT(int, value = 1);
};
} // serialization
} // boost
} // namespace boost
#endif // BOOST_SERIALIZATION_OPTIONAL_HPP_
+37 -45
View File
@@ -81,57 +81,57 @@ namespace serialization {
// attempt to retieve a mutable instances while locked will
// generate a assertion if compiled for debug.
class BOOST_SYMBOL_VISIBLE singleton_module :
public boost::noncopyable
{
private:
static bool & get_lock();
public:
BOOST_SERIALIZATION_DECL static void lock();
BOOST_SERIALIZATION_DECL static void unlock();
BOOST_SERIALIZATION_DECL static bool is_locked();
};
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
namespace detail {
template<class T>
class singleton_wrapper : public T
{
public:
static bool m_is_destroyed;
~singleton_wrapper(){
m_is_destroyed = true;
}
};
template<class T>
bool detail::singleton_wrapper< T >::m_is_destroyed = false;
} // detail
// note usage of BOOST_DLLEXPORT. These functions are in danger of
// being eliminated by the optimizer when building an application in
// release mode. Usage of the macro is meant to signal the compiler/linker
// to avoid dropping these functions which seem to be unreferenced.
// This usage is not related to autolinking.
class BOOST_SYMBOL_VISIBLE singleton_module :
public boost::noncopyable
{
private:
BOOST_SERIALIZATION_DECL BOOST_DLLEXPORT static bool & get_lock() BOOST_USED;
public:
BOOST_DLLEXPORT static void lock(){
get_lock() = true;
}
BOOST_DLLEXPORT static void unlock(){
get_lock() = false;
}
BOOST_DLLEXPORT static bool is_locked(){
return get_lock();
}
};
template <class T>
class singleton : public singleton_module
{
private:
static T & m_instance;
BOOST_DLLEXPORT static T & instance;
// include this to provoke instantiation at pre-execution time
static void use(T const *) {}
static T & get_instance() {
// use a wrapper so that types T with protected constructors
// can be used
class singleton_wrapper : public T {};
static singleton_wrapper t;
BOOST_DLLEXPORT static T & get_instance() {
static detail::singleton_wrapper< T > t;
// refer to instance, causing it to be instantiated (and
// initialized at startup on working compilers)
BOOST_ASSERT(! is_destroyed());
// note that the following is absolutely essential.
// commenting out this statement will cause compilers to fail to
// construct the instance at pre-execution time. This would prevent
// our usage/implementation of "locking" and introduce uncertainty into
// the sequence of object initializaition.
use(& m_instance);
BOOST_ASSERT(! detail::singleton_wrapper< T >::m_is_destroyed);
use(& instance);
return static_cast<T &>(t);
}
static bool & get_is_destroyed(){
static bool is_destroyed;
return is_destroyed;
}
public:
BOOST_DLLEXPORT static T & get_mutable_instance(){
BOOST_ASSERT(! is_locked());
@@ -141,24 +141,16 @@ public:
return get_instance();
}
BOOST_DLLEXPORT static bool is_destroyed(){
return get_is_destroyed();
}
BOOST_DLLEXPORT singleton(){
get_is_destroyed() = false;
}
BOOST_DLLEXPORT ~singleton() {
get_is_destroyed() = true;
return detail::singleton_wrapper< T >::m_is_destroyed;
}
};
template<class T>
T & singleton< T >::m_instance = singleton< T >::get_instance();
BOOST_DLLEXPORT T & singleton< T >::instance = singleton< T >::get_instance();
} // namespace serialization
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
+4 -8
View File
@@ -18,12 +18,10 @@
#include <valarray>
#include <boost/config.hpp>
#include <boost/serialization/collections_save_imp.hpp>
#include <boost/serialization/collections_load_imp.hpp>
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/array_wrapper.hpp>
#include <boost/serialization/detail/get_data.hpp>
// function specializations must be defined in the appropriate
// namespace - boost::serialization
@@ -44,13 +42,12 @@ void save( Archive & ar, const STD::valarray<U> &t, const unsigned int /*file_ve
{
const collection_size_type count(t.size());
ar << BOOST_SERIALIZATION_NVP(count);
if (t.size()){
if (t.size())
// explict template arguments to pass intel C++ compiler
ar << serialization::make_array<const U, collection_size_type>(
static_cast<const U *>(&t[0]),
count
);
}
}
template<class Archive, class U>
@@ -59,13 +56,12 @@ void load( Archive & ar, STD::valarray<U> &t, const unsigned int /*file_version
collection_size_type count;
ar >> BOOST_SERIALIZATION_NVP(count);
t.resize(count);
if (t.size()){
if (t.size())
// explict template arguments to pass intel C++ compiler
ar >> serialization::make_array<U, collection_size_type>(
static_cast<U *>(&t[0]),
count
);
}
}
// split non-intrusive serialization function member into separate
+2 -1
View File
@@ -31,7 +31,8 @@
#include <boost/serialization/collections_save_imp.hpp>
#include <boost/serialization/collections_load_imp.hpp>
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/array_wrapper.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/detail/get_data.hpp>
#include <boost/mpl/bool_fwd.hpp>
#include <boost/mpl/if.hpp>
+1 -1
View File
@@ -487,7 +487,7 @@ basic_iarchive_impl::load_pointer(
m_pending.version = co.file_version;
// predict next object id to be created
const size_t ui = object_id_vector.size();
const unsigned int ui = object_id_vector.size();
serialization::state_saver<object_id_type> w_end(m_moveable_objects.end);
+2 -1
View File
@@ -145,7 +145,8 @@ template<class String>
struct append_char {
String & contents;
void operator()(const unsigned int char_value) const {
contents += static_cast<typename String::value_type>(char_value);
const typename String::value_type z = char_value;
contents += z;
}
append_char(String & contents_)
: contents(contents_)
+2 -2
View File
@@ -18,7 +18,7 @@
namespace boost {
namespace archive {
BOOST_WARCHIVE_DECL BOOST_DLLEXPORT std::codecvt_base::result
BOOST_WARCHIVE_DECL std::codecvt_base::result
codecvt_null<wchar_t>::do_out(
std::mbstate_t & /*state*/,
const wchar_t * first1,
@@ -46,7 +46,7 @@ codecvt_null<wchar_t>::do_out(
return std::codecvt_base::ok;
}
BOOST_WARCHIVE_DECL BOOST_DLLEXPORT std::codecvt_base::result
BOOST_WARCHIVE_DECL std::codecvt_base::result
codecvt_null<wchar_t>::do_in(
std::mbstate_t & /*state*/,
const char * first1,
-1
View File
@@ -125,7 +125,6 @@ BOOST_SERIALIZATION_DECL void
extended_type_info::key_unregister() const{
if(NULL == get_key())
return;
BOOST_ASSERT(! singleton<detail::ktmap>::is_destroyed());
if(! singleton<detail::ktmap>::is_destroyed()){
detail::ktmap & x = singleton<detail::ktmap>::get_mutable_instance();
detail::ktmap::iterator start = x.lower_bound(this);
-1
View File
@@ -95,7 +95,6 @@ BOOST_SERIALIZATION_DECL void
extended_type_info_typeid_0::type_unregister()
{
if(NULL != m_ti){
BOOST_ASSERT(! singleton<tkmap>::is_destroyed());
if(! singleton<tkmap>::is_destroyed()){
tkmap & x = singleton<tkmap>::get_mutable_instance();
tkmap::iterator start = x.lower_bound(this);
+11 -1
View File
@@ -17,10 +17,20 @@
namespace boost {
namespace serialization {
BOOST_SERIALIZATION_DECL bool & singleton_module::get_lock(){
bool & singleton_module::get_lock(){
static bool lock = false;
return lock;
}
BOOST_SERIALIZATION_DECL void singleton_module::lock(){
get_lock() = true;
}
BOOST_SERIALIZATION_DECL void singleton_module::unlock(){
get_lock() = false;
}
BOOST_SERIALIZATION_DECL bool singleton_module::is_locked() {
return get_lock();
}
} // namespace serialization
} // namespace boost
+15 -18
View File
@@ -4,23 +4,20 @@
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/config.hpp>
#ifdef BOOST_NO_STD_WSTREAMBUF
#error "wide char i/o not supported on this platform"
#endif
// std::codecvt_utf8 doesn't seem to work for any versions of msvc
#if defined(_MSC_VER) \
|| defined( BOOST_NO_CXX11_HDR_CODECVT )
// include boost implementation of utf8 codecvt facet
# define BOOST_ARCHIVE_SOURCE
#include <boost/archive/detail/decl.hpp>
#define BOOST_UTF8_BEGIN_NAMESPACE \
namespace boost { namespace archive { namespace detail {
#define BOOST_UTF8_DECL BOOST_ARCHIVE_DECL
#define BOOST_UTF8_END_NAMESPACE }}}
#include <boost/detail/utf8_codecvt_facet.ipp>
#undef BOOST_UTF8_END_NAMESPACE
#undef BOOST_UTF8_DECL
#undef BOOST_UTF8_BEGIN_NAMESPACE
#endif
#else
// #ifdef BOOST_NO_CXX11_HDR_CODECVT
#if 1
# define BOOST_ARCHIVE_SOURCE
#include <boost/archive/detail/decl.hpp>
#define BOOST_UTF8_BEGIN_NAMESPACE \
namespace boost { namespace archive { namespace detail {
#define BOOST_UTF8_DECL BOOST_ARCHIVE_DECL
#define BOOST_UTF8_END_NAMESPACE }}}
#include <boost/detail/utf8_codecvt_facet.ipp>
#undef BOOST_UTF8_END_NAMESPACE
#undef BOOST_UTF8_DECL
#undef BOOST_UTF8_BEGIN_NAMESPACE
#endif // BOOST_NO_CXX11_HDR_CODECVT
#endif // BOOST_NO_STD_WSTREAMBUF
-1
View File
@@ -276,7 +276,6 @@ void_caster::recursive_register(bool includes_virtual_base) const {
BOOST_SERIALIZATION_DECL void
void_caster::recursive_unregister() const {
BOOST_ASSERT(! void_caster_registry::is_destroyed());
if(void_caster_registry::is_destroyed())
return;
+1 -1
View File
@@ -76,8 +76,8 @@ A::operator std::size_t () const {
#if defined(_MSC_VER)
#pragma warning(push) // Save warning settings.
#pragma warning(disable : 4244) // Disable possible loss of data warning
#endif
#endif
A::A() :
b(true),
#ifndef BOOST_NO_INT64_T
+80 -16
View File
@@ -18,38 +18,100 @@
#include <ostream> // for friend output operators
#include <cstddef> // size_t
#include <string>
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
}
#endif
#include <boost/detail/workaround.hpp>
#include <boost/limits.hpp>
#include <boost/cstdint.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/string.hpp>
#if defined(A_IMPORT)
#define A_DLL_DECL BOOST_SYMBOL_IMPORT
#pragma message("A imported")
#elif defined(A_EXPORT)
#define A_DLL_DECL BOOST_SYMBOL_EXPORT
#pragma message ("A exported")
#else
#define A_DLL_DECL
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/archive/dinkumware.hpp>
#endif
#endif
class A_DLL_DECL A {
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/string.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#if defined(A_IMPORT)
#define DLL_DECL BOOST_SYMBOL_IMPORT
#elif defined(A_EXPORT)
#define DLL_DECL BOOST_SYMBOL_EXPORT
#else
#define DLL_DECL
#endif
class DLL_DECL A
{
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(
Archive &ar,
const unsigned int /* file_version */
);
// note: from an aesthetic perspective, I would much prefer to have this
// defined out of line. Unfortunately, this trips a bug in the VC 6.0
// compiler. So hold our nose and put it her to permit running of tests.
// mscvc 6.0 requires template functions to be implemented. For this
// reason we can't make abstract.
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
template<class Archive>
void serialize(
Archive &ar,
const unsigned int /* file_version */
){
ar & BOOST_SERIALIZATION_NVP(b);
#ifndef BOOST_NO_INT64_T
ar & BOOST_SERIALIZATION_NVP(f);
ar & BOOST_SERIALIZATION_NVP(g);
#endif
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
int i;
if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){
i = l;
ar & BOOST_SERIALIZATION_NVP(i);
}
else{
ar & BOOST_SERIALIZATION_NVP(i);
l = i;
}
#else
ar & BOOST_SERIALIZATION_NVP(l);
#endif
ar & BOOST_SERIALIZATION_NVP(m);
ar & BOOST_SERIALIZATION_NVP(n);
ar & BOOST_SERIALIZATION_NVP(o);
ar & BOOST_SERIALIZATION_NVP(p);
ar & BOOST_SERIALIZATION_NVP(q);
#ifndef BOOST_NO_CWCHAR
ar & BOOST_SERIALIZATION_NVP(r);
#endif
ar & BOOST_SERIALIZATION_NVP(c);
ar & BOOST_SERIALIZATION_NVP(s);
ar & BOOST_SERIALIZATION_NVP(t);
ar & BOOST_SERIALIZATION_NVP(u);
ar & BOOST_SERIALIZATION_NVP(v);
ar & BOOST_SERIALIZATION_NVP(w);
ar & BOOST_SERIALIZATION_NVP(x);
ar & BOOST_SERIALIZATION_NVP(y);
#ifndef BOOST_NO_STD_WSTRING
ar & BOOST_SERIALIZATION_NVP(z);
#endif
}
#else
template<class Archive>
void serialize(
Archive &ar,
const unsigned int /* file_version */
);
#endif
bool b;
#ifndef BOOST_NO_INT64_T
boost::int64_t f;
@@ -90,4 +152,6 @@ public:
friend std::ostream & operator<<(std::ostream & os, A const & a);
};
#undef DLL_DECL
#endif // BOOST_SERIALIZATION_TEST_A_HPP
+5 -1
View File
@@ -8,11 +8,13 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/detail/workaround.hpp>
#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/archive/dinkumware.hpp>
#endif
#include <boost/serialization/nvp.hpp>
#include "A.hpp"
template<class Archive>
@@ -58,3 +60,5 @@ void A::serialize(
ar & BOOST_SERIALIZATION_NVP(z);
#endif
}
#endif // workaround BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-3
View File
@@ -84,7 +84,6 @@ test-suite "serialization" :
[ test-bsl-run_files test_list : A ]
[ test-bsl-run_files test_list_ptrs : A ]
[ test-bsl-run_files test_map : A ]
[ test-bsl-run_files test_map_hashed : A : : [ requires hash ] ] # BOOST_HAS_HASH
[ test-bsl-run_files test_map_unordered : A : : [ requires cxx11_hdr_unordered_map ] ] # BOOST_NO_CXX11_HDR_UNORDERED_MAP
[ test-bsl-run_files test_map_boost_unordered : A ]
[ test-bsl-run_files test_mi ]
@@ -108,8 +107,6 @@ test-suite "serialization" :
[ test-bsl-run_files test_set_boost_unordered : A ]
[ test-bsl-run_files test_simple_class : A ]
[ test-bsl-run_files test_simple_class_ptr : A ]
[ test-bsl-run_files test_slist : A : : [ requires slist ] ] # BOOST_HAS_SLIST ]
[ test-bsl-run_files test_slist_ptrs : A : : [ requires slist ] ] # BOOST_HAS_SLIST ] ]
[ test-bsl-run_files test_split ]
[ test-bsl-run_files test_stack : A ]
[ test-bsl-run_files test_tracking ]
+4 -8
View File
@@ -1,4 +1,3 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// dll_a.cpp
@@ -21,13 +20,12 @@
#include <boost/archive/text_iarchive.hpp>
template
A_DLL_DECL void A::serialize(
BOOST_SYMBOL_EXPORT void A::serialize(
boost::archive::text_oarchive &ar,
const unsigned int /* file_version */
);
template
A_DLL_DECL
void A::serialize(
BOOST_SYMBOL_EXPORT void A::serialize(
boost::archive::text_iarchive &ar,
const unsigned int /* file_version */
);
@@ -38,14 +36,12 @@ void A::serialize(
#include <boost/archive/polymorphic_iarchive.hpp>
template
A_DLL_DECL
void A::serialize(
BOOST_SYMBOL_EXPORT void A::serialize(
boost::archive::polymorphic_oarchive &ar,
const unsigned int /* file_version */
);
template
A_DLL_DECL
void A::serialize(
BOOST_SYMBOL_EXPORT void A::serialize(
boost::archive::polymorphic_iarchive &ar,
const unsigned int /* file_version */
);
+8
View File
@@ -10,6 +10,14 @@
#include <boost/serialization/export.hpp>
#define POLYMORPHIC_BASE_EXPORT
#include "polymorphic_base.hpp"
BOOST_CLASS_EXPORT_IMPLEMENT(polymorphic_base)
const char * polymorphic_base::get_key() const{
return
boost::serialization::type_info_implementation<
polymorphic_base
>::type::get_const_instance().get_key();
}
+10
View File
@@ -24,6 +24,14 @@
#include <boost/serialization/type_info_implementation.hpp>
#include <boost/serialization/extended_type_info_no_rtti.hpp>
#if defined(POLYMORPHIC_BASE_IMPORT)
#define DLL_DECL BOOST_SYMBOL_IMPORT
#elif defined(POLYMORPHIC_BASE_EXPORT)
#define DLL_DECL BOOST_SYMBOL_EXPORT
#else
#define DLL_DECL
#endif
class BOOST_SYMBOL_VISIBLE polymorphic_base
{
friend class boost::serialization::access;
@@ -40,6 +48,8 @@ public:
virtual ~polymorphic_base(){};
};
#undef DLL_DECL
BOOST_SERIALIZATION_ASSUME_ABSTRACT(polymorphic_base)
// the no_rtti system requires this !!!
+5 -14
View File
@@ -27,15 +27,11 @@ void polymorphic_derived2::serialize(
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
template
POLYMORPHIC_DERIVED2_DLL_DECL
void polymorphic_derived2::serialize(
template BOOST_SYMBOL_EXPORT void polymorphic_derived2::serialize(
boost::archive::text_oarchive & ar,
const unsigned int version
);
template
POLYMORPHIC_DERIVED2_DLL_DECL
void polymorphic_derived2::serialize(
template BOOST_SYMBOL_EXPORT void polymorphic_derived2::serialize(
boost::archive::text_iarchive & ar,
const unsigned int version
);
@@ -44,15 +40,11 @@ void polymorphic_derived2::serialize(
#include <boost/archive/polymorphic_iarchive.hpp>
#include <boost/archive/polymorphic_oarchive.hpp>
template
POLYMORPHIC_DERIVED2_DLL_DECL
void polymorphic_derived2::serialize(
template BOOST_SYMBOL_EXPORT void polymorphic_derived2::serialize(
boost::archive::polymorphic_oarchive & ar,
const unsigned int version
);
template
POLYMORPHIC_DERIVED2_DLL_DECL
void polymorphic_derived2::serialize(
template BOOST_SYMBOL_EXPORT void polymorphic_derived2::serialize(
boost::archive::polymorphic_iarchive & ar,
const unsigned int version
);
@@ -68,7 +60,6 @@ BOOST_CLASS_EXPORT_IMPLEMENT(polymorphic_derived2)
BOOST_SERIALIZATION_FACTORY_0(polymorphic_derived2)
template
POLYMORPHIC_DERIVED2_DLL_DECL
void polymorphic_derived2 *
BOOST_SYMBOL_EXPORT void polymorphic_derived2 *
boost::serialization::factory<polymorphic_derived2, 0>(std::va_list ap);
#endif
+8 -6
View File
@@ -24,19 +24,19 @@
#include <boost/serialization/type_info_implementation.hpp>
#include <boost/serialization/extended_type_info_typeid.hpp>
#include <boost/preprocessor/empty.hpp>
#include "polymorphic_base.hpp"
#if defined(POLYMORPHIC_DERIVED2_IMPORT)
#define POLYMORPHIC_DERIVED2_DLL_DECL BOOST_SYMBOL_IMPORT
#pragma message ("polymorphic_derived2 imported")
#define DLL_DECL BOOST_SYMBOL_IMPORT
#elif defined(POLYMORPHIC_DERIVED2_EXPORT)
#define POLYMORPHIC_DERIVED2_DLL_DECL BOOST_SYMBOL_EXPORT
#pragma message ("polymorphic_derived2 exported")
#define DLL_DECL BOOST_SYMBOL_EXPORT
#else
#define POLYMORPHIC_DERIVED2_DLL_DECL
#define DLL_DECL
#endif
class POLYMORPHIC_DERIVED2_DLL_DECL polymorphic_derived2 :
class DLL_DECL polymorphic_derived2 :
public polymorphic_base
{
friend class boost::serialization::access;
@@ -63,5 +63,7 @@ BOOST_CLASS_TYPE_INFO(
boost::serialization::extended_type_info_typeid<polymorphic_derived2>
)
#undef DLL_DECL
#endif // POLYMORPHIC_DERIVED2_HPP
+1 -1
View File
@@ -23,7 +23,7 @@ namespace std{
#include "test_tools.hpp"
#include <boost/core/no_exceptions_support.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/serialization/boost_array.hpp>
#include <boost/array.hpp>
#include "A.hpp"
#include "A.ipp"
+2 -1
View File
@@ -45,6 +45,7 @@ namespace std{
#include <boost/serialization/export.hpp>
#include <boost/serialization/access.hpp>
#define POLYMORPHIC_BASE_IMPORT
#include "polymorphic_base.hpp"
class polymorphic_derived1 : public polymorphic_base
@@ -66,7 +67,7 @@ BOOST_CLASS_EXPORT(polymorphic_derived1)
// MWerks users can do this to make their code work
BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(polymorphic_base, polymorphic_derived1)
#define POLYMORPHIC_DERIVED2_IMPORT
#define POLYMORPHIC_DERIVED_IMPORT
#include "polymorphic_derived2.hpp"
// save exported polymorphic class
+93 -6
View File
@@ -44,6 +44,89 @@ struct ptr_equal_to {
}
};
#include <boost/serialization/list.hpp>
void test_list(){
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_REQUIRE(NULL != testfile);
std::list<A *> alist;
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
A * free_a_ptr = new A;
alist.push_back(free_a_ptr);
alist.push_back(new A);
// verify that first element is the same as the free pointer
BOOST_CHECK((*alist.begin()) == free_a_ptr);
oa << boost::serialization::make_nvp("alist", alist);
oa << boost::serialization::make_nvp("free_a_ptr", free_a_ptr);
}
std::list<A *> alist1;
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
A * free_a_ptr1;
ia >> boost::serialization::make_nvp("alist", alist1);
ia >> boost::serialization::make_nvp("free_a_ptr", free_a_ptr1);
BOOST_CHECK(
alist.size() == alist1.size()
&& std::equal(alist.begin(),alist.end(),alist1.begin(),ptr_equal_to<A *>())
);
// verify that first element is the same as the free pointer
BOOST_CHECK((*alist1.begin()) == free_a_ptr1);
}
std::for_each(
alist.begin(),
alist.end(),
boost::checked_deleter<A>()
);
std::for_each(
alist1.begin(),
alist1.end(),
boost::checked_deleter<A>()
);
std::remove(testfile);
}
#ifdef BOOST_HAS_SLIST
#include <boost/serialization/slist.hpp>
void test_slist(){
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_REQUIRE(NULL != testfile);
std::list<A *> aslist;
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
aslist.push_back(new A);
aslist.push_back(new A);
oa << boost::serialization::make_nvp("aslist", aslist);
}
std::list<A *> aslist1;
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
ia >> boost::serialization::make_nvp("aslist", aslist1);
BOOST_CHECK(aslist.size() == aslist1.size() &&
std::equal(aslist.begin(),aslist.end(),aslist1.begin(),ptr_equal_to<A *>())
);
}
std::for_each(
aslist.begin(),
aslist.end(),
boost::checked_deleter<A>()
);
std::for_each(
aslist1.begin(),
aslist1.end(),
boost::checked_deleter<A>()
);
std::remove(testfile);
}
#endif
#ifndef BOOST_NO_CXX11_HDR_FORWARD_LIST
#include <boost/serialization/forward_list.hpp>
void test_forward_list(){
const char * testfile = boost::archive::tmpnam(NULL);
@@ -63,12 +146,7 @@ void test_forward_list(){
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
ia >> boost::serialization::make_nvp("aslist", aslist1);
BOOST_CHECK(
std::equal(
aslist.begin(),
aslist.end(),
aslist1.begin(),
ptr_equal_to<A *>()
)
std::equal(aslist.begin(),aslist.end(),aslist1.begin(),ptr_equal_to<A *>())
);
}
std::for_each(
@@ -83,10 +161,19 @@ void test_forward_list(){
);
std::remove(testfile);
}
#endif
int test_main( int /* argc */, char* /* argv */[] )
{
test_list();
#ifdef BOOST_HAS_SLIST
test_slist();
#endif
#ifndef BOOST_NO_CXX11_HDR_FORWARD_LIST
test_forward_list();
#endif
return EXIT_SUCCESS;
}
+1 -1
View File
@@ -29,7 +29,7 @@ namespace std{
struct test_dummy_out {
template<class Archive>
void save(Archive &, const unsigned int /*version*/) const {
void save(Archive & ar, const unsigned int /*version*/) const {
throw boost::archive::archive_exception(
boost::archive::archive_exception::other_exception
);
+27
View File
@@ -49,9 +49,36 @@ void test_list(){
std::remove(testfile);
}
#ifdef BOOST_HAS_SLIST
#include <boost/serialization/slist.hpp>
void test_slist(){
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_STD_EXTENSION_NAMESPACE::slist<A> aslist;
aslist.push_front(A());
aslist.push_front(A());
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
oa << boost::serialization::make_nvp("aslist", aslist);
}
BOOST_STD_EXTENSION_NAMESPACE::slist<A> aslist1;{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
ia >> boost::serialization::make_nvp("aslist", aslist1);
}
BOOST_CHECK(aslist == aslist1);
std::remove(testfile);
}
#endif
int test_main( int /* argc */, char* /* argv */[] )
{
test_list();
#ifdef BOOST_HAS_SLIST
test_slist();
#endif
return EXIT_SUCCESS;
}
+42
View File
@@ -89,9 +89,51 @@ void test_list(){
std::remove(testfile);
}
#ifdef BOOST_HAS_SLIST
#include <boost/serialization/slist.hpp>
void test_slist(){
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_REQUIRE(NULL != testfile);
std::list<A *> aslist;
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
aslist.push_back(new A);
aslist.push_back(new A);
oa << boost::serialization::make_nvp("aslist", aslist);
}
std::list<A *> aslist1;
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
ia >> boost::serialization::make_nvp("aslist", aslist1);
BOOST_CHECK(aslist.size() == aslist1.size() &&
std::equal(aslist.begin(),aslist.end(),aslist1.begin(),ptr_equal_to<A *>())
);
}
std::for_each(
aslist.begin(),
aslist.end(),
boost::checked_deleter<A>()
);
std::for_each(
aslist1.begin(),
aslist1.end(),
boost::checked_deleter<A>()
);
std::remove(testfile);
}
#endif
int test_main( int /* argc */, char* /* argv */[] )
{
test_list();
#ifdef BOOST_HAS_SLIST
test_slist();
#endif
return EXIT_SUCCESS;
}
+1
View File
@@ -23,6 +23,7 @@ namespace std{
#include "test_tools.hpp"
#include <boost/core/no_exceptions_support.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/array.hpp>
#include "A.hpp"
#include "A.ipp"
+2 -39
View File
@@ -24,25 +24,9 @@ namespace std{
#include "test_tools.hpp"
#include <boost/serialization/optional.hpp>
#include <boost/serialization/string.hpp>
struct A {
int m_x;
template<class Archive>
void serialize(Archive & ar, const unsigned int /* version */){
ar & boost::serialization::make_nvp("x", m_x);
};
bool operator==(const A & rhs) const {
return m_x == rhs.m_x;
}
// note that default constructor is not trivial
A() :
m_x(0)
{}
A(int x) :
m_x(x)
{}
};
#include "A.hpp"
#include "A.ipp"
int test_main( int /* argc */, char* /* argv */[] )
{
@@ -51,43 +35,22 @@ int test_main( int /* argc */, char* /* argv */[] )
const boost::optional<int> aoptional1;
const boost::optional<int> aoptional2(123);
const boost::optional<A> aoptional3;
A a(1);
const boost::optional<A> aoptional4(a);
const boost::optional<A *> aoptional5;
const boost::optional<A *> aoptional6(& a);
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
oa << boost::serialization::make_nvp("aoptional1",aoptional1);
oa << boost::serialization::make_nvp("aoptional2",aoptional2);
oa << boost::serialization::make_nvp("aoptional3",aoptional3);
oa << boost::serialization::make_nvp("aoptional4",aoptional4);
oa << boost::serialization::make_nvp("aoptional5",aoptional5);
oa << boost::serialization::make_nvp("aoptional6",aoptional6);
}
boost::optional<int> aoptional1a(999);
boost::optional<int> aoptional2a;
boost::optional<A> aoptional3a;
boost::optional<A> aoptional4a;
boost::optional<A *> aoptional5a;
boost::optional<A *> aoptional6a;
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
ia >> boost::serialization::make_nvp("aoptional1",aoptional1a);
ia >> boost::serialization::make_nvp("aoptional2",aoptional2a);
ia >> boost::serialization::make_nvp("aoptional3",aoptional3a);
ia >> boost::serialization::make_nvp("aoptional4",aoptional4a);
ia >> boost::serialization::make_nvp("aoptional5",aoptional5a);
ia >> boost::serialization::make_nvp("aoptional6",aoptional6a);
}
BOOST_CHECK(aoptional1 == aoptional1a);
BOOST_CHECK(aoptional2 == aoptional2a);
BOOST_CHECK(aoptional3 == aoptional3a);
BOOST_CHECK(aoptional4.get() == aoptional4a.get());
BOOST_CHECK(aoptional5 == aoptional5a);
BOOST_CHECK(*aoptional6.get() == *aoptional6a.get());
std::remove(testfile);
return EXIT_SUCCESS;
-55
View File
@@ -1,55 +0,0 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// test_list.cpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// should pass compilation and execution
#include <cstddef> // NULL
#include <fstream>
#include <boost/config.hpp>
#include <cstdio> // remove
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/archive/archive_exception.hpp>
#include "test_tools.hpp"
#include "A.hpp"
#include "A.ipp"
#include <boost/serialization/slist.hpp>
void test_slist(){
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_STD_EXTENSION_NAMESPACE::slist<A> aslist;
aslist.push_front(A());
aslist.push_front(A());
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
oa << boost::serialization::make_nvp("aslist", aslist);
}
BOOST_STD_EXTENSION_NAMESPACE::slist<A> aslist1;{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
ia >> boost::serialization::make_nvp("aslist", aslist1);
}
BOOST_CHECK(aslist == aslist1);
std::remove(testfile);
}
int test_main( int /* argc */, char* /* argv */[] )
{
test_slist();
return EXIT_SUCCESS;
}
// EOF
-88
View File
@@ -1,88 +0,0 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// test_list.cpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// should pass compilation and execution
#include <cstddef>
#include <fstream>
#include <boost/config.hpp>
#include <cstdio> // remove
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::remove;
}
#endif
#include <boost/type_traits/is_pointer.hpp>
#include <boost/static_assert.hpp>
#include <boost/checked_delete.hpp>
#include <boost/archive/archive_exception.hpp>
#include "test_tools.hpp"
#include <boost/serialization/nvp.hpp>
#include "A.hpp"
#include "A.ipp"
template<class T>
struct ptr_equal_to {
BOOST_STATIC_ASSERT(::boost::is_pointer< T >::value);
bool operator()(T const _Left, T const _Right) const
{
if(NULL == _Left && NULL == _Right)
return true;
if(typeid(*_Left) != typeid(*_Right))
return false;
return *_Left == *_Right;
}
};
#include <boost/serialization/slist.hpp>
void test_slist(){
const char * testfile = boost::archive::tmpnam(NULL);
BOOST_REQUIRE(NULL != testfile);
std::list<A *> aslist;
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
aslist.push_back(new A);
aslist.push_back(new A);
oa << boost::serialization::make_nvp("aslist", aslist);
}
std::list<A *> aslist1;
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
ia >> boost::serialization::make_nvp("aslist", aslist1);
BOOST_CHECK(aslist.size() == aslist1.size() &&
std::equal(aslist.begin(),aslist.end(),aslist1.begin(),ptr_equal_to<A *>())
);
}
std::for_each(
aslist.begin(),
aslist.end(),
boost::checked_deleter<A>()
);
std::for_each(
aslist1.begin(),
aslist1.end(),
boost::checked_deleter<A>()
);
std::remove(testfile);
}
int test_main( int /* argc */, char* /* argv */[] )
{
test_slist();
return EXIT_SUCCESS;
}
// EOF
+3
View File
@@ -19,6 +19,7 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // size_t
#include <boost/config.hpp>
#ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE
#include <exception>
@@ -76,12 +77,14 @@ namespace boost {
namespace archive {
const char * test_filename(const char * dir = NULL, char *fname = NULL){
static char ibuffer [512];
std::size_t i;
ibuffer[0] = '\0';
if(NULL == dir){
dir = boost::archive::tmpdir();
}
STRCPY(ibuffer, dir);
std::strcat(ibuffer, "/");
i = std::strlen(ibuffer);
if(NULL == fname){
char old_dir[256];
_getcwd(old_dir, sizeof(old_dir) - 1);
+1 -363
View File
@@ -181,7 +181,7 @@ int test_main(int, char *argv[])
return 0;
}
#elif 0
#else
#include <boost/archive/xml_oarchive.hpp>
#include <boost/serialization/nvp.hpp>
@@ -194,366 +194,4 @@ int main() {
oa << boost::serialization::make_nvp( "bob", bob );
}
#elif 0
#include <fstream>
#include <vector>
#include <iostream>
//#include <boost/shared_ptr.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/vector.hpp>
struct boxed_int
{
boxed_int() : i(0) {}
boxed_int(int i) : i(i) {}
int i;
template<class Archive>
void serialize(Archive &ar, unsigned version)
{
ar & BOOST_SERIALIZATION_NVP(i);
}
};
typedef boost::shared_ptr<boxed_int> pi;
void go(std::istream &is) {
std::vector<pi> vv;
try
{
boost::archive::binary_iarchive ia(is);
ia & vv;
}
catch(std::exception &e) {}
}
int main(int argc, char **argv) {
if(argc > 1) {
std::ifstream is(argv[1]);
go(is);
} else {
go(std::cin);
}
return 0;
}
#else
#include <cassert>
#include <string>
#include <boost/archive/iterators/base64_from_binary.hpp>
#include <boost/archive/iterators/transform_width.hpp>
namespace bai = boost::archive::iterators;
int main()
{
std::string input =
"A large rose-tree stood near the entrance of the garden: the roses growing on it were white, but there were "
"three gardeners at it, busily painting them red. Alice thought this a very curious thing, and she went nearer "
"to watch them, and just as she came up to them she heard one of them say, 'Look out now, Five! Don't go "
"splashing paint over me like that!''I couldn't help it,' said Five, in a sulky tone; 'Seven jogged my "
"elbow.'On which Seven looked up and said, 'That's right, Five! Always lay the blame on others!''You'd better "
"not talk!' said Five. 'I heard the Queen say only yesterday you deserved to be beheaded!''What for?' said the "
"one who had spoken first.'That's none of your business, Two!' said Seven.'Yes, it is his business!' said "
"Five, 'and I'll tell him—it was for bringing the cook tulip-roots instead of onions.'Seven flung down his "
"brush, and had just begun 'Well, of all the unjust things—' when his eye chanced to fall upon Alice, as she "
"stood watching them, and he checked himself suddenly: the others looked round also, and all of them bowed "
"low.'Would you tell me,' said Alice, a little timidly, 'why you are painting those roses?'Five and Seven said "
"nothing, but looked at Two. Two began in a low voice, 'Why the fact is, you see, Miss, this here ought to "
"have been a red rose-tree, and we put a white one in by mistake; and if the Queen was to find it out, we "
"should all have our heads cut off, you know. So you see, Miss, we're doing our best, afore she comes, to—' At "
"this moment Five, who had been anxiously looking across the garden, called out 'The Queen! The Queen!' and "
"the three gardeners instantly threw themselves flat upon their faces. There was a sound of many footsteps, "
"and Alice looked round, eager to see the Queen.First came ten soldiers carrying clubs; these were all shaped "
"like the three gardeners, oblong and flat, with their hands and feet at the corners: next the ten courtiers; "
"these were ornamented all over with diamonds, and walked two and two, as the soldiers did. After these came "
"the royal children; there were ten of them, and the little dears came jumping merrily along hand in hand, in "
"couples: they were all ornamented with hearts. Next came the guests, mostly Kings and Queens, and among them "
"Alice recognised the White Rabbit: it was talking in a hurried nervous manner, smiling at everything that was "
"said, and went by without noticing her. Then followed the Knave of Hearts, carrying the King's crown on a "
"crimson velvet cushion; and, last of all this grand procession, came THE KING AND QUEEN OF HEARTS.Alice was "
"rather doubtful whether she ought not to lie down on her face like the three gardeners, but she could not "
"remember ever having heard of such a rule at processions; 'and besides, what would be the use of a "
"procession,' thought she, 'if people had all to lie down upon their faces, so that they couldn't see it?' So "
"she stood still where she was, and waited.When the procession came opposite to Alice, they all stopped and "
"looked at her, and the Queen said severely 'Who is this?' She said it to the Knave of Hearts, who only bowed "
"and smiled in reply.'Idiot!' said the Queen, tossing her head impatiently; and, turning to Alice, she went "
"on, 'What's your name, child?''My name is Alice, so please your Majesty,' said Alice very politely; but she "
"added, to herself, 'Why, they're only a pack of cards, after all. I needn't be afraid of them!''And who are "
"these?' said the Queen, pointing to the three gardeners who were lying round the rosetree; for, you see, as "
"they were lying on their faces, and the pattern on their backs was the same as the rest of the pack, she "
"could not tell whether they were gardeners, or soldiers, or courtiers, or three of her own children.'How "
"should I know?' said Alice, surprised at her own courage. 'It's no business of mine.'The Queen turned crimson "
"with fury, and, after glaring at her for a moment like a wild beast, screamed 'Off with her head! "
"Off—''Nonsense!' said Alice, very loudly and decidedly, and the Queen was silent.The King laid his hand upon "
"her arm, and timidly said 'Consider, my dear: she is only a child!'The Queen turned angrily away from him, "
"and said to the Knave 'Turn them over!'The Knave did so, very carefully, with one foot.'Get up!' said the "
"Queen, in a shrill, loud voice, and the three gardeners instantly jumped up, and began bowing to the King, "
"the Queen, the royal children, and everybody else.'Leave off that!' screamed the Queen. 'You make me giddy.' "
"And then, turning to the rose-tree, she went on, 'What have you been doing here?''May it please your "
"Majesty,' said Two, in a very humble tone, going down on one knee as he spoke, 'we were trying—''I see!' said "
"the Queen, who had meanwhile been examining the roses. 'Off with their heads!' and the procession moved on, "
"three of the soldiers remaining behind to execute the unfortunate gardeners, who ran to Alice for "
"protection.'You shan't be beheaded!' said Alice, and she put them into a large flower-pot that stood near. "
"The three soldiers wandered about for a minute or two, looking for them, and then quietly marched off after "
"the others.'Are their heads off?' shouted the Queen.'Their heads are gone, if it please your Majesty!' the "
"soldiers shouted in reply.'That's right!' shouted the Queen. 'Can you play croquet?'The soldiers were silent, "
"and looked at Alice, as the question was evidently meant for her.'Yes!' shouted Alice.'Come on, then!' roared "
"the Queen, and Alice joined the procession, wondering very much what would happen next.'It's—it's a very fine "
"day!' said a timid voice at her side. She was walking by the White Rabbit, who was peeping anxiously into her "
"face.'Very,' said Alice: '—where's the Duchess?''Hush! Hush!' said the Rabbit in a low, hurried tone. He "
"looked anxiously over his shoulder as he spoke, and then raised himself upon tiptoe, put his mouth close to "
"her ear, and whispered 'She's under sentence of execution.''What for?' said Alice.'Did you say \"What a "
"pity!\"?' the Rabbit asked.'No, I didn't,' said Alice: 'I don't think it's at all a pity. I said \"What "
"for?\"''She boxed the Queen's ears—' the Rabbit began. Alice gave a little scream of laughter. 'Oh, hush!' "
"the Rabbit whispered in a frightened tone. 'The Queen will hear you! You see, she came rather late, and the "
"Queen said—''Get to your places!' shouted the Queen in a voice of thunder, and people began running about in "
"all directions, tumbling up against each other; however, they got settled down in a minute or two, and the "
"game began. Alice thought she had never seen such a curious croquet-ground in her life; it was all ridges and "
"furrows; the balls were live hedgehogs, the mallets live flamingoes, and the soldiers had to double "
"themselves up and to stand on their hands and feet, to make the arches.The chief difficulty Alice found at "
"first was in managing her flamingo: she succeeded in getting its body tucked away, comfortably enough, under "
"her arm, with its legs hanging down, but generally, just as she had got its neck nicely straightened out, and "
"was going to give the hedgehog a blow with its head, it would twist itself round and look up in her face, "
"with such a puzzled expression that she could not help bursting out laughing: and when she had got its head "
"down, and was going to begin again, it was very provoking to find that the hedgehog had unrolled itself, and "
"was in the act of crawling away: besides all this, there was generally a ridge or furrow in the way wherever "
"she wanted to send the hedgehog to, and, as the doubled-up soldiers were always getting up and walking off to "
"other parts of the ground, Alice soon came to the conclusion that it was a very difficult game indeed.The "
"players all played at once without waiting for turns, quarrelling all the while, and fighting for the "
"hedgehogs; and in a very short time the Queen was in a furious passion, and went stamping about, and shouting "
"'Off with his head!' or 'Off with her head!' about once in a minute.Alice began to feel very uneasy: to be "
"sure, she had not as yet had any dispute with the Queen, but she knew that it might happen any minute, 'and "
"then,' thought she, 'what would become of me? They're dreadfully fond of beheading people here; the great "
"wonder is, that there's any one left alive!'She was looking about for some way of escape, and wondering "
"whether she could get away without being seen, when she noticed a curious appearance in the air: it puzzled "
"her very much at first, but, after watching it a minute or two, she made it out to be a grin, and she said to "
"herself 'It's the Cheshire Cat: now I shall have somebody to talk to.''How are you getting on?' said the Cat, "
"as soon as there was mouth enough for it to speak with.Alice waited till the eyes appeared, and then nodded. "
"'It's no use speaking to it,' she thought, 'till its ears have come, or at least one of them.' In another "
"minute the whole head appeared, and then Alice put down her flamingo, and began an account of the game, "
"feeling very glad she had someone to listen to her. The Cat seemed to think that there was enough of it now "
"in sight, and no more of it appeared.'I don't think they play at all fairly,' Alice began, in rather a "
"complaining tone, 'and they all quarrel so dreadfully one can't hear oneself speak—and they don't seem to "
"have any rules in particular; at least, if there are, nobody attends to them—and you've no idea how confusing "
"it is all the things being alive; for instance, there's the arch I've got to go through next walking about at "
"the other end of the ground—and I should have croqueted the Queen's hedgehog just now, only it ran away when "
"it saw mine coming!''How do you like the Queen?' said the Cat in a low voice.'Not at all,' said Alice: 'she's "
"so extremely—' Just then she noticed that the Queen was close behind her, listening: so she went on, '—likely "
"to win, that it's hardly worth while finishing the game.'The Queen smiled and passed on.'Who are you talking "
"to?' said the King, going up to Alice, and looking at the Cat's head with great curiosity.'It's a friend of "
"mine—a Cheshire Cat,' said Alice: 'allow me to introduce it.''I don't like the look of it at all,' said the "
"King: 'however, it may kiss my hand if it likes.''I'd rather not,' the Cat remarked.'Don't be impertinent,' "
"said the King, 'and don't look at me like that!' He got behind Alice as he spoke.'A cat may look at a king,' "
"said Alice. 'I've read that in some book, but I don't remember where.''Well, it must be removed,' said the "
"King very decidedly, and he called the Queen, who was passing at the moment, 'My dear! I wish you would have "
"this cat removed!'The Queen had only one way of settling all difficulties, great or small. 'Off with his "
"head!' she said, without even looking round.'I'll fetch the executioner myself,' said the King eagerly, and "
"he hurried off.Alice thought she might as well go back, and see how the game was going on, as she heard the "
"Queen's voice in the distance, screaming with passion. She had already heard her sentence three of the "
"players to be executed for having missed their turns, and she did not like the look of things at all, as the "
"game was in such confusion that she never knew whether it was her turn or not. So she went in search of her "
"hedgehog.The hedgehog was engaged in a fight with another hedgehog, which seemed to Alice an excellent "
"opportunity for croqueting one of them with the other: the only difficulty was, that her flamingo was gone "
"across to the other side of the garden, where Alice could see it trying in a helpless sort of way to fly up "
"into a tree.By the time she had caught the flamingo and brought it back, the fight was over, and both the "
"hedgehogs were out of sight: 'but it doesn't matter much,' thought Alice, 'as all the arches are gone from "
"this side of the ground.' So she tucked it away under her arm, that it might not escape again, and went back "
"for a little more conversation with her friend.When she got back to the Cheshire Cat, she was surprised to "
"find quite a large crowd collected round it: there was a dispute going on between the executioner, the King, "
"and the Queen, who were all talking at once, while all the rest were quite silent, and looked very "
"uncomfortable.The moment Alice appeared, she was appealed to by all three to settle the question, and they "
"repeated their arguments to her, though, as they all spoke at once, she found it very hard indeed to make out "
"exactly what they said.The executioner's argument was, that you couldn't cut off a head unless there was a "
"body to cut it off from: that he had never had to do such a thing before, and he wasn't going to begin at his "
"time of life.The King's argument was, that anything that had a head could be beheaded, and that you weren't "
"to talk nonsense.The Queen's argument was, that if something wasn't done about it in less than no time she'd "
"have everybody executed, all round. (It was this last remark that had made the whole party look so grave and "
"anxious.)Alice could think of nothing else to say but 'It belongs to the Duchess: you'd better ask her about "
"it.''She's in prison,' the Queen said to the executioner: 'fetch her here.' And the executioner went off like "
"an arrow.The Cat's head began fading away the moment he was gone, and, by the time he had come back with the "
"Duchess, it had entirely disappeared; so the King and the executioner ran wildly up and down looking for it, "
"while the rest of the party went back to the game.";
std::string output =
"QSBsYXJnZSByb3NlLXRyZWUgc3Rvb2QgbmVhciB0aGUgZW50cmFuY2Ugb2YgdGhlIGdhcmRlbjogdGhlIHJvc2VzIGdyb3dpbmcgb24gaXQgd2"
"VyZSB3aGl0ZSwgYnV0IHRoZXJlIHdlcmUgdGhyZWUgZ2FyZGVuZXJzIGF0IGl0LCBidXNpbHkgcGFpbnRpbmcgdGhlbSByZWQuIEFsaWNlIHRo"
"b3VnaHQgdGhpcyBhIHZlcnkgY3VyaW91cyB0aGluZywgYW5kIHNoZSB3ZW50IG5lYXJlciB0byB3YXRjaCB0aGVtLCBhbmQganVzdCBhcyBzaG"
"UgY2FtZSB1cCB0byB0aGVtIHNoZSBoZWFyZCBvbmUgb2YgdGhlbSBzYXksICdMb29rIG91dCBub3csIEZpdmUhIERvbid0IGdvIHNwbGFzaGlu"
"ZyBwYWludCBvdmVyIG1lIGxpa2UgdGhhdCEnJ0kgY291bGRuJ3QgaGVscCBpdCwnIHNhaWQgRml2ZSwgaW4gYSB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B0aGUgZXhlY3V0aW9uZXIgcmFuIHdpbGRseSB1cCBhbmQgZG93biBsb29raW5nIGZvciBpdCwgd2hpbGUgdGhlIHJlc3Qgb2YgdGhlIHBh"
"cnR5IHdlbnQgYmFjayB0byB0aGUgZ2FtZS4=";
using it_base64_t = bai::base64_from_binary<bai::transform_width<std::string::const_iterator, 6, 8>>;
auto writePaddChars = (3 - input.length() % 3) % 3;
std::string base64(it_base64_t(input.begin()), it_base64_t(input.end()));
base64.append(writePaddChars, '=');
assert(base64 == output);
return 0;
}
#endif
-1
View File
@@ -49,7 +49,6 @@ rule run-template ( test-name : sources * : requirements * ) {
<toolset>clang:<variant>debug:<cxxflags>"-fsanitize=memory"
# toolset optimizations
<toolset>gcc:<cxxflags>"-ftemplate-depth-255"
<toolset>qcc:<cxxflags>"-ftemplate-depth-255"
<toolset>clang:<cxxflags>"-ftemplate-depth-255"
<toolset>darwin:<cxxflags>"-ftemplate-depth-255"
<toolset>msvc:<cxxflags>"-Gy"