| QxOrm 1.5.0 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

QxSerialize_std_tuple.h
Go to the documentation of this file.

    00001 /****************************************************************************
    00002 **
    00003 ** https://www.qxorm.com/
    00004 ** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
    00005 **
    00006 ** This file is part of the QxOrm library
    00007 **
    00008 ** This software is provided 'as-is', without any express or implied
    00009 ** warranty. In no event will the authors be held liable for any
    00010 ** damages arising from the use of this software
    00011 **
    00012 ** Commercial Usage
    00013 ** Licensees holding valid commercial QxOrm licenses may use this file in
    00014 ** accordance with the commercial license agreement provided with the
    00015 ** Software or, alternatively, in accordance with the terms contained in
    00016 ** a written agreement between you and Lionel Marty
    00017 **
    00018 ** GNU General Public License Usage
    00019 ** Alternatively, this file may be used under the terms of the GNU
    00020 ** General Public License version 3.0 as published by the Free Software
    00021 ** Foundation and appearing in the file 'license.gpl3.txt' included in the
    00022 ** packaging of this file. Please review the following information to
    00023 ** ensure the GNU General Public License version 3.0 requirements will be
    00024 ** met : http://www.gnu.org/copyleft/gpl.html
    00025 **
    00026 ** If you are unsure which license is appropriate for your use, or
    00027 ** if you have questions regarding the use of this file, please contact :
    00028 ** contact@qxorm.com
    00029 **
    00030 ****************************************************************************/
    00031
    00032 #ifdef _QX_ENABLE_BOOST_SERIALIZATION
    00033 #ifndef _QX_SERIALIZE_STD_TUPLE_H_
    00034 #define _QX_SERIALIZE_STD_TUPLE_H_
    00035
    00036 #ifdef _MSC_VER
    00037 #pragma once
    00038 #endif
    00039
    00040 #include <boost/serialization/serialization.hpp>
    00041 #include <boost/serialization/split_free.hpp>
    00042 #include <boost/serialization/nvp.hpp>
    00043
    00044 namespace boost {
    00045 namespace serialization {
    00046
    00047 template <class Archive, typename T0, typename T1>
    00048 inline void serialize(Archive & ar, std::tuple<T0, T1> & t, const unsigned int file_version)
    00049 {
    00050    Q_UNUSED(file_version);
    00051    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00052    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00053 }
    00054
    00055 template <class Archive, typename T0, typename T1, typename T2>
    00056 inline void serialize(Archive & ar, std::tuple<T0, T1, T2> & t, const unsigned int file_version)
    00057 {
    00058    Q_UNUSED(file_version);
    00059    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00060    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00061    ar & boost::serialization::make_nvp("tuple_3", std::get<2>(t));
    00062 }
    00063
    00064 template <class Archive, typename T0, typename T1, typename T2, typename T3>
    00065 inline void serialize(Archive & ar, std::tuple<T0, T1, T2, T3> & t, const unsigned int file_version)
    00066 {
    00067    Q_UNUSED(file_version);
    00068    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00069    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00070    ar & boost::serialization::make_nvp("tuple_3", std::get<2>(t));
    00071    ar & boost::serialization::make_nvp("tuple_4", std::get<3>(t));
    00072 }
    00073
    00074 template <class Archive, typename T0, typename T1, typename T2, typename T3, typename T4>
    00075 inline void serialize(Archive & ar, std::tuple<T0, T1, T2, T3, T4> & t, const unsigned int file_version)
    00076 {
    00077    Q_UNUSED(file_version);
    00078    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00079    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00080    ar & boost::serialization::make_nvp("tuple_3", std::get<2>(t));
    00081    ar & boost::serialization::make_nvp("tuple_4", std::get<3>(t));
    00082    ar & boost::serialization::make_nvp("tuple_5", std::get<4>(t));
    00083 }
    00084
    00085 template <class Archive, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
    00086 inline void serialize(Archive & ar, std::tuple<T0, T1, T2, T3, T4, T5> & t, const unsigned int file_version)
    00087 {
    00088    Q_UNUSED(file_version);
    00089    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00090    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00091    ar & boost::serialization::make_nvp("tuple_3", std::get<2>(t));
    00092    ar & boost::serialization::make_nvp("tuple_4", std::get<3>(t));
    00093    ar & boost::serialization::make_nvp("tuple_5", std::get<4>(t));
    00094    ar & boost::serialization::make_nvp("tuple_6", std::get<5>(t));
    00095 }
    00096
    00097 template <class Archive, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
    00098 inline void serialize(Archive & ar, std::tuple<T0, T1, T2, T3, T4, T5, T6> & t, const unsigned int file_version)
    00099 {
    00100    Q_UNUSED(file_version);
    00101    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00102    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00103    ar & boost::serialization::make_nvp("tuple_3", std::get<2>(t));
    00104    ar & boost::serialization::make_nvp("tuple_4", std::get<3>(t));
    00105    ar & boost::serialization::make_nvp("tuple_5", std::get<4>(t));
    00106    ar & boost::serialization::make_nvp("tuple_6", std::get<5>(t));
    00107    ar & boost::serialization::make_nvp("tuple_7", std::get<6>(t));
    00108 }
    00109
    00110 template <class Archive, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
    00111 inline void serialize(Archive & ar, std::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & t, const unsigned int file_version)
    00112 {
    00113    Q_UNUSED(file_version);
    00114    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00115    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00116    ar & boost::serialization::make_nvp("tuple_3", std::get<2>(t));
    00117    ar & boost::serialization::make_nvp("tuple_4", std::get<3>(t));
    00118    ar & boost::serialization::make_nvp("tuple_5", std::get<4>(t));
    00119    ar & boost::serialization::make_nvp("tuple_6", std::get<5>(t));
    00120    ar & boost::serialization::make_nvp("tuple_7", std::get<6>(t));
    00121    ar & boost::serialization::make_nvp("tuple_8", std::get<7>(t));
    00122 }
    00123
    00124 template <class Archive, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
    00125 inline void serialize(Archive & ar, std::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> & t, const unsigned int file_version)
    00126 {
    00127    Q_UNUSED(file_version);
    00128    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00129    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00130    ar & boost::serialization::make_nvp("tuple_3", std::get<2>(t));
    00131    ar & boost::serialization::make_nvp("tuple_4", std::get<3>(t));
    00132    ar & boost::serialization::make_nvp("tuple_5", std::get<4>(t));
    00133    ar & boost::serialization::make_nvp("tuple_6", std::get<5>(t));
    00134    ar & boost::serialization::make_nvp("tuple_7", std::get<6>(t));
    00135    ar & boost::serialization::make_nvp("tuple_8", std::get<7>(t));
    00136    ar & boost::serialization::make_nvp("tuple_9", std::get<8>(t));
    00137 }
    00138
    00139 template <class Archive, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
    00140 inline void serialize(Archive & ar, std::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & t, const unsigned int file_version)
    00141 {
    00142    Q_UNUSED(file_version);
    00143    ar & boost::serialization::make_nvp("tuple_1", std::get<0>(t));
    00144    ar & boost::serialization::make_nvp("tuple_2", std::get<1>(t));
    00145    ar & boost::serialization::make_nvp("tuple_3", std::get<2>(t));
    00146    ar & boost::serialization::make_nvp("tuple_4", std::get<3>(t));
    00147    ar & boost::serialization::make_nvp("tuple_5", std::get<4>(t));
    00148    ar & boost::serialization::make_nvp("tuple_6", std::get<5>(t));
    00149    ar & boost::serialization::make_nvp("tuple_7", std::get<6>(t));
    00150    ar & boost::serialization::make_nvp("tuple_8", std::get<7>(t));
    00151    ar & boost::serialization::make_nvp("tuple_9", std::get<8>(t));
    00152    ar & boost::serialization::make_nvp("tuple_10", std::get<9>(t));
    00153 }
    00154
    00155 } // namespace boost
    00156 } // namespace serialization
    00157
    00158 #endif // _QX_SERIALIZE_STD_TUPLE_H_
    00159 #endif // _QX_ENABLE_BOOST_SERIALIZATION