32#ifdef _QX_ENABLE_BOOST_SERIALIZATION
33#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
34#ifndef _QX_SERIALIZE_QSCOPEDPOINTER_H_
35#define _QX_SERIALIZE_QSCOPEDPOINTER_H_
41#include <boost/serialization/serialization.hpp>
42#include <boost/serialization/split_free.hpp>
43#include <boost/serialization/nvp.hpp>
45#include <QtCore/qscopedpointer.h>
48namespace serialization {
50template <
class Archive,
typename T>
51inline void save(Archive & ar,
const QScopedPointer<T> & t,
const unsigned int file_version)
53 Q_UNUSED(file_version);
54 const T * ptr = t.data();
55 ar << boost::serialization::make_nvp(
"qt_scoped_ptr", ptr);
58template <
class Archive,
typename T>
59inline void load(Archive & ar, QScopedPointer<T> & t,
const unsigned int file_version)
61 Q_UNUSED(file_version);
63 ar >> boost::serialization::make_nvp(
"qt_scoped_ptr", ptr);
67template <
class Archive,
typename T>
68inline void serialize(Archive & ar, QScopedPointer<T> & t,
const unsigned int file_version)
70 boost::serialization::split_free(ar, t, file_version);
void serialize(Archive &ar, boost::tuple< T0, T1 > &t, const unsigned int file_version)
void load(Archive &ar, boost::unordered_map< Key, Value > &t, const unsigned int)
void save(Archive &ar, const boost::unordered_map< Key, Value > &t, const unsigned int)