32#ifdef _QX_ENABLE_BOOST_SERIALIZATION
33#ifndef _QX_SERIALIZE_QFLAGS_H_
34#define _QX_SERIALIZE_QFLAGS_H_
40#include <boost/serialization/serialization.hpp>
41#include <boost/serialization/split_free.hpp>
42#include <boost/serialization/nvp.hpp>
44#include <QtCore/qglobal.h>
47namespace serialization {
49template <
class Archive,
typename T>
50inline void save(Archive & ar,
const QFlags<T> & t,
const unsigned int file_version)
52 Q_UNUSED(file_version);
53 int iValue =
static_cast<int>(t);
54 ar << boost::serialization::make_nvp(
"value", iValue);
57template <
class Archive,
typename T>
58inline void load(Archive & ar, QFlags<T> & t,
const unsigned int file_version)
60 Q_UNUSED(file_version);
62 ar >> boost::serialization::make_nvp(
"value", iValue);
63 t = QFlags<T>(QFlag(iValue));
66template <
class Archive,
typename T>
67inline void serialize(Archive & ar, QFlags<T> & t,
const unsigned int file_version)
69 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)