QxOrm  1.5.0
C++ Object Relational Mapping library
QxSerializeQDataStream_boost_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
00033 #ifndef _QX_SERIALIZE_QDATASTREAM_BOOST_TUPLE_H_
00034 #define _QX_SERIALIZE_QDATASTREAM_BOOST_TUPLE_H_
00035 
00036 #ifdef _MSC_VER
00037 #pragma once
00038 #endif
00039 
00047 #include <QtCore/qdatastream.h>
00048 
00049 template <typename T0, typename T1>
00050 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1> & t)
00051 {
00052    stream << boost::get<0>(t);
00053    stream << boost::get<1>(t);
00054    return stream;
00055 }
00056 
00057 template <typename T0, typename T1, typename T2>
00058 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1, T2> & t)
00059 {
00060    stream << boost::get<0>(t);
00061    stream << boost::get<1>(t);
00062    stream << boost::get<2>(t);
00063    return stream;
00064 }
00065 
00066 template <typename T0, typename T1, typename T2, typename T3>
00067 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1, T2, T3> & t)
00068 {
00069    stream << boost::get<0>(t);
00070    stream << boost::get<1>(t);
00071    stream << boost::get<2>(t);
00072    stream << boost::get<3>(t);
00073    return stream;
00074 }
00075 
00076 template <typename T0, typename T1, typename T2, typename T3, typename T4>
00077 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1, T2, T3, T4> & t)
00078 {
00079    stream << boost::get<0>(t);
00080    stream << boost::get<1>(t);
00081    stream << boost::get<2>(t);
00082    stream << boost::get<3>(t);
00083    stream << boost::get<4>(t);
00084    return stream;
00085 }
00086 
00087 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
00088 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1, T2, T3, T4, T5> & t)
00089 {
00090    stream << boost::get<0>(t);
00091    stream << boost::get<1>(t);
00092    stream << boost::get<2>(t);
00093    stream << boost::get<3>(t);
00094    stream << boost::get<4>(t);
00095    stream << boost::get<5>(t);
00096    return stream;
00097 }
00098 
00099 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
00100 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1, T2, T3, T4, T5, T6> & t)
00101 {
00102    stream << boost::get<0>(t);
00103    stream << boost::get<1>(t);
00104    stream << boost::get<2>(t);
00105    stream << boost::get<3>(t);
00106    stream << boost::get<4>(t);
00107    stream << boost::get<5>(t);
00108    stream << boost::get<6>(t);
00109    return stream;
00110 }
00111 
00112 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
00113 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & t)
00114 {
00115    stream << boost::get<0>(t);
00116    stream << boost::get<1>(t);
00117    stream << boost::get<2>(t);
00118    stream << boost::get<3>(t);
00119    stream << boost::get<4>(t);
00120    stream << boost::get<5>(t);
00121    stream << boost::get<6>(t);
00122    stream << boost::get<7>(t);
00123    return stream;
00124 }
00125 
00126 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
00127 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> & t)
00128 {
00129    stream << boost::get<0>(t);
00130    stream << boost::get<1>(t);
00131    stream << boost::get<2>(t);
00132    stream << boost::get<3>(t);
00133    stream << boost::get<4>(t);
00134    stream << boost::get<5>(t);
00135    stream << boost::get<6>(t);
00136    stream << boost::get<7>(t);
00137    stream << boost::get<8>(t);
00138    return stream;
00139 }
00140 
00141 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
00142 QDataStream & operator<< (QDataStream & stream, const boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & t)
00143 {
00144    stream << boost::get<0>(t);
00145    stream << boost::get<1>(t);
00146    stream << boost::get<2>(t);
00147    stream << boost::get<3>(t);
00148    stream << boost::get<4>(t);
00149    stream << boost::get<5>(t);
00150    stream << boost::get<6>(t);
00151    stream << boost::get<7>(t);
00152    stream << boost::get<8>(t);
00153    stream << boost::get<9>(t);
00154    return stream;
00155 }
00156 
00157 template <typename T0, typename T1>
00158 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1> & t)
00159 {
00160    stream >> boost::get<0>(t);
00161    stream >> boost::get<1>(t);
00162    return stream;
00163 }
00164 
00165 template <typename T0, typename T1, typename T2>
00166 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1, T2> & t)
00167 {
00168    stream >> boost::get<0>(t);
00169    stream >> boost::get<1>(t);
00170    stream >> boost::get<2>(t);
00171    return stream;
00172 }
00173 
00174 template <typename T0, typename T1, typename T2, typename T3>
00175 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1, T2, T3> & t)
00176 {
00177    stream >> boost::get<0>(t);
00178    stream >> boost::get<1>(t);
00179    stream >> boost::get<2>(t);
00180    stream >> boost::get<3>(t);
00181    return stream;
00182 }
00183 
00184 template <typename T0, typename T1, typename T2, typename T3, typename T4>
00185 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1, T2, T3, T4> & t)
00186 {
00187    stream >> boost::get<0>(t);
00188    stream >> boost::get<1>(t);
00189    stream >> boost::get<2>(t);
00190    stream >> boost::get<3>(t);
00191    stream >> boost::get<4>(t);
00192    return stream;
00193 }
00194 
00195 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
00196 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1, T2, T3, T4, T5> & t)
00197 {
00198    stream >> boost::get<0>(t);
00199    stream >> boost::get<1>(t);
00200    stream >> boost::get<2>(t);
00201    stream >> boost::get<3>(t);
00202    stream >> boost::get<4>(t);
00203    stream >> boost::get<5>(t);
00204    return stream;
00205 }
00206 
00207 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
00208 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1, T2, T3, T4, T5, T6> & t)
00209 {
00210    stream >> boost::get<0>(t);
00211    stream >> boost::get<1>(t);
00212    stream >> boost::get<2>(t);
00213    stream >> boost::get<3>(t);
00214    stream >> boost::get<4>(t);
00215    stream >> boost::get<5>(t);
00216    stream >> boost::get<6>(t);
00217    return stream;
00218 }
00219 
00220 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
00221 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & t)
00222 {
00223    stream >> boost::get<0>(t);
00224    stream >> boost::get<1>(t);
00225    stream >> boost::get<2>(t);
00226    stream >> boost::get<3>(t);
00227    stream >> boost::get<4>(t);
00228    stream >> boost::get<5>(t);
00229    stream >> boost::get<6>(t);
00230    stream >> boost::get<7>(t);
00231    return stream;
00232 }
00233 
00234 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
00235 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> & t)
00236 {
00237    stream >> boost::get<0>(t);
00238    stream >> boost::get<1>(t);
00239    stream >> boost::get<2>(t);
00240    stream >> boost::get<3>(t);
00241    stream >> boost::get<4>(t);
00242    stream >> boost::get<5>(t);
00243    stream >> boost::get<6>(t);
00244    stream >> boost::get<7>(t);
00245    stream >> boost::get<8>(t);
00246    return stream;
00247 }
00248 
00249 template <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
00250 QDataStream & operator>> (QDataStream & stream, boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & t)
00251 {
00252    stream >> boost::get<0>(t);
00253    stream >> boost::get<1>(t);
00254    stream >> boost::get<2>(t);
00255    stream >> boost::get<3>(t);
00256    stream >> boost::get<4>(t);
00257    stream >> boost::get<5>(t);
00258    stream >> boost::get<6>(t);
00259    stream >> boost::get<7>(t);
00260    stream >> boost::get<8>(t);
00261    stream >> boost::get<9>(t);
00262    return stream;
00263 }
00264 
00265 #endif // _QX_SERIALIZE_QDATASTREAM_BOOST_TUPLE_H_
00266 #endif // _QX_ENABLE_BOOST