// implementation of basic_text_iprimitive overrides for the combination
// of template parameters used to implement a text_iprimitive
+#ifndef BOOST_HEADER_GUARD_ARCHIVE_SERIALIZER_MAP_IPP
+#define BOOST_HEADER_GUARD_ARCHIVE_SERIALIZER_MAP_IPP
+
#include <boost/config.hpp>
#include <boost/archive/detail/archive_serializer_map.hpp>
#include <boost/archive/detail/basic_serializer_map.hpp>
namespace { // anon
template<class Archive>
- class map : public basic_serializer_map
+ class map : public basic_serializer_map
{};
}
}
template<class Archive>
-BOOST_ARCHIVE_OR_WARCHIVE_DECL(const basic_serializer *)
+BOOST_ARCHIVE_OR_WARCHIVE_DECL(const basic_serializer *)
archive_serializer_map<Archive>::find(
const boost::serialization::extended_type_info & eti
) {
} // namespace detail
} // namespace archive
} // namespace boost
+
+#endif // BOOST_HEADER_GUARD_ARCHIVE_SERIALIZER_MAP_IPP
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// remove_whitespace.hpp
-// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2002, 2010 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)
// here is the default standard implementation of the functor used
// by the filter iterator to remove spaces. Unfortunately usage
// of this implementation in combination with spirit trips a bug
-// VC 6.5. The only way I can find to work around it is to
+// VC 6.5. The only way I can find to work around it is to
// implement a special non-standard version for this platform
#ifndef BOOST_NO_CWCTYPE
//#endif // BOOST_WORKAROUND
-namespace { // anonymous
-
template<class CharType>
struct remove_whitespace_predicate;
};
#endif
-} // namespace anonymous
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// convert base64 file data (including whitespace and padding) to binary
-namespace boost {
+namespace boost {
namespace archive {
namespace iterators {
m_full = false;
++(this->base_reference());
}
- filter_iterator(Base start) :
- super_t(start),
+ filter_iterator(Base start) :
+ super_t(start),
m_full(false)
{}
filter_iterator(){}
};
template<class Base>
-class remove_whitespace :
+class remove_whitespace :
public filter_iterator<
remove_whitespace_predicate<BOOST_DEDUCED_TYPENAME Base::value_type>,
Base
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast<T>(start))))
{}
// intel 7.1 doesn't like default copy constructor
- remove_whitespace(const remove_whitespace & rhs) :
+ remove_whitespace(const remove_whitespace & rhs) :
super_t(rhs.base_reference())
{}
};
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_archive.cpp:
-// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (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)
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
-namespace std{
- using ::size_t;
+namespace std{
+ using ::size_t;
} // namespace std
#endif
loaded_as_pointer(false),
class_id(class_id_)
{}
- aobject() :
+ aobject() :
address(NULL),
loaded_as_pointer(false),
- class_id(-2)
+ class_id(-2)
{}
};
typedef std::vector<aobject> object_id_vector_type;
object_id_type moveable_objects_recent;
void reset_object_address(
- const void * new_address,
+ const void * new_address,
const void *old_address
);
cobject_type(
std::size_t class_id,
const basic_iserializer & bis
- ) :
+ ) :
m_bis(& bis),
m_class_id(class_id)
{}
- cobject_type(const cobject_type & rhs) :
+ cobject_type(const cobject_type & rhs) :
m_bis(rhs.m_bis),
m_class_id(rhs.m_class_id)
{}
//////////////////////////////////////////////////////////////////////
// information about each serialized class indexed on class_id
- class cobject_id
+ class cobject_id
{
public:
cobject_id & operator=(const cobject_id & rhs){
tracking_level(track_never),
initialized(false)
{}
- cobject_id(const cobject_id &rhs):
+ cobject_id(const cobject_id &rhs):
bis_ptr(rhs.bis_ptr),
bpis_ptr(rhs.bpis_ptr),
file_version(rhs.file_version),
);
const basic_pointer_iserializer * load_pointer(
basic_iarchive & ar,
- void * & t,
+ void * & t,
const basic_pointer_iserializer * bpis,
const basic_pointer_iserializer * (*finder)(
const boost::serialization::extended_type_info & type
);
};
-inline void
+inline void
basic_iarchive_impl::reset_object_address(
- const void * new_address,
+ const void * new_address,
const void *old_address
){
// this code handles a couple of situations.
// but expected to work on all platforms in current usage
if(object_id_vector[i].address > old_address){
std::size_t member_displacement
- = reinterpret_cast<std::size_t>(object_id_vector[i].address)
+ = reinterpret_cast<std::size_t>(object_id_vector[i].address)
- reinterpret_cast<std::size_t>(old_address);
object_id_vector[i].address = reinterpret_cast<void *>(
reinterpret_cast<std::size_t>(new_address) + member_displacement
else{
std::size_t member_displacement
= reinterpret_cast<std::size_t>(old_address)
- - reinterpret_cast<std::size_t>(object_id_vector[i].address);
+ - reinterpret_cast<std::size_t>(object_id_vector[i].address);
object_id_vector[i].address = reinterpret_cast<void *>(
reinterpret_cast<std::size_t>(new_address) - member_displacement
);
}
}
-inline void
+inline void
basic_iarchive_impl::delete_created_pointers()
{
object_id_vector_type::iterator i;
for(
i = object_id_vector.begin();
- i != object_id_vector.end();
+ i != object_id_vector.end();
++i
){
if(i->loaded_as_pointer){
const int j = i->class_id;
const cobject_id & co = cobject_id_vector[j];
//const cobject_id & co = cobject_id_vector[i->class_id];
- // with the appropriate input serializer,
+ // with the appropriate input serializer,
// delete the indicated object
co.bis_ptr->destroy(i->address);
}
const basic_iserializer & bis
){
assert(
- cobject_info_set.size()
- <=
+ class_id_type(cobject_info_set.size())
+ <=
boost::integer_traits<class_id_type>::const_max
);
class_id_type cid(static_cast<class_id_type>(
this_id = object_id_vector.size();
// if we tracked this object when the archive was saved
- if(tracking){
+ if(tracking){
// if it was already read
if(!track(ar, t))
// we're done
}
assert(
- cobject_info_set.size()
- <=
+ class_id_type(cobject_info_set.size())
+ <=
boost::integer_traits<class_id_type>::const_max
);
// if its a new class type - i.e. never been registered
object_id_vector.push_back(aobject(t, cid));
bpis_ptr->load_object_ptr(
- ar,
- object_id_vector[ui].address,
+ ar,
+ object_id_vector[ui].address,
co.file_version
);
t = object_id_vector[ui].address;
}
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
-basic_iarchive::basic_iarchive(unsigned int flags) :
+basic_iarchive::basic_iarchive(unsigned int flags) :
pimpl(new basic_iarchive_impl(flags))
{}
BOOST_ARCHIVE_DECL(void)
basic_iarchive::reset_object_address(
- const void * new_address,
+ const void * new_address,
const void * old_address
){
pimpl->reset_object_address(new_address, old_address);
BOOST_ARCHIVE_DECL(void)
basic_iarchive::load_object(
- void *t,
+ void *t,
const basic_iserializer & bis
){
pimpl->load_object(*this, t, bis);
// load a pointer object
BOOST_ARCHIVE_DECL(const basic_pointer_iserializer *)
basic_iarchive::load_pointer(
- void * &t,
+ void * &t,
const basic_pointer_iserializer * bpis_ptr,
const basic_pointer_iserializer * (*finder)(
const boost::serialization::extended_type_info & type_
pimpl->delete_created_pointers();
}
-BOOST_ARCHIVE_DECL(unsigned int)
+BOOST_ARCHIVE_DECL(unsigned int)
basic_iarchive::get_library_version() const{
return pimpl->m_archive_library_version;
}
-BOOST_ARCHIVE_DECL(unsigned int)
+BOOST_ARCHIVE_DECL(unsigned int)
basic_iarchive::get_flags() const{
return pimpl->m_flags;
}
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_oarchive.cpp:
-// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2002, 2010 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)
// the following cannot be defined because of the const
// member. This will generate a link error if an attempt
// is made to assign. This should never be necessary
- // use this only for lookup argument
+ // use this only for lookup argument
cobject_type & operator=(const cobject_type &rhs);
bool operator<(const cobject_type &rhs) const {
return *m_bos_ptr < *(rhs.m_bos_ptr);
const cobject_type &
find(const basic_oserializer & bos);
- const basic_oserializer *
+ const basic_oserializer *
find(const serialization::extended_type_info &ti) const;
//public:
);
void save_pointer(
basic_oarchive & ar,
- const void * t,
+ const void * t,
const basic_pointer_oserializer * bpos
);
};
# pragma warning(push)
# pragma warning(disable : 4511 4512)
#endif
- class bosarg :
+ class bosarg :
public basic_oserializer
{
bool class_info() const {
- assert(false);
+ assert(false);
return false;
}
// returns true if objects should be tracked
assert(false);
return false;
}
- void save_object_data(
+ void save_object_data(
basic_oarchive & /*ar*/, const void * /*x*/
) const {
assert(false);
#pragma warning(pop)
#endif
bosarg bos(ti);
- cobject_info_set_type::const_iterator cit
+ cobject_info_set_type::const_iterator cit
= cobject_info_set.find(cobject_type(bos));
// it should already have been "registered" - see below
if(cit == cobject_info_set.end()){
// if an entry is not found in the table it is because a pointer
// of a derived class has been serialized through its base class
- // but the derived class hasn't been "registered"
+ // but the derived class hasn't been "registered"
return NULL;
}
// return pointer to the real class
basic_oarchive_impl::find(const basic_oserializer & bos)
{
assert(
- cobject_info_set.size()
- <=
+ class_id_type(cobject_info_set.size())
+ <=
boost::integer_traits<class_id_type>::const_max
);
- std::pair<cobject_info_set_type::iterator, bool> cresult =
+ std::pair<cobject_info_set_type::iterator, bool> cresult =
cobject_info_set.insert(cobject_type(cobject_info_set.size(), bos));
return *(cresult.first);
}
const basic_oserializer & bos
){
assert(
- cobject_info_set.size()
- <=
+ class_id_type(cobject_info_set.size())
+ <=
boost::integer_traits<class_id_type>::const_max
);
cobject_type co(cobject_info_set.size(), bos);
inline void
basic_oarchive_impl::save_pointer(
basic_oarchive & ar,
- const void * t,
+ const void * t,
const basic_pointer_oserializer * bpos_ptr
){
const basic_oserializer & bos = bpos_ptr->get_basic_serializer();
const cobject_type & co = register_type(bos);
if(! co.m_initialized){
ar.vsave(co.m_class_id);
- // if its a previously unregistered class
+ // if its a previously unregistered class
if((cobject_info_set.size() > original_count)){
if(bos.is_polymorphic()){
const serialization::extended_type_info *eti = & bos.get_eti();
namespace archive {
namespace detail {
-BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
+BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
basic_oarchive::basic_oarchive(unsigned int flags)
: pimpl(new basic_oarchive_impl(flags))
{}
-BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
+BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
basic_oarchive::~basic_oarchive()
{
delete pimpl;
}
-BOOST_ARCHIVE_DECL(void)
+BOOST_ARCHIVE_DECL(void)
basic_oarchive::save_object(
- const void *x,
+ const void *x,
const basic_oserializer & bos
){
pimpl->save_object(*this, x, bos);
}
-BOOST_ARCHIVE_DECL(void)
+BOOST_ARCHIVE_DECL(void)
basic_oarchive::save_pointer(
- const void * t,
+ const void * t,
const basic_pointer_oserializer * bpos_ptr
){
pimpl->save_pointer(*this, t, bpos_ptr);
}
-BOOST_ARCHIVE_DECL(void)
+BOOST_ARCHIVE_DECL(void)
basic_oarchive::register_basic_serializer(const basic_oserializer & bos){
pimpl->register_type(bos);
}
return pimpl->m_flags;
}
-BOOST_ARCHIVE_DECL(void)
+BOOST_ARCHIVE_DECL(void)
basic_oarchive::end_preamble(){
}