/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// oserializer.hpp: interface for serialization system.
-// (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/mpl/identity.hpp>
#include <boost/mpl/bool_fwd.hpp>
-#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
- #include <boost/serialization/extended_type_info_typeid.hpp>
+#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
+ #include <boost/serialization/extended_type_info_typeid.hpp>
#endif
#include <boost/serialization/throw_exception.hpp>
#include <boost/serialization/smart_cast.hpp>
class oserializer : public basic_oserializer
{
private:
- // private constructor to inhibit any existence other than the
+ // private constructor to inhibit any existence other than the
// static one
public:
explicit BOOST_DLLEXPORT oserializer() :
basic_oserializer(
boost::serialization::singleton<
- typename
+ typename
boost::serialization::type_info_implementation< T >::type
>::get_const_instance()
)
{}
virtual BOOST_DLLEXPORT void save_object_data(
- basic_oarchive & ar,
+ basic_oarchive & ar,
const void *x
) const BOOST_USED;
virtual bool class_info() const {
- return boost::serialization::implementation_level< T >::value
+ return boost::serialization::implementation_level< T >::value
>= boost::serialization::object_class_info;
}
virtual bool tracking(const unsigned int /* flags */) const {
template<class Archive, class T>
BOOST_DLLEXPORT void oserializer<Archive, T>::save_object_data(
- basic_oarchive & ar,
+ basic_oarchive & ar,
const void *x
) const {
// make sure call is routed through the highest interface that might
public basic_pointer_oserializer
{
private:
- const basic_oserializer &
+ const basic_oserializer &
get_basic_serializer() const {
return boost::serialization::singleton<
oserializer<Archive, T>
// be specialized by the user.
T * t = static_cast<T *>(const_cast<void *>(x));
const unsigned int file_version = boost::serialization::version< T >::value;
- Archive & ar_impl
+ Archive & ar_impl
= boost::serialization::smart_cast_reference<Archive &>(ar);
boost::serialization::save_construct_data_adl<Archive, T>(
- ar_impl,
- t,
+ ar_impl,
+ t,
file_version
);
ar_impl << boost::serialization::make_nvp(NULL, * t);
pointer_oserializer<Archive, T>::pointer_oserializer() :
basic_pointer_oserializer(
boost::serialization::singleton<
- typename
+ typename
boost::serialization::type_info_implementation< T >::type
>::get_const_instance()
)
{
// make sure appropriate member function is instantiated
boost::serialization::singleton<
- oserializer<Archive, T>
+ oserializer<Archive, T>
>::get_mutable_instance().set_bpos(this);
archive_serializer_map<Archive>::insert(this);
}
// make sure call is routed through the highest interface that might
// be specialized by the user.
boost::serialization::serialize_adl(
- ar,
- const_cast<T &>(t),
+ ar,
+ const_cast<T &>(t),
::boost::serialization::version< T >::value
);
}
template<class T>
static void invoke(Archive & ar, const T & t){
- typedef
+ typedef
typename mpl::eval_if<
// if its primitive
mpl::equal_to<
// else
// do a fast save only tracking is turned off
mpl::identity<save_conditional>
- > > >::type typex;
+ > > >::type typex;
check_object_versioning< T >();
typex::invoke(ar, t);
}
template<class T>
static const basic_pointer_oserializer * register_type(Archive &ar, T* const /*t*/){
- // there should never be any need to save an abstract polymorphic
+ // there should never be any need to save an abstract polymorphic
// class pointer. Inhibiting code generation for this
// permits abstract base classes to be used - note: exception
// virtual serialize functions used for plug-ins
- typedef
+ typedef
typename mpl::eval_if<
boost::serialization::is_abstract< T >,
mpl::identity<abstract>,
- mpl::identity<non_abstract>
+ mpl::identity<non_abstract>
>::type typex;
return typex::template register_type< T >(ar);
}
{
template<class T>
static void save(
- Archive &ar,
+ Archive &ar,
T & t
){
- const basic_pointer_oserializer & bpos =
+ const basic_pointer_oserializer & bpos =
boost::serialization::singleton<
pointer_oserializer<Archive, T>
>::get_const_instance();
{
template<class T>
static void save(
- Archive &ar,
+ Archive &ar,
T & t
){
- typename
+ typename
boost::serialization::type_info_implementation< T >::type const
& i = boost::serialization::singleton<
- typename
+ typename
boost::serialization::type_info_implementation< T >::type
>::get_const_instance();
// convert pointer to more derived type. if this is thrown
// it means that the base/derived relationship hasn't be registered
vp = serialization::void_downcast(
- *true_type,
- *this_type,
+ *true_type,
+ *this_type,
static_cast<const void *>(&t)
);
if(NULL == vp){
);
}
- // since true_type is valid, and this only gets made if the
+ // since true_type is valid, and this only gets made if the
// pointer oserializer object has been created, this should never
// fail
const basic_pointer_oserializer * bpos
template<class T>
static void save(
- Archive & ar,
+ Archive & ar,
const T & t
){
check_pointer_level< T >();
static void invoke(Archive &ar, const TPtr t){
register_type(ar, t);
if(NULL == t){
- basic_oarchive & boa
+ basic_oarchive & boa
= boost::serialization::smart_cast_reference<basic_oarchive &>(ar);
boa.save_null_pointer();
save_access::end_preamble(ar);
template<class T>
static void invoke(Archive &ar, const T &t){
typedef typename boost::remove_extent< T >::type value_type;
-
+
save_access::end_preamble(ar);
// consider alignment
std::size_t c = sizeof(t) / (
- static_cast<const char *>(static_cast<const void *>(&t[1]))
+ static_cast<const char *>(static_cast<const void *>(&t[1]))
- static_cast<const char *>(static_cast<const void *>(&t[0]))
);
boost::serialization::collection_size_type count(c);
template<class Archive, class T>
inline void save(Archive & ar, /*const*/ T &t){
- typedef
+ typedef
typename mpl::eval_if<is_pointer< T >,
mpl::identity<detail::save_pointer_type<Archive> >,
//else