Commit ab001b90 authored by Dick Hollenbeck's avatar Dick Hollenbeck

bring in skeleton for eagle_plugin and update boost for use of RapidXML within property_tree

parent ffd57d88
#ifndef BOOST_ARCHIVE_ADD_FACET_HPP
#define BOOST_ARCHIVE_ADD_FACET_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// add_facet.hpp
// (C) Copyright 2003 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <locale>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
// does STLport uses native STL for locales?
#if (defined(__SGI_STL_PORT)&& defined(_STLP_NO_OWN_IOSTREAMS))
// and this native STL lib is old Dinkumware (has not defined _CPPLIB_VER)
# if (defined(_YVALS) && !defined(__IBMCPP__)) || !defined(_CPPLIB_VER)
# define BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
# endif
#endif
namespace boost {
namespace archive {
template<class Facet>
inline std::locale *
add_facet(const std::locale &l, Facet * f){
return
#if defined BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
// std namespace used for native locale
new std::locale(std::_Addfac(l, f));
#elif BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) // old Dinkumwar
// std namespace used for native locale
new std::locale(std::_Addfac(l, f));
#else
// standard compatible
new std::locale(l, f);
#endif
}
} // namespace archive
} // namespace boost
#undef BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
#endif // BOOST_ARCHIVE_ADD_FACET_HPP
#ifndef BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP
#define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// archive/archive_exception.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <exception>
#include <boost/assert.hpp>
#include <string>
#include <boost/config.hpp>
#include <boost/preprocessor/empty.hpp>
#include <boost/archive/detail/decl.hpp>
// note: the only reason this is in here is that windows header
// includes #define exception_code _exception_code (arrrgghhhh!).
// the most expedient way to address this is be sure that this
// header is always included whenever this header file is included.
#if defined(BOOST_WINDOWS)
#include <excpt.h>
#endif
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
//////////////////////////////////////////////////////////////////////
// exceptions thrown by archives
//
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception :
public virtual std::exception
{
public:
typedef enum {
no_exception, // initialized without code
other_exception, // any excepton not listed below
unregistered_class, // attempt to serialize a pointer of an
// an unregistered class
invalid_signature, // first line of archive does not contain
// expected string
unsupported_version,// archive created with library version
// subsequent to this one
pointer_conflict, // an attempt has been made to directly
// serialize an object which has
// already been serialzed through a pointer.
// Were this permited, the archive load would result
// in the creation of an extra copy of the obect.
incompatible_native_format, // attempt to read native binary format
// on incompatible platform
array_size_too_short,// array being loaded doesn't fit in array allocated
input_stream_error, // error on input stream
invalid_class_name, // class name greater than the maximum permitted.
// most likely a corrupted archive or an attempt
// to insert virus via buffer overrun method.
unregistered_cast, // base - derived relationship not registered with
// void_cast_register
unsupported_class_version, // type saved with a version # greater than the
// one used by the program. This indicates that the proggram
// needs to be rebuilt.
multiple_code_instantiation, // code for implementing serialization for some
// type has been instantiated in more than one module.
output_stream_error // error on input stream
} exception_code;
protected:
std::string m_msg;
public:
exception_code code;
archive_exception(
exception_code c,
const char * e1 = NULL,
const char * e2 = NULL
);
~archive_exception() throw ();
virtual const char *what( ) const throw();
protected:
archive_exception();
};
}// namespace archive
}// namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif //BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP
#ifndef BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_archive.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp> // size_t
#include <boost/noncopyable.hpp>
#include <boost/integer_traits.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
#if defined(_MSC_VER)
#pragma warning( push )
#pragma warning( disable : 4244 4267 )
#endif
/* NOTE : Warning : Warning : Warning : Warning : Warning
* Don't ever changes this. If you do, they previously created
* binary archives won't be readable !!!
*/
class library_version_type {
private:
typedef uint_least16_t base_type;
base_type t;
public:
library_version_type(): t(0) {};
explicit library_version_type(const unsigned int & t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
library_version_type(const library_version_type & t_) :
t(t_.t)
{}
library_version_type & operator=(const library_version_type & rhs){
t = rhs.t;
return *this;
}
// used for text output
operator base_type () const {
return t;
}
// used for text input
operator base_type & (){
return t;
}
bool operator==(const library_version_type & rhs) const {
return t == rhs.t;
}
bool operator<(const library_version_type & rhs) const {
return t < rhs.t;
}
};
BOOST_ARCHIVE_DECL(library_version_type)
BOOST_ARCHIVE_VERSION();
class version_type {
private:
typedef uint_least32_t base_type;
base_type t;
public:
// should be private - but MPI fails if it's not!!!
version_type(): t(0) {};
explicit version_type(const unsigned int & t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
version_type(const version_type & t_) :
t(t_.t)
{}
version_type & operator=(const version_type & rhs){
t = rhs.t;
return *this;
}
// used for text output
operator base_type () const {
return t;
}
// used for text intput
operator base_type & (){
return t;
}
bool operator==(const version_type & rhs) const {
return t == rhs.t;
}
bool operator<(const version_type & rhs) const {
return t < rhs.t;
}
};
class class_id_type {
private:
typedef int_least16_t base_type;
base_type t;
public:
// should be private - but then can't use BOOST_STRONG_TYPE below
class_id_type() : t(0) {};
explicit class_id_type(const int t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
explicit class_id_type(const std::size_t t_) : t(t_){
// BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
class_id_type(const class_id_type & t_) :
t(t_.t)
{}
class_id_type & operator=(const class_id_type & rhs){
t = rhs.t;
return *this;
}
// used for text output
operator int () const {
return t;
}
// used for text input
operator int_least16_t &() {
return t;
}
bool operator==(const class_id_type & rhs) const {
return t == rhs.t;
}
bool operator<(const class_id_type & rhs) const {
return t < rhs.t;
}
};
#define NULL_POINTER_TAG boost::archive::class_id_type(-1)
class object_id_type {
private:
typedef uint_least32_t base_type;
base_type t;
public:
object_id_type(): t(0) {};
explicit object_id_type(const unsigned int & t_) : t(t_){
BOOST_ASSERT(t_ <= boost::integer_traits<base_type>::const_max);
}
object_id_type(const object_id_type & t_) :
t(t_.t)
{}
object_id_type & operator=(const object_id_type & rhs){
t = rhs.t;
return *this;
}
// used for text output
operator uint_least32_t () const {
return t;
}
// used for text input
operator uint_least32_t & () {
return t;
}
bool operator==(const object_id_type & rhs) const {
return t == rhs.t;
}
bool operator<(const object_id_type & rhs) const {
return t < rhs.t;
}
};
#if defined(_MSC_VER)
#pragma warning( pop )
#endif
struct tracking_type {
bool t;
explicit tracking_type(const bool t_ = false)
: t(t_)
{};
tracking_type(const tracking_type & t_)
: t(t_.t)
{}
operator bool () const {
return t;
};
operator bool & () {
return t;
};
tracking_type & operator=(const bool t_){
t = t_;
return *this;
}
bool operator==(const tracking_type & rhs) const {
return t == rhs.t;
}
bool operator==(const bool & rhs) const {
return t == rhs;
}
tracking_type & operator=(const tracking_type & rhs){
t = rhs.t;
return *this;
}
};
struct class_name_type :
private boost::noncopyable
{
char *t;
operator const char * & () const {
return const_cast<const char * &>(t);
}
operator char * () {
return t;
}
explicit class_name_type(const char *key_)
: t(const_cast<char *>(key_)){}
explicit class_name_type(char *key_)
: t(key_){}
class_name_type & operator=(const class_name_type & rhs){
t = rhs.t;
return *this;
}
};
enum archive_flags {
no_header = 1, // suppress archive header info
no_codecvt = 2, // suppress alteration of codecvt facet
no_xml_tag_checking = 4, // suppress checking of xml tags
no_tracking = 8, // suppress ALL tracking
flags_last = 8
};
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_SIGNATURE();
/* NOTE : Warning : Warning : Warning : Warning : Warning
* If any of these are changed to different sized types,
* binary_iarchive won't be able to read older archives
* unless you rev the library version and include conditional
* code based on the library version. There is nothing
* inherently wrong in doing this - but you have to be super
* careful because it's easy to get wrong and start breaking
* old archives !!!
*/
#define BOOST_ARCHIVE_STRONG_TYPEDEF(T, D) \
class D : public T { \
public: \
explicit D(const T tt) : T(tt){} \
}; \
/**/
BOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_reference_type)
BOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_optional_type)
BOOST_ARCHIVE_STRONG_TYPEDEF(object_id_type, object_reference_type)
}// namespace archive
}// namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#include <boost/serialization/level.hpp>
// set implementation level to primitive for all types
// used internally by the serialization library
BOOST_CLASS_IMPLEMENTATION(boost::archive::library_version_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::version_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_reference_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_optional_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::class_name_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::object_id_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::object_reference_type, primitive_type)
BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type)
#include <boost/serialization/is_bitwise_serializable.hpp>
// set types used internally by the serialization library
// to be bitwise serializable
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::library_version_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::version_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_reference_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_optional_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_name_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_id_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_reference_type)
BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::tracking_type)
#endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_binary_iarchive.hpp
//
// archives stored as native binary - this should be the fastest way
// to archive the state of a group of obects. It makes no attempt to
// convert to any canonical form.
// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE
// ON PLATFORM APART FROM THE ONE THEY ARE CREATED ON
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/serialization/pfto.hpp>
#include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/common_iarchive.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/item_version_type.hpp>
#include <boost/integer_traits.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_binary_iarchive - read serialized objects from a input binary stream
template<class Archive>
class basic_binary_iarchive :
public detail::common_iarchive<Archive>
{
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
#elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_iarchive<Archive>;
#else
friend class detail::interface_iarchive<Archive>;
#endif
// intermediate level to support override of operators
// fot templates in the absence of partial function
// template ordering. If we get here pass to base class
// note extra nonsense to sneak it pass the borland compiers
typedef detail::common_iarchive<Archive> detail_common_iarchive;
template<class T>
void load_override(T & t, BOOST_PFTO int version){
this->detail_common_iarchive::load_override(t, static_cast<int>(version));
}
// include these to trap a change in binary format which
// isn't specifically handled
// upto 32K classes
BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t));
BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t));
// upto 2G objects
BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t));
BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
// binary files don't include the optional information
void load_override(class_id_optional_type & /* t */, int){}
void load_override(tracking_type & t, int /*version*/){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(6) < lvt){
int_least8_t x=0;
* this->This() >> x;
t = boost::archive::tracking_type(x);
}
else{
bool x=0;
* this->This() >> x;
t = boost::archive::tracking_type(x);
}
}
void load_override(class_id_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_iarchive::load_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
int_least16_t x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
else{
int x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
}
void load_override(class_id_reference_type & t, int version){
load_override(static_cast<class_id_type &>(t), version);
}
#if 0
void load_override(class_id_reference_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_iarchive::load_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
int_least16_t x=0;
* this->This() >> x;
t = boost::archive::class_id_reference_type(
boost::archive::class_id_type(x)
);
}
else{
int x=0;
* this->This() >> x;
t = boost::archive::class_id_reference_type(
boost::archive::class_id_type(x)
);
}
}
#endif
void load_override(version_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_iarchive::load_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
uint_least8_t x=0;
* this->This() >> x;
t = boost::archive::version_type(x);
}
else
if(boost::archive::library_version_type(5) < lvt){
uint_least16_t x=0;
* this->This() >> x;
t = boost::archive::version_type(x);
}
else
if(boost::archive::library_version_type(2) < lvt){
// upto 255 versions
unsigned char x=0;
* this->This() >> x;
t = version_type(x);
}
else{
unsigned int x=0;
* this->This() >> x;
t = boost::archive::version_type(x);
}
}
void load_override(boost::serialization::item_version_type & t, int version){
library_version_type lvt = this->get_library_version();
// if(boost::archive::library_version_type(7) < lvt){
if(boost::archive::library_version_type(6) < lvt){
this->detail_common_iarchive::load_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
uint_least16_t x=0;
* this->This() >> x;
t = boost::serialization::item_version_type(x);
}
else{
unsigned int x=0;
* this->This() >> x;
t = boost::serialization::item_version_type(x);
}
}
void load_override(serialization::collection_size_type & t, int version){
if(boost::archive::library_version_type(5) < this->get_library_version()){
this->detail_common_iarchive::load_override(t, version);
}
else{
unsigned int x=0;
* this->This() >> x;
t = serialization::collection_size_type(x);
}
}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(class_name_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init();
basic_binary_iarchive(unsigned int flags) :
detail::common_iarchive<Archive>(flags)
{}
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP
#define BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#if defined(_MSC_VER)
#pragma warning( disable : 4800 )
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_binary_iprimitive.hpp
//
// archives stored as native binary - this should be the fastest way
// to archive the state of a group of obects. It makes no attempt to
// convert to any canonical form.
// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE
// ON PLATFORM APART FROM THE ONE THEY ARE CREATED ON
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <iosfwd>
#include <boost/assert.hpp>
#include <locale>
#include <cstring> // std::memcpy
#include <cstddef> // std::size_t
#include <streambuf> // basic_streambuf
#include <string>
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::memcpy;
using ::size_t;
} // namespace std
#endif
#include <boost/cstdint.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/serialization/throw_exception.hpp>
#include <boost/integer.hpp>
#include <boost/integer_traits.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/serialization/array.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////////
// class binary_iarchive - read serialized objects from a input binary stream
template<class Archive, class Elem, class Tr>
class basic_binary_iprimitive
{
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
friend class load_access;
protected:
#else
public:
#endif
std::basic_streambuf<Elem, Tr> & m_sb;
// return a pointer to the most derived class
Archive * This(){
return static_cast<Archive *>(this);
}
#ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver<Elem, Tr> locale_saver;
#endif
// main template for serilization of primitive types
template<class T>
void load(T & t){
load_binary(& t, sizeof(T));
}
/////////////////////////////////////////////////////////
// fundamental types that need special treatment
// trap usage of invalid uninitialized boolean
void load(bool & t){
load_binary(& t, sizeof(t));
int i = t;
BOOST_ASSERT(0 == i || 1 == i);
(void)i; // warning suppression for release builds.
}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load(std::wstring &ws);
#endif
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load(char * t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load(wchar_t * t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init();
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_binary_iprimitive(
std::basic_streambuf<Elem, Tr> & sb,
bool no_codecvt
);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_binary_iprimitive();
public:
// we provide an optimized load for all fundamental types
// typedef serialization::is_bitwise_serializable<mpl::_1>
// use_array_optimization;
struct use_array_optimization {
template <class T>
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
struct apply {
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type;
};
#else
struct apply : public boost::serialization::is_bitwise_serializable< T > {};
#endif
};
// the optimized load_array dispatches to load_binary
template <class ValueType>
void load_array(serialization::array<ValueType>& a, unsigned int)
{
load_binary(a.address(),a.count()*sizeof(ValueType));
}
void
load_binary(void *address, std::size_t count);
};
template<class Archive, class Elem, class Tr>
inline void
basic_binary_iprimitive<Archive, Elem, Tr>::load_binary(
void *address,
std::size_t count
){
// note: an optimizer should eliminate the following for char files
BOOST_ASSERT(
static_cast<std::streamsize>(count / sizeof(Elem))
<= boost::integer_traits<std::streamsize>::const_max
);
std::streamsize s = static_cast<std::streamsize>(count / sizeof(Elem));
std::streamsize scount = m_sb.sgetn(
static_cast<Elem *>(address),
s
);
if(scount != s)
boost::serialization::throw_exception(
archive_exception(archive_exception::input_stream_error)
);
// note: an optimizer should eliminate the following for char files
BOOST_ASSERT(count % sizeof(Elem) <= boost::integer_traits<std::streamsize>::const_max);
s = static_cast<std::streamsize>(count % sizeof(Elem));
if(0 < s){
// if(is.fail())
// boost::serialization::throw_exception(
// archive_exception(archive_exception::stream_error)
// );
Elem t;
scount = m_sb.sgetn(& t, 1);
if(scount != 1)
boost::serialization::throw_exception(
archive_exception(archive_exception::input_stream_error)
);
std::memcpy(static_cast<char*>(address) + (count - s), &t, s);
}
}
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
#endif // BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_binary_oarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// archives stored as native binary - this should be the fastest way
// to archive the state of a group of obects. It makes no attempt to
// convert to any canonical form.
// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE
// ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/serialization/pfto.hpp>
#include <boost/integer.hpp>
#include <boost/integer_traits.hpp>
#include <boost/archive/detail/common_oarchive.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/collection_size_type.hpp>
#include <boost/serialization/item_version_type.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
//////////////////////////////////////////////////////////////////////
// class basic_binary_oarchive - write serialized objects to a binary output stream
// note: this archive has no pretensions to portability. Archive format
// may vary across machine architectures and compilers. About the only
// guarentee is that an archive created with this code will be readable
// by a program built with the same tools for the same machne. This class
// does have the virtue of buiding the smalles archive in the minimum amount
// of time. So under some circumstances it may be he right choice.
template<class Archive>
class basic_binary_oarchive :
public archive::detail::common_oarchive<Archive>
{
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
#elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
#else
friend class detail::interface_oarchive<Archive>;
#endif
// any datatype not specifed below will be handled by base class
typedef detail::common_oarchive<Archive> detail_common_oarchive;
template<class T>
void save_override(const T & t, BOOST_PFTO int version){
this->detail_common_oarchive::save_override(t, static_cast<int>(version));
}
// include these to trap a change in binary format which
// isn't specifically handled
BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(bool));
// upto 32K classes
BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t));
BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t));
// upto 2G objects
BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t));
BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
// binary files don't include the optional information
void save_override(const class_id_optional_type & /* t */, int){}
// enable this if we decide to support generation of previous versions
#if 0
void save_override(const boost::archive::version_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_oarchive::save_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::uint_least16_t x = t;
* this->This() << x;
}
else{
const unsigned int x = t;
* this->This() << x;
}
}
void save_override(const boost::serialization::item_version_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_oarchive::save_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::uint_least16_t x = t;
* this->This() << x;
}
else{
const unsigned int x = t;
* this->This() << x;
}
}
void save_override(class_id_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_oarchive::save_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
const boost::int_least16_t x = t;
* this->This() << x;
}
else{
const int x = t;
* this->This() << x;
}
}
void save_override(class_id_reference_type & t, int version){
save_override(static_cast<class_id_type &>(t), version);
}
#endif
// explicitly convert to char * to avoid compile ambiguities
void save_override(const class_name_type & t, int){
const std::string s(t);
* this->This() << s;
}
#if 0
void save_override(const serialization::collection_size_type & t, int){
if (get_library_version() < boost::archive::library_version_type(6)){
unsigned int x=0;
* this->This() >> x;
t = serialization::collection_size_type(x);
}
else{
* this->This() >> t;
}
}
#endif
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init();
basic_binary_oarchive(unsigned int flags) :
detail::common_oarchive<Archive>(flags)
{}
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP
#define BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_binary_oprimitive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// archives stored as native binary - this should be the fastest way
// to archive the state of a group of obects. It makes no attempt to
// convert to any canonical form.
// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE
// ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON
#include <iosfwd>
#include <boost/assert.hpp>
#include <locale>
#include <streambuf> // basic_streambuf
#include <string>
#include <cstddef> // size_t
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
} // namespace std
#endif
#include <boost/cstdint.hpp>
#include <boost/integer.hpp>
#include <boost/integer_traits.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/serialization/throw_exception.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/serialization/array.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_binary_oprimitive - binary output of prmitives
template<class Archive, class Elem, class Tr>
class basic_binary_oprimitive
{
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
friend class save_access;
protected:
#else
public:
#endif
std::basic_streambuf<Elem, Tr> & m_sb;
// return a pointer to the most derived class
Archive * This(){
return static_cast<Archive *>(this);
}
#ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver<Elem, Tr> locale_saver;
#endif
// default saving of primitives.
template<class T>
void save(const T & t)
{
save_binary(& t, sizeof(T));
}
/////////////////////////////////////////////////////////
// fundamental types that need special treatment
// trap usage of invalid uninitialized boolean which would
// otherwise crash on load.
void save(const bool t){
BOOST_ASSERT(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
save_binary(& t, sizeof(t));
}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save(const std::string &s);
#ifndef BOOST_NO_STD_WSTRING
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save(const std::wstring &ws);
#endif
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save(const char * t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save(const wchar_t * t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init();
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_binary_oprimitive(
std::basic_streambuf<Elem, Tr> & sb,
bool no_codecvt
);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_binary_oprimitive();
public:
// we provide an optimized save for all fundamental types
// typedef serialization::is_bitwise_serializable<mpl::_1>
// use_array_optimization;
// workaround without using mpl lambdas
struct use_array_optimization {
template <class T>
#if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS)
struct apply {
typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type;
};
#else
struct apply : public boost::serialization::is_bitwise_serializable< T > {};
#endif
};
// the optimized save_array dispatches to save_binary
template <class ValueType>
void save_array(boost::serialization::array<ValueType> const& a, unsigned int)
{
save_binary(a.address(),a.count()*sizeof(ValueType));
}
void save_binary(const void *address, std::size_t count);
};
template<class Archive, class Elem, class Tr>
inline void
basic_binary_oprimitive<Archive, Elem, Tr>::save_binary(
const void *address,
std::size_t count
){
//BOOST_ASSERT(
// static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)()) >= count
//);
// note: if the following assertions fail
// a likely cause is that the output stream is set to "text"
// mode where by cr characters recieve special treatment.
// be sure that the output stream is opened with ios::binary
//if(os.fail())
// boost::serialization::throw_exception(
// archive_exception(archive_exception::output_stream_error)
// );
// figure number of elements to output - round up
count = ( count + sizeof(Elem) - 1)
/ sizeof(Elem);
BOOST_ASSERT(count <= std::size_t(boost::integer_traits<std::streamsize>::const_max));
std::streamsize scount = m_sb.sputn(
static_cast<const Elem *>(address),
static_cast<std::streamsize>(count)
);
if(count != static_cast<std::size_t>(scount))
boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error)
);
//os.write(
// static_cast<const BOOST_DEDUCED_TYPENAME OStream::char_type *>(address),
// count
//);
//BOOST_ASSERT(os.good());
}
} //namespace boost
} //namespace archive
#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
#endif // BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP
#define BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_streambuf_local_saver.hpp
// (C) Copyright 2005 Robert Ramey - http://www.rrsd.com
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// note derived from boost/io/ios_state.hpp
// Copyright 2002, 2005 Daryle Walker. Use, modification, and distribution
// are subject to the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
// See <http://www.boost.org/libs/io/> for the library's home page.
#ifndef BOOST_NO_STD_LOCALE
#include <locale> // for std::locale
#include <streambuf> // for std::basic_streambuf
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost{
namespace archive{
template < typename Ch, class Tr >
class basic_streambuf_locale_saver :
private boost::noncopyable
{
public:
typedef ::std::basic_streambuf<Ch, Tr> state_type;
typedef ::std::locale aspect_type;
explicit basic_streambuf_locale_saver( state_type &s )
: s_save_( s ), a_save_( s.getloc() )
{}
basic_streambuf_locale_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.pubimbue(a) )
{}
~basic_streambuf_locale_saver()
{ this->restore(); }
void restore()
{ s_save_.pubimbue( a_save_ ); }
private:
state_type & s_save_;
aspect_type const a_save_;
};
} // archive
} // boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_NO_STD_LOCALE
#endif // BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP
#ifndef BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_text_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// archives stored as text - note these ar templated on the basic
// stream templates to accommodate wide (and other?) kind of characters
//
// 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_ostream<IStream::char_type> but rather
// use two template parameters
#include <boost/config.hpp>
#include <boost/serialization/pfto.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/archive/detail/common_iarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_text_iarchive - read serialized objects from a input text stream
template<class Archive>
class basic_text_iarchive :
public detail::common_iarchive<Archive>
{
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
#elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_iarchive<Archive>;
#else
friend class detail::interface_iarchive<Archive>;
#endif
// intermediate level to support override of operators
// fot templates in the absence of partial function
// template ordering
typedef detail::common_iarchive<Archive> detail_common_iarchive;
template<class T>
void load_override(T & t, BOOST_PFTO int){
this->detail_common_iarchive::load_override(t, 0);
}
// text file don't include the optional information
void load_override(class_id_optional_type & /*t*/, int){}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(class_name_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init(void);
basic_text_iarchive(unsigned int flags) :
detail::common_iarchive<Archive>(flags)
{}
~basic_text_iarchive(){}
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP
#define BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_text_iprimitive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// archives stored as text - note these are templated on the basic
// stream templates to accommodate wide (and other?) kind of characters
//
// Note the fact that on libraries without wide characters, ostream is
// not a specialization of basic_ostream which in fact is not defined
// in such cases. So we can't use basic_ostream<IStream::char_type> but rather
// use two template parameters
#include <boost/assert.hpp>
#include <locale>
#include <cstddef> // size_t
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
#if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT)
using ::locale;
#endif
} // namespace std
#endif
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/archive/dinkumware.hpp>
#endif
#include <boost/limits.hpp>
#include <boost/io/ios_state.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/static_assert.hpp>
#include <boost/serialization/throw_exception.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_text_iarchive - load serialized objects from a input text stream
#if defined(_MSC_VER)
#pragma warning( push )
#pragma warning( disable : 4244 4267 )
#endif
template<class IStream>
class basic_text_iprimitive
{
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
protected:
#else
public:
#endif
IStream &is;
io::ios_flags_saver flags_saver;
io::ios_precision_saver precision_saver;
#ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver<
BOOST_DEDUCED_TYPENAME IStream::char_type,
BOOST_DEDUCED_TYPENAME IStream::traits_type
> locale_saver;
#endif
template<class T>
void load(T & t)
{
if(! is.fail()){
is >> t;
return;
}
boost::serialization::throw_exception(
archive_exception(archive_exception::input_stream_error)
);
}
void load(char & t)
{
short int i;
load(i);
t = i;
}
void load(signed char & t)
{
short int i;
load(i);
t = i;
}
void load(unsigned char & t)
{
unsigned short int i;
load(i);
t = i;
}
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void load(wchar_t & t)
{
BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int));
int i;
load(i);
t = i;
}
#endif
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_text_iprimitive(IStream &is, bool no_codecvt);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_text_iprimitive();
public:
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_binary(void *address, std::size_t count);
};
#if defined(_MSC_VER)
#pragma warning( pop )
#endif
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_text_oarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// archives stored as text - note these ar templated on the basic
// stream templates to accommodate wide (and other?) kind of characters
//
// 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_ostream<OStream::char_type> but rather
// use two template parameters
#include <boost/assert.hpp>
#include <boost/config.hpp>
#include <boost/serialization/pfto.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/archive/detail/common_oarchive.hpp>
#include <boost/serialization/string.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_text_oarchive
template<class Archive>
class basic_text_oarchive :
public detail::common_oarchive<Archive>
{
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|| BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560))
public:
#elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
#else
friend class detail::interface_oarchive<Archive>;
#endif
enum {
none,
eol,
space
} delimiter;
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
newtoken();
void newline(){
delimiter = eol;
}
// default processing - kick back to base class. Note the
// extra stuff to get it passed borland compilers
typedef detail::common_oarchive<Archive> detail_common_oarchive;
template<class T>
void save_override(T & t, BOOST_PFTO int){
this->detail_common_oarchive::save_override(t, 0);
}
// start new objects on a new line
void save_override(const object_id_type & t, int){
this->This()->newline();
this->detail_common_oarchive::save_override(t, 0);
}
// text file don't include the optional information
void save_override(const class_id_optional_type & /* t */, int){}
void save_override(const class_name_type & t, int){
const std::string s(t);
* this->This() << s;
}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init();
basic_text_oarchive(unsigned int flags) :
detail::common_oarchive<Archive>(flags),
delimiter(none)
{}
~basic_text_oarchive(){}
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP
#define BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_text_oprimitive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// archives stored as text - note these ar templated on the basic
// stream templates to accommodate wide (and other?) kind of characters
//
// 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_ostream<OStream::char_type> but rather
// use two template parameters
#include <iomanip>
#include <locale>
#include <boost/config/no_tr1/cmath.hpp> // isnan
#include <boost/assert.hpp>
#include <cstddef> // size_t
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/archive/dinkumware.hpp>
#endif
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
#if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT)
using ::locale;
#endif
} // namespace std
#endif
#include <boost/limits.hpp>
#include <boost/integer.hpp>
#include <boost/io/ios_state.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/serialization/throw_exception.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
class save_access;
/////////////////////////////////////////////////////////////////////////
// class basic_text_oprimitive - output of prmitives to stream
template<class OStream>
class basic_text_oprimitive
{
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
protected:
#else
public:
#endif
OStream &os;
io::ios_flags_saver flags_saver;
io::ios_precision_saver precision_saver;
#ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver<
BOOST_DEDUCED_TYPENAME OStream::char_type,
BOOST_DEDUCED_TYPENAME OStream::traits_type
> locale_saver;
#endif
// default saving of primitives.
template<class T>
void save(const T &t){
if(os.fail())
boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error)
);
os << t;
}
/////////////////////////////////////////////////////////
// fundamental types that need special treatment
void save(const bool t){
// trap usage of invalid uninitialized boolean which would
// otherwise crash on load.
BOOST_ASSERT(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
if(os.fail())
boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error)
);
os << t;
}
void save(const signed char t)
{
save(static_cast<short int>(t));
}
void save(const unsigned char t)
{
save(static_cast<short unsigned int>(t));
}
void save(const char t)
{
save(static_cast<short int>(t));
}
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void save(const wchar_t t)
{
BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int));
save(static_cast<int>(t));
}
#endif
void save(const float t)
{
// must be a user mistake - can't serialize un-initialized data
if(os.fail())
boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error)
);
os << std::setprecision(std::numeric_limits<float>::digits10 + 2);
os << t;
}
void save(const double t)
{
// must be a user mistake - can't serialize un-initialized data
if(os.fail())
boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error)
);
os << std::setprecision(std::numeric_limits<double>::digits10 + 2);
os << t;
}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_text_oprimitive(OStream & os, bool no_codecvt);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_text_oprimitive();
public:
// unformatted append of one character
void put(BOOST_DEDUCED_TYPENAME OStream::char_type c){
if(os.fail())
boost::serialization::throw_exception(
archive_exception(archive_exception::output_stream_error)
);
os.put(c);
}
// unformatted append of null terminated string
void put(const char * s){
while('\0' != *s)
os.put(*s++);
}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_binary(const void *address, std::size_t count);
};
} //namespace boost
} //namespace archive
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_xml_archive.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
// constant strings used in xml i/o
extern
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_OBJECT_ID();
extern
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_OBJECT_REFERENCE();
extern
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_CLASS_ID();
extern
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE();
extern
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_CLASS_NAME();
extern
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_TRACKING();
extern
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_VERSION();
extern
BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_SIGNATURE();
}// namespace archive
}// namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_xml_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/serialization/pfto.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/archive/detail/common_iarchive.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/string.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class xml_iarchive - read serialized objects from a input text stream
template<class Archive>
class basic_xml_iarchive :
public detail::common_iarchive<Archive>
{
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
#elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
#else
friend class detail::interface_oarchive<Archive>;
#endif
unsigned int depth;
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_start(const char *name);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_end(const char *name);
// Anything not an attribute and not a name-value pair is an
// should be trapped here.
template<class T>
void load_override(T & t, BOOST_PFTO int)
{
// If your program fails to compile here, its most likely due to
// not specifying an nvp wrapper around the variable to
// be serialized.
BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
this->detail_common_iarchive::load_override(t, 0);
}
// Anything not an attribute - see below - should be a name value
// pair and be processed here
typedef detail::common_iarchive<Archive> detail_common_iarchive;
template<class T>
void load_override(
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const
#endif
boost::serialization::nvp< T > & t,
int
){
this->This()->load_start(t.name());
this->detail_common_iarchive::load_override(t.value(), 0);
this->This()->load_end(t.name());
}
// specific overrides for attributes - handle as
// primitives. These are not name-value pairs
// so they have to be intercepted here and passed on to load.
// although the class_id is included in the xml text file in order
// to make the file self describing, it isn't used when loading
// an xml archive. So we can skip it here. Note: we MUST override
// it otherwise it will be loaded as a normal primitive w/o tag and
// leaving the archive in an undetermined state
void load_override(class_id_optional_type & /* t */, int){}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(object_id_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(version_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(class_id_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(tracking_type & t, int);
// class_name_type can't be handled here as it depends upon the
// char type used by the stream. So require the derived implementation
// handle this.
// void load_override(class_name_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_xml_iarchive(unsigned int flags);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_xml_iarchive();
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_xml_oarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/archive/detail/common_oarchive.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/tracking.hpp>
#include <boost/serialization/string.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
//////////////////////////////////////////////////////////////////////
// class basic_xml_oarchive - write serialized objects to a xml output stream
template<class Archive>
class basic_xml_oarchive :
public detail::common_oarchive<Archive>
{
protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
#elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1
friend detail::interface_oarchive<Archive>;
friend class save_access;
#else
friend class detail::interface_oarchive<Archive>;
friend class save_access;
#endif
// special stuff for xml output
unsigned int depth;
bool indent_next;
bool pending_preamble;
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
indent();
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init();
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
write_attribute(
const char *attribute_name,
int t,
const char *conjunction = "=\""
);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
write_attribute(
const char *attribute_name,
const char *key
);
// helpers used below
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_start(const char *name);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_end(const char *name);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
end_preamble();
// Anything not an attribute and not a name-value pair is an
// error and should be trapped here.
template<class T>
void save_override(T & t, BOOST_PFTO int)
{
// If your program fails to compile here, its most likely due to
// not specifying an nvp wrapper around the variable to
// be serialized.
BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
this->detail_common_oarchive::save_override(t, 0);
}
// special treatment for name-value pairs.
typedef detail::common_oarchive<Archive> detail_common_oarchive;
template<class T>
void save_override(
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const
#endif
::boost::serialization::nvp< T > & t,
int
){
this->This()->save_start(t.name());
this->detail_common_oarchive::save_override(t.const_value(), 0);
this->This()->save_end(t.name());
}
// specific overrides for attributes - not name value pairs so we
// want to trap them before the above "fall through"
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_override(const object_id_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_override(const object_reference_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_override(const version_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_override(const class_id_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_override(const class_id_optional_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_override(const class_id_reference_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_override(const class_name_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
save_override(const tracking_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_xml_oarchive(unsigned int flags);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_xml_oarchive();
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
#define BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <istream>
#include <boost/archive/binary_iarchive_impl.hpp>
#include <boost/archive/detail/register_archive.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
// do not derive from the classes below. If you want to extend this functionality
// via inhertance, derived from text_iarchive_impl instead. This will
// preserve correct static polymorphism.
// same as binary_iarchive below - without the shared_ptr_helper
class naked_binary_iarchive :
public binary_iarchive_impl<
boost::archive::naked_binary_iarchive,
std::istream::char_type,
std::istream::traits_type
>
{
public:
naked_binary_iarchive(std::istream & is, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
>(is, flags)
{}
naked_binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_iarchive, std::istream::char_type, std::istream::traits_type
>(bsb, flags)
{}
};
} // namespace archive
} // namespace boost
// note special treatment of shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
namespace boost {
namespace archive {
// do not derive from this class. If you want to extend this functionality
// via inhertance, derived from binary_iarchive_impl instead. This will
// preserve correct static polymorphism.
class binary_iarchive :
public binary_iarchive_impl<
boost::archive::binary_iarchive,
std::istream::char_type,
std::istream::traits_type
>,
public detail::shared_ptr_helper
{
public:
binary_iarchive(std::istream & is, unsigned int flags = 0) :
binary_iarchive_impl<
binary_iarchive, std::istream::char_type, std::istream::traits_type
>(is, flags)
{}
binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
binary_iarchive_impl<
binary_iarchive, std::istream::char_type, std::istream::traits_type
>(bsb, flags)
{}
};
} // namespace archive
} // namespace boost
// required by export
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive)
BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive)
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP
#define BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_iarchive_impl.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <istream>
#include <boost/serialization/pfto.hpp>
#include <boost/archive/basic_binary_iprimitive.hpp>
#include <boost/archive/basic_binary_iarchive.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
template<class Archive, class Elem, class Tr>
class binary_iarchive_impl :
public basic_binary_iprimitive<Archive, Elem, Tr>,
public basic_binary_iarchive<Archive>
{
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public:
#else
friend class detail::interface_iarchive<Archive>;
friend class basic_binary_iarchive<Archive>;
friend class load_access;
protected:
#endif
// note: the following should not needed - but one compiler (vc 7.1)
// fails to compile one test (test_shared_ptr) without it !!!
// make this protected so it can be called from a derived archive
template<class T>
void load_override(T & t, BOOST_PFTO int){
this->basic_binary_iarchive<Archive>::load_override(t, 0L);
}
void init(unsigned int flags){
if(0 != (flags & no_header))
return;
#if ! defined(__MWERKS__)
this->basic_binary_iarchive<Archive>::init();
this->basic_binary_iprimitive<Archive, Elem, Tr>::init();
#else
basic_binary_iarchive<Archive>::init();
basic_binary_iprimitive<Archive, Elem, Tr>::init();
#endif
}
binary_iarchive_impl(
std::basic_streambuf<Elem, Tr> & bsb,
unsigned int flags
) :
basic_binary_iprimitive<Archive, Elem, Tr>(
bsb,
0 != (flags & no_codecvt)
),
basic_binary_iarchive<Archive>(flags)
{
init(flags);
}
binary_iarchive_impl(
std::basic_istream<Elem, Tr> & is,
unsigned int flags
) :
basic_binary_iprimitive<Archive, Elem, Tr>(
* is.rdbuf(),
0 != (flags & no_codecvt)
),
basic_binary_iarchive<Archive>(flags)
{
init(flags);
}
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP
#ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_HPP
#define BOOST_ARCHIVE_BINARY_OARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_oarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <ostream>
#include <boost/config.hpp>
#include <boost/archive/binary_oarchive_impl.hpp>
#include <boost/archive/detail/register_archive.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
// do not derive from this class. If you want to extend this functionality
// via inhertance, derived from binary_oarchive_impl instead. This will
// preserve correct static polymorphism.
class binary_oarchive :
public binary_oarchive_impl<
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
>
{
public:
binary_oarchive(std::ostream & os, unsigned int flags = 0) :
binary_oarchive_impl<
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
>(os, flags)
{}
binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) :
binary_oarchive_impl<
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
>(bsb, flags)
{}
};
typedef binary_oarchive naked_binary_oarchive;
} // namespace archive
} // namespace boost
// required by export
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_oarchive)
BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_oarchive)
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP
#define BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_oarchive_impl.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <ostream>
#include <boost/config.hpp>
#include <boost/serialization/pfto.hpp>
#include <boost/archive/basic_binary_oprimitive.hpp>
#include <boost/archive/basic_binary_oarchive.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
template<class Archive, class Elem, class Tr>
class binary_oarchive_impl :
public basic_binary_oprimitive<Archive, Elem, Tr>,
public basic_binary_oarchive<Archive>
{
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public:
#else
friend class detail::interface_oarchive<Archive>;
friend class basic_binary_oarchive<Archive>;
friend class save_access;
protected:
#endif
// note: the following should not needed - but one compiler (vc 7.1)
// fails to compile one test (test_shared_ptr) without it !!!
// make this protected so it can be called from a derived archive
template<class T>
void save_override(T & t, BOOST_PFTO int){
this->basic_binary_oarchive<Archive>::save_override(t, 0L);
}
void init(unsigned int flags) {
if(0 != (flags & no_header))
return;
#if ! defined(__MWERKS__)
this->basic_binary_oarchive<Archive>::init();
this->basic_binary_oprimitive<Archive, Elem, Tr>::init();
#else
basic_binary_oarchive<Archive>::init();
basic_binary_oprimitive<Archive, Elem, Tr>::init();
#endif
}
binary_oarchive_impl(
std::basic_streambuf<Elem, Tr> & bsb,
unsigned int flags
) :
basic_binary_oprimitive<Archive, Elem, Tr>(
bsb,
0 != (flags & no_codecvt)
),
basic_binary_oarchive<Archive>(flags)
{
init(flags);
}
binary_oarchive_impl(
std::basic_ostream<Elem, Tr> & os,
unsigned int flags
) :
basic_binary_oprimitive<Archive, Elem, Tr>(
* os.rdbuf(),
0 != (flags & no_codecvt)
),
basic_binary_oarchive<Archive>(flags)
{
init(flags);
}
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP
#ifndef BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP
#define BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_wiarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#ifdef BOOST_NO_STD_WSTREAMBUF
#error "wide char i/o not supported on this platform"
#else
#include <istream> // wistream
#include <boost/archive/binary_iarchive_impl.hpp>
#include <boost/archive/detail/register_archive.hpp>
namespace boost {
namespace archive {
// same as binary_wiarchive below - without the shared_ptr_helper
class naked_binary_wiarchive :
public binary_iarchive_impl<
boost::archive::naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>
{
public:
naked_binary_wiarchive(std::wistream & is, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>(is, flags)
{}
naked_binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>(bsb, flags)
{}
};
} // namespace archive
} // namespace boost
// note special treatment of shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
namespace boost {
namespace archive {
class binary_wiarchive :
public binary_iarchive_impl<
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
>
{
public:
binary_wiarchive(std::wistream & is, unsigned int flags = 0) :
binary_iarchive_impl<
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
>(is, flags)
{}
binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
binary_iarchive_impl<
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
>(bsb, flags)
{}
};
} // namespace archive
} // namespace boost
// required by export
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_wiarchive)
#endif // BOOST_NO_STD_WSTREAMBUF
#endif // BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP
#define BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_woarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#ifdef BOOST_NO_STD_WSTREAMBUF
#error "wide char i/o not supported on this platform"
#else
#include <ostream>
#include <boost/archive/binary_oarchive_impl.hpp>
#include <boost/archive/detail/register_archive.hpp>
namespace boost {
namespace archive {
// do not derive from this class. If you want to extend this functionality
// via inhertance, derived from binary_oarchive_impl instead. This will
// preserve correct static polymorphism.
class binary_woarchive :
public binary_oarchive_impl<
binary_woarchive, std::wostream::char_type, std::wostream::traits_type
>
{
public:
binary_woarchive(std::wostream & os, unsigned int flags = 0) :
binary_oarchive_impl<
binary_woarchive, std::wostream::char_type, std::wostream::traits_type
>(os, flags)
{}
binary_woarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
binary_oarchive_impl<
binary_woarchive, std::wostream::char_type, std::wostream::traits_type
>(bsb, flags)
{}
};
typedef binary_woarchive naked_binary_woarchive;
} // namespace archive
} // namespace boost
// required by export
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_woarchive)
#endif // BOOST_NO_STD_WSTREAMBUF
#endif // BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP
#ifndef BOOST_ARCHIVE_CODECVT_NULL_HPP
#define BOOST_ARCHIVE_CODECVT_NULL_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// codecvt_null.hpp:
// (C) Copyright 2004 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <locale>
#include <cstddef> // NULL, size_t
#include <cwchar> // for mbstate_t
#include <boost/config.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std {
// For STLport on WinCE, BOOST_NO_STDC_NAMESPACE can get defined if STLport is putting symbols in its own namespace.
// In the case of codecvt, however, this does not mean that codecvt is in the global namespace (it will be in STLport's namespace)
# if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
using ::codecvt;
# endif
using ::mbstate_t;
using ::size_t;
} // namespace
#endif
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
template<class Ch>
class codecvt_null;
template<>
class codecvt_null<char> : public std::codecvt<char, char, std::mbstate_t>
{
virtual bool do_always_noconv() const throw() {
return true;
}
public:
explicit codecvt_null(std::size_t no_locale_manage = 0) :
std::codecvt<char, char, std::mbstate_t>(no_locale_manage)
{}
};
template<>
class codecvt_null<wchar_t> : public std::codecvt<wchar_t, char, std::mbstate_t>
{
virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result)
do_out(
std::mbstate_t & state,
const wchar_t * first1,
const wchar_t * last1,
const wchar_t * & next1,
char * first2,
char * last2,
char * & next2
) const;
virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result)
do_in(
std::mbstate_t & state,
const char * first1,
const char * last1,
const char * & next1,
wchar_t * first2,
wchar_t * last2,
wchar_t * & next2
) const;
virtual int do_encoding( ) const throw( ){
return sizeof(wchar_t) / sizeof(char);
}
virtual int do_max_length( ) const throw( ){
return do_encoding();
}
};
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
#endif //BOOST_ARCHIVE_CODECVT_NULL_HPP
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// abi_prefix.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4251 4231 4660 4275)
#endif
#if defined( __BORLANDC__ )
#pragma nopushoptwarn
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// abi_suffix.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#if defined( __BORLANDC__ )
#pragma nopushoptwarn
#endif
#ifndef BOOST_ARCHIVE_SERIALIZER_MAP_HPP
#define BOOST_ARCHIVE_SERIALIZER_MAP_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// archive_serializer_map.hpp: extenstion of type_info required for
// serialization.
// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// note: this is nothing more than the thinest of wrappers around
// basic_serializer_map so we can have a one map / archive type.
#include <boost/config.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
namespace archive {
namespace detail {
class basic_serializer;
template<class Archive>
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
archive_serializer_map {
public:
static bool insert(const basic_serializer * bs);
static void erase(const basic_serializer * bs);
static const basic_serializer * find(
const boost::serialization::extended_type_info & type_
);
};
} // namespace detail
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // must be the last header
#endif //BOOST_ARCHIVE_SERIALIZER_MAP_HPP
#ifndef BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP
#define BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// auto_link_archive.hpp
//
// (c) Copyright Robert Ramey 2004
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/serialization
//----------------------------------------------------------------------------//
// This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html
// enable automatic library variant selection ------------------------------//
#include <boost/archive/detail/decl.hpp>
#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SERIALIZATION_NO_LIB) \
&& !defined(BOOST_ARCHIVE_SOURCE) && !defined(BOOST_WARCHIVE_SOURCE) \
&& !defined(BOOST_SERIALIZATION_SOURCE)
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
#define BOOST_LIB_NAME boost_serialization
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
# define BOOST_DYN_LINK
#endif
//
// And include the header that does the work:
//
#include <boost/config/auto_link.hpp>
#endif // auto-linking disabled
#endif // BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP
#ifndef BOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP
#define BOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// auto_link_warchive.hpp
//
// (c) Copyright Robert Ramey 2004
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/serialization
//----------------------------------------------------------------------------//
// This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html
// enable automatic library variant selection ------------------------------//
#include <boost/archive/detail/decl.hpp>
#if !defined(BOOST_WARCHIVE_SOURCE) \
&& !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SERIALIZATION_NO_LIB)
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
#define BOOST_LIB_NAME boost_wserialization
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
# define BOOST_DYN_LINK
#endif
//
// And include the header that does the work:
//
#include <boost/config/auto_link.hpp>
#endif // auto-linking disabled
#endif // ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP
#ifndef BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
#define BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_archive_impl.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// can't use this - much as I'd like to as borland doesn't support it
// #include <boost/scoped_ptr.hpp>
#include <set>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
namespace archive {
namespace detail {
//////////////////////////////////////////////////////////////////////
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_archive_impl
{
};
} // namespace detail
} // namespace serialization
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif //BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
#ifndef BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP
#define BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// basic_config.hpp ---------------------------------------------//
// (c) Copyright Robert Ramey 2004
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/serialization
//----------------------------------------------------------------------------//
// This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html
#include <boost/config.hpp>
#ifdef BOOST_HAS_DECLSPEC // defined in config system
// we need to import/export our code only if the user has specifically
// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
// libraries to be dynamically linked, or BOOST_ARCHIVE_DYN_LINK
// if they want just this one to be dynamically linked:
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ARCHIVE_DYN_LINK)
// export if this is our own source, otherwise import:
#ifdef BOOST_ARCHIVE_SOURCE
# define BOOST_ARCHIVE_DECL __declspec(dllexport)
#else
# define BOOST_ARCHIVE_DECL __declspec(dllimport)
#endif // BOOST_ARCHIVE_SOURCE
#endif // DYN_LINK
#endif // BOOST_HAS_DECLSPEC
//
// if BOOST_ARCHIVE_DECL isn't defined yet define it now:
#ifndef BOOST_ARCHIVE_DECL
#define BOOST_ARCHIVE_DECL
#endif
#endif // BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP
#ifndef BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
#define BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_iarchive.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// can't use this - much as I'd like to as borland doesn't support it
// #include <boost/scoped_ptr.hpp>
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
#include <boost/type_traits/broken_compiler_spec.hpp>
#include <boost/serialization/tracking_enum.hpp>
#include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/decl.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
namespace archive {
namespace detail {
class basic_iarchive_impl;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
//////////////////////////////////////////////////////////////////////
// class basic_iarchive - read serialized objects from a input stream
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive :
private boost::noncopyable
{
friend class basic_iarchive_impl;
// hide implementation of this class to minimize header conclusion
// in client code. I couldn't used scoped pointer with borland
// boost::scoped_ptr<basic_iarchive_impl> pimpl;
basic_iarchive_impl * pimpl;
virtual void vload(version_type &t) = 0;
virtual void vload(object_id_type &t) = 0;
virtual void vload(class_id_type &t) = 0;
virtual void vload(class_id_optional_type &t) = 0;
virtual void vload(class_name_type &t) = 0;
virtual void vload(tracking_type &t) = 0;
protected:
basic_iarchive(unsigned int flags);
// account for bogus gcc warning
#if defined(__GNUC__)
virtual
#endif
~basic_iarchive();
public:
// note: NOT part of the public API.
void next_object_pointer(void *t);
void register_basic_serializer(
const basic_iserializer & bis
);
void load_object(
void *t,
const basic_iserializer & bis
);
const basic_pointer_iserializer *
load_pointer(
void * & t,
const basic_pointer_iserializer * bpis_ptr,
const basic_pointer_iserializer * (*finder)(
const boost::serialization::extended_type_info & eti
)
);
// real public API starts here
void
set_library_version(library_version_type archive_library_version);
library_version_type
get_library_version() const;
unsigned int
get_flags() const;
void
reset_object_address(const void * new_address, const void * old_address);
void
delete_created_pointers();
};
} // namespace detail
} // namespace archive
} // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_TT_BROKEN_COMPILER_SPEC(
boost::archive::detail::basic_iarchive
)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP
#ifndef BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP
#define BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_iserializer.hpp: extenstion of type_info required for serialization.
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstdlib> // NULL
#include <boost/config.hpp>
#include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/decl.hpp>
#include <boost/archive/detail/basic_serializer.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
// forward declarations
namespace archive {
namespace detail {
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer :
public basic_serializer
{
private:
basic_pointer_iserializer *m_bpis;
protected:
explicit basic_iserializer(
const boost::serialization::extended_type_info & type
);
// account for bogus gcc warning
#if defined(__GNUC__)
virtual
#endif
~basic_iserializer();
public:
bool serialized_as_pointer() const {
return m_bpis != NULL;
}
void set_bpis(basic_pointer_iserializer *bpis){
m_bpis = bpis;
}
const basic_pointer_iserializer * get_bpis_ptr() const {
return m_bpis;
}
virtual void load_object_data(
basic_iarchive & ar,
void *x,
const unsigned int file_version
) const = 0;
// returns true if class_info should be saved
virtual bool class_info() const = 0 ;
// returns true if objects should be tracked
virtual bool tracking(const unsigned int) const = 0 ;
// returns class version
virtual version_type version() const = 0 ;
// returns true if this class is polymorphic
virtual bool is_polymorphic() const = 0;
virtual void destroy(/*const*/ void *address) const = 0 ;
};
} // namespae detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP
#ifndef BOOST_ARCHIVE_BASIC_OARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_OARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_oarchive.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // NULL
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
#include <boost/type_traits/broken_compiler_spec.hpp>
// can't use this - much as I'd like to as borland doesn't support it
// #include <boost/scoped_ptr.hpp>
#include <boost/archive/basic_archive.hpp>
#include <boost/serialization/tracking_enum.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
namespace archive {
namespace detail {
class basic_oarchive_impl;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
//////////////////////////////////////////////////////////////////////
// class basic_oarchive - write serialized objects to an output stream
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive :
private boost::noncopyable
{
friend class basic_oarchive_impl;
// hide implementation of this class to minimize header conclusion
// in client code. note: borland can't use scoped_ptr
//boost::scoped_ptr<basic_oarchive_impl> pimpl;
basic_oarchive_impl * pimpl;
// overload these to bracket object attributes. Used to implement
// xml archives
virtual void vsave(const version_type t) = 0;
virtual void vsave(const object_id_type t) = 0;
virtual void vsave(const object_reference_type t) = 0;
virtual void vsave(const class_id_type t) = 0;
virtual void vsave(const class_id_optional_type t) = 0;
virtual void vsave(const class_id_reference_type t) = 0;
virtual void vsave(const class_name_type & t) = 0;
virtual void vsave(const tracking_type t) = 0;
protected:
basic_oarchive(unsigned int flags = 0);
// account for bogus gcc warning
#if defined(__GNUC__)
virtual
#endif
~basic_oarchive();
public:
// note: NOT part of the public interface
void register_basic_serializer(
const basic_oserializer & bos
);
void save_object(
const void *x,
const basic_oserializer & bos
);
void save_pointer(
const void * t,
const basic_pointer_oserializer * bpos_ptr
);
void save_null_pointer(){
vsave(NULL_POINTER_TAG);
}
// real public interface starts here
void end_preamble(); // default implementation does nothing
library_version_type get_library_version() const;
unsigned int get_flags() const;
};
} // namespace detail
} // namespace archive
} // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_TT_BROKEN_COMPILER_SPEC(
boost::archive::detail::basic_oarchive
)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif //BOOST_ARCHIVE_BASIC_OARCHIVE_HPP
#ifndef BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP
#define BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_oserializer.hpp: extenstion of type_info required for serialization.
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // NULL
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
#include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/basic_serializer.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
// forward declarations
namespace archive {
namespace detail {
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer :
public basic_serializer
{
private:
basic_pointer_oserializer *m_bpos;
protected:
explicit basic_oserializer(
const boost::serialization::extended_type_info & type_
);
// account for bogus gcc warning
#if defined(__GNUC__)
virtual
#endif
~basic_oserializer();
public:
bool serialized_as_pointer() const {
return m_bpos != NULL;
}
void set_bpos(basic_pointer_oserializer *bpos){
m_bpos = bpos;
}
const basic_pointer_oserializer * get_bpos() const {
return m_bpos;
}
virtual void save_object_data(
basic_oarchive & ar, const void * x
) const = 0;
// returns true if class_info should be saved
virtual bool class_info() const = 0;
// returns true if objects should be tracked
virtual bool tracking(const unsigned int flags) const = 0;
// returns class version
virtual version_type version() const = 0;
// returns true if this class is polymorphic
virtual bool is_polymorphic() const = 0;
};
} // namespace detail
} // namespace serialization
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP
#ifndef BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP
#define BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_pointer_oserializer.hpp: extenstion of type_info required for
// serialization.
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/basic_serializer.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
// forward declarations
namespace archive {
namespace detail {
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer
: public basic_serializer {
protected:
explicit basic_pointer_iserializer(
const boost::serialization::extended_type_info & type_
);
// account for bogus gcc warning
#if defined(__GNUC__)
virtual
#endif
~basic_pointer_iserializer();
public:
virtual const basic_iserializer & get_basic_serializer() const = 0;
virtual void load_object_ptr(
basic_iarchive & ar,
void * & x,
const unsigned int file_version
) const = 0;
};
} // namespace detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP
#ifndef BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP
#define BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_pointer_oserializer.hpp: extenstion of type_info required for
// serialization.
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/basic_serializer.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace serialization {
class extended_type_info;
} // namespace serialization
namespace archive {
namespace detail {
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer :
public basic_serializer
{
protected:
explicit basic_pointer_oserializer(
const boost::serialization::extended_type_info & type_
);
public:
// account for bogus gcc warning
#if defined(__GNUC__)
virtual
#endif
~basic_pointer_oserializer();
virtual const basic_oserializer & get_basic_serializer() const = 0;
virtual void save_object_ptr(
basic_oarchive & ar,
const void * x
) const = 0;
};
} // namespace detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP
#ifndef BOOST_ARCHIVE_BASIC_SERIALIZER_HPP
#define BOOST_ARCHIVE_BASIC_SERIALIZER_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_serializer.hpp: extenstion of type_info required for serialization.
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/assert.hpp>
#include <cstddef> // NULL
#include <boost/noncopyable.hpp>
#include <boost/config.hpp>
#include <boost/serialization/extended_type_info.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
namespace detail {
class basic_serializer :
private boost::noncopyable
{
const boost::serialization::extended_type_info * m_eti;
protected:
explicit basic_serializer(
const boost::serialization::extended_type_info & eti
) :
m_eti(& eti)
{
BOOST_ASSERT(NULL != & eti);
}
public:
inline bool
operator<(const basic_serializer & rhs) const {
// can't compare address since there can be multiple eti records
// for the same type in different execution modules (that is, DLLS)
// leave this here as a reminder not to do this!
// return & lhs.get_eti() < & rhs.get_eti();
return get_eti() < rhs.get_eti();
}
const char * get_debug_info() const {
return m_eti->get_debug_info();
}
const boost::serialization::extended_type_info & get_eti() const {
return * m_eti;
}
};
class basic_serializer_arg : public basic_serializer {
public:
basic_serializer_arg(const serialization::extended_type_info & eti) :
basic_serializer(eti)
{}
};
} // namespace detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_ARCHIVE_BASIC_SERIALIZER_HPP
#ifndef BOOST_SERIALIZER_MAP_HPP
#define BOOST_SERIALIZER_MAP_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_serializer_map.hpp: extenstion of type_info required for serialization.
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <set>
#include <boost/config.hpp>
#include <boost/utility.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace serialization {
class extended_type_info;
}
namespace archive {
namespace detail {
class basic_serializer;
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_serializer_map : public
boost::noncopyable
{
struct type_info_pointer_compare
{
bool operator()(
const basic_serializer * lhs, const basic_serializer * rhs
) const ;
};
typedef std::set<
const basic_serializer *,
type_info_pointer_compare
> map_type;
map_type m_map;
public:
bool insert(const basic_serializer * bs);
void erase(const basic_serializer * bs);
const basic_serializer * find(
const boost::serialization::extended_type_info & type_
) const;
private:
// cw 8.3 requires this
basic_serializer_map& operator=(basic_serializer_map const&);
};
} // namespace detail
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // must be the last header
#endif // BOOST_SERIALIZER_MAP_HPP
#ifndef BOOST_ARCHIVE_DETAIL_CHECK_HPP
#define BOOST_ARCHIVE_DETAIL_CHECK_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#pragma inline_depth(511)
#pragma inline_recursion(on)
#endif
#if defined(__MWERKS__)
#pragma inline_depth(511)
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// check.hpp: interface for serialization system.
// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/greater.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/serialization/static_warning.hpp>
#include <boost/serialization/version.hpp>
#include <boost/serialization/level.hpp>
#include <boost/serialization/tracking.hpp>
#include <boost/serialization/wrapper.hpp>
namespace boost {
namespace archive {
namespace detail {
// checks for objects
template<class T>
inline void check_object_level(){
typedef
BOOST_DEDUCED_TYPENAME mpl::greater_equal<
serialization::implementation_level< T >,
mpl::int_<serialization::primitive_type>
>::type typex;
// trap attempts to serialize objects marked
// not_serializable
BOOST_STATIC_ASSERT(typex::value);
}
template<class T>
inline void check_object_versioning(){
typedef
BOOST_DEDUCED_TYPENAME mpl::or_<
BOOST_DEDUCED_TYPENAME mpl::greater<
serialization::implementation_level< T >,
mpl::int_<serialization::object_serializable>
>,
BOOST_DEDUCED_TYPENAME mpl::equal_to<
serialization::version< T >,
mpl::int_<0>
>
> typex;
// trap attempts to serialize with objects that don't
// save class information in the archive with versioning.
BOOST_STATIC_ASSERT(typex::value);
}
template<class T>
inline void check_object_tracking(){
// presume it has already been determined that
// T is not a const
BOOST_STATIC_ASSERT(! boost::is_const< T >::value);
typedef BOOST_DEDUCED_TYPENAME mpl::equal_to<
serialization::tracking_level< T >,
mpl::int_<serialization::track_never>
>::type typex;
// saving an non-const object of a type not marked "track_never)
// may be an indicator of an error usage of the
// serialization library and should be double checked.
// See documentation on object tracking. Also, see the
// "rationale" section of the documenation
// for motivation for this checking.
BOOST_STATIC_WARNING(typex::value);
}
// checks for pointers
template<class T>
inline void check_pointer_level(){
// we should only invoke this once we KNOW that T
// has been used as a pointer!!
typedef
BOOST_DEDUCED_TYPENAME mpl::or_<
BOOST_DEDUCED_TYPENAME mpl::greater<
serialization::implementation_level< T >,
mpl::int_<serialization::object_serializable>
>,
BOOST_DEDUCED_TYPENAME mpl::not_<
BOOST_DEDUCED_TYPENAME mpl::equal_to<
serialization::tracking_level< T >,
mpl::int_<serialization::track_selectively>
>
>
> typex;
// Address the following when serializing to a pointer:
// a) This type doesn't save class information in the
// archive. That is, the serialization trait implementation
// level <= object_serializable.
// b) Tracking for this type is set to "track selectively"
// in this case, indication that an object is tracked is
// not stored in the archive itself - see level == object_serializable
// but rather the existence of the operation ar >> T * is used to
// infer that an object of this type should be tracked. So, if
// you save via a pointer but don't load via a pointer the operation
// will fail on load without given any valid reason for the failure.
// So if your program traps here, consider changing the
// tracking or implementation level traits - or not
// serializing via a pointer.
BOOST_STATIC_WARNING(typex::value);
}
template<class T>
void inline check_pointer_tracking(){
typedef BOOST_DEDUCED_TYPENAME mpl::greater<
serialization::tracking_level< T >,
mpl::int_<serialization::track_never>
>::type typex;
// serializing an object of a type marked "track_never" through a pointer
// could result in creating more objects than were saved!
BOOST_STATIC_WARNING(typex::value);
}
template<class T>
inline void check_const_loading(){
typedef
BOOST_DEDUCED_TYPENAME mpl::or_<
BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper< T >,
BOOST_DEDUCED_TYPENAME mpl::not_<
BOOST_DEDUCED_TYPENAME boost::is_const< T >
>
>::type typex;
// cannot load data into a "const" object unless it's a
// wrapper around some other non-const object.
BOOST_STATIC_ASSERT(typex::value);
}
} // detail
} // archive
} // boost
#endif // BOOST_ARCHIVE_DETAIL_CHECK_HPP
#ifndef BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
#define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// common_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/archive/detail/basic_iarchive.hpp>
#include <boost/archive/detail/basic_pointer_iserializer.hpp>
#include <boost/archive/detail/interface_iarchive.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
namespace detail {
class extended_type_info;
// note: referred to as Curiously Recurring Template Patter (CRTP)
template<class Archive>
class common_iarchive :
public basic_iarchive,
public interface_iarchive<Archive>
{
friend class interface_iarchive<Archive>;
private:
virtual void vload(version_type & t){
* this->This() >> t;
}
virtual void vload(object_id_type & t){
* this->This() >> t;
}
virtual void vload(class_id_type & t){
* this->This() >> t;
}
virtual void vload(class_id_optional_type & t){
* this->This() >> t;
}
virtual void vload(tracking_type & t){
* this->This() >> t;
}
virtual void vload(class_name_type &s){
* this->This() >> s;
}
protected:
// default processing - invoke serialization library
template<class T>
void load_override(T & t, BOOST_PFTO int){
archive::load(* this->This(), t);
}
// default implementations of functions which emit start/end tags for
// archive types that require them.
void load_start(const char * /*name*/){}
void load_end(const char * /*name*/){}
// default archive initialization
common_iarchive(unsigned int flags = 0) :
basic_iarchive(flags),
interface_iarchive<Archive>()
{}
};
} // namespace detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP
#ifndef BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
#define BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// common_oarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#include <boost/archive/detail/basic_oarchive.hpp>
#include <boost/archive/detail/interface_oarchive.hpp>
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace archive {
namespace detail {
// note: referred to as Curiously Recurring Template Patter (CRTP)
template<class Archive>
class common_oarchive :
public basic_oarchive,
public interface_oarchive<Archive>
{
friend class interface_oarchive<Archive>;
private:
virtual void vsave(const version_type t){
* this->This() << t;
}
virtual void vsave(const object_id_type t){
* this->This() << t;
}
virtual void vsave(const object_reference_type t){
* this->This() << t;
}
virtual void vsave(const class_id_type t){
* this->This() << t;
}
virtual void vsave(const class_id_reference_type t){
* this->This() << t;
}
virtual void vsave(const class_id_optional_type t){
* this->This() << t;
}
virtual void vsave(const class_name_type & t){
* this->This() << t;
}
virtual void vsave(const tracking_type t){
* this->This() << t;
}
protected:
// default processing - invoke serialization library
template<class T>
void save_override(T & t, BOOST_PFTO int){
archive::save(* this->This(), t);
}
void save_start(const char * /*name*/){}
void save_end(const char * /*name*/){}
common_oarchive(unsigned int flags = 0) :
basic_oarchive(flags),
interface_oarchive<Archive>()
{}
};
} // namespace detail
} // namespace archive
} // namespace boost
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif // BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
#ifndef BOOST_ARCHIVE_DETAIL_DECL_HPP
#define BOOST_ARCHIVE_DETAIL_DECL_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2///////// 3/////////4/////////5/////////6/////////7/////////8
// decl.hpp
//
// (c) Copyright Robert Ramey 2004
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/serialization
//----------------------------------------------------------------------------//
// This header implements separate compilation features as described in
// http://www.boost.org/more/separate_compilation.html
#include <boost/config.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#if defined(BOOST_HAS_DECLSPEC)
#if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK))
#if defined(BOOST_ARCHIVE_SOURCE)
#if defined(__BORLANDC__)
#define BOOST_ARCHIVE_DECL(T) T __export
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export
#else
#define BOOST_ARCHIVE_DECL(T) __declspec(dllexport) T
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T
#endif
#else
#if defined(__BORLANDC__)
#define BOOST_ARCHIVE_DECL(T) T __import
#else
#define BOOST_ARCHIVE_DECL(T) __declspec(dllimport) T
#endif
#endif
#if defined(BOOST_WARCHIVE_SOURCE)
#if defined(__BORLANDC__)
#define BOOST_WARCHIVE_DECL(T) T __export
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export
#else
#define BOOST_WARCHIVE_DECL(T) __declspec(dllexport) T
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T
#endif
#else
#if defined(__BORLANDC__)
#define BOOST_WARCHIVE_DECL(T) T __import
#else
#define BOOST_WARCHIVE_DECL(T) __declspec(dllimport) T
#endif
#endif
#if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE)
#if defined(__BORLANDC__)
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __import
#else
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllimport) T
#endif
#endif
#endif
#endif // BOOST_HAS_DECLSPEC
#if ! defined(BOOST_ARCHIVE_DECL)
#define BOOST_ARCHIVE_DECL(T) T
#endif
#if ! defined(BOOST_WARCHIVE_DECL)
#define BOOST_WARCHIVE_DECL(T) T
#endif
#if ! defined(BOOST_ARCHIVE_OR_WARCHIVE_DECL)
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T
#endif
#endif // BOOST_ARCHIVE_DETAIL_DECL_HPP
#ifndef BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP
#define BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// interface_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // NULL
#include <boost/cstdint.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/iserializer.hpp>
#include <boost/serialization/singleton.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
namespace detail {
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
template<class Archive>
class interface_iarchive
{
protected:
interface_iarchive(){};
public:
/////////////////////////////////////////////////////////
// archive public interface
typedef mpl::bool_<true> is_loading;
typedef mpl::bool_<false> is_saving;
// return a pointer to the most derived class
Archive * This(){
return static_cast<Archive *>(this);
}
template<class T>
const basic_pointer_iserializer *
register_type(T * = NULL){
const basic_pointer_iserializer & bpis =
boost::serialization::singleton<
pointer_iserializer<Archive, T>
>::get_const_instance();
this->This()->register_basic_serializer(bpis.get_basic_serializer());
return & bpis;
}
template<class T>
Archive & operator>>(T & t){
this->This()->load_override(t, 0);
return * this->This();
}
// the & operator
template<class T>
Archive & operator&(T & t){
return *(this->This()) >> t;
}
};
} // namespace detail
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP
#ifndef BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP
#define BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// interface_oarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // NULL
#include <boost/cstdint.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/oserializer.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#include <boost/serialization/singleton.hpp>
namespace boost {
namespace archive {
namespace detail {
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
template<class Archive>
class interface_oarchive
{
protected:
interface_oarchive(){};
public:
/////////////////////////////////////////////////////////
// archive public interface
typedef mpl::bool_<false> is_loading;
typedef mpl::bool_<true> is_saving;
// return a pointer to the most derived class
Archive * This(){
return static_cast<Archive *>(this);
}
template<class T>
const basic_pointer_oserializer *
register_type(const T * = NULL){
const basic_pointer_oserializer & bpos =
boost::serialization::singleton<
pointer_oserializer<Archive, T>
>::get_const_instance();
this->This()->register_basic_serializer(bpos.get_basic_serializer());
return & bpos;
}
template<class T>
Archive & operator<<(T & t){
this->This()->save_override(t, 0);
return * this->This();
}
// the & operator
template<class T>
Archive & operator&(T & t){
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
return * this->This() << const_cast<const T &>(t);
#else
return * this->This() << t;
#endif
}
};
} // namespace detail
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
// Distributed under 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)
#ifndef BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP
#define BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP
#define BOOST_UTF8_BEGIN_NAMESPACE \
namespace boost { namespace archive { namespace detail {
#define BOOST_UTF8_DECL
#define BOOST_UTF8_END_NAMESPACE }}}
#include <boost/detail/utf8_codecvt_facet.hpp>
#undef BOOST_UTF8_END_NAMESPACE
#undef BOOST_UTF8_DECL
#undef BOOST_UTF8_BEGIN_NAMESPACE
#endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment