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