QxOrm  1.5.0
C++ Object Relational Mapping library
is_container.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 #ifndef _QX_IS_CONTAINER_H_
00033 #define _QX_IS_CONTAINER_H_
00034 
00035 #ifdef _MSC_VER
00036 #pragma once
00037 #endif
00038 
00046 #include <QxTraits/is_boost_unordered_map.h>
00047 #include <QxTraits/is_boost_unordered_set.h>
00048 #include <QxTraits/is_qt_hash.h>
00049 #include <QxTraits/is_qt_linked_list.h>
00050 #include <QxTraits/is_qt_list.h>
00051 #include <QxTraits/is_qt_map.h>
00052 #include <QxTraits/is_qt_multi_hash.h>
00053 #include <QxTraits/is_qt_multi_map.h>
00054 #include <QxTraits/is_qt_set.h>
00055 #include <QxTraits/is_qt_vector.h>
00056 #include <QxTraits/is_qx_collection.h>
00057 #include <QxTraits/is_std_list.h>
00058 #include <QxTraits/is_std_map.h>
00059 #include <QxTraits/is_std_set.h>
00060 #include <QxTraits/is_std_vector.h>
00061 #include <QxTraits/is_std_unordered_map.h>
00062 #include <QxTraits/is_std_unordered_set.h>
00063 
00064 #include <QxCollection/QxCollection.h>
00065 
00066 namespace qx {
00067 namespace trait {
00068 
00073 template <typename T>
00074 struct is_container : public std::false_type { ; };
00075 
00076 #ifdef _QX_ENABLE_BOOST
00077 
00078 template <typename Key, typename Value>
00079 struct is_container< boost::unordered_map<Key, Value> > : public std::true_type { ; };
00080 
00081 template <typename Key, typename Value>
00082 struct is_container< boost::unordered_map<Key, Value> & > : public std::true_type { ; };
00083 
00084 template <typename Key, typename Value>
00085 struct is_container< const boost::unordered_map<Key, Value> > : public std::true_type { ; };
00086 
00087 template <typename Key, typename Value>
00088 struct is_container< const boost::unordered_map<Key, Value> & > : public std::true_type { ; };
00089 
00090 template <typename Key, typename Value>
00091 struct is_container< boost::unordered_multimap<Key, Value> > : public std::true_type { ; };
00092 
00093 template <typename Key, typename Value>
00094 struct is_container< boost::unordered_multimap<Key, Value> & > : public std::true_type { ; };
00095 
00096 template <typename Key, typename Value>
00097 struct is_container< const boost::unordered_multimap<Key, Value> > : public std::true_type { ; };
00098 
00099 template <typename Key, typename Value>
00100 struct is_container< const boost::unordered_multimap<Key, Value> & > : public std::true_type { ; };
00101 
00102 template <typename T>
00103 struct is_container< boost::unordered_set<T> > : public std::true_type { ; };
00104 
00105 template <typename T>
00106 struct is_container< boost::unordered_set<T> & > : public std::true_type { ; };
00107 
00108 template <typename T>
00109 struct is_container< const boost::unordered_set<T> > : public std::true_type { ; };
00110 
00111 template <typename T>
00112 struct is_container< const boost::unordered_set<T> & > : public std::true_type { ; };
00113 
00114 template <typename T>
00115 struct is_container< boost::unordered_multiset<T> > : public std::true_type { ; };
00116 
00117 template <typename T>
00118 struct is_container< boost::unordered_multiset<T> & > : public std::true_type { ; };
00119 
00120 template <typename T>
00121 struct is_container< const boost::unordered_multiset<T> > : public std::true_type { ; };
00122 
00123 template <typename T>
00124 struct is_container< const boost::unordered_multiset<T> & > : public std::true_type { ; };
00125 
00126 #endif // _QX_ENABLE_BOOST
00127 
00128 template <typename Key, typename Value>
00129 struct is_container< QHash<Key, Value> > : public std::true_type { ; };
00130 
00131 template <typename Key, typename Value>
00132 struct is_container< QHash<Key, Value> & > : public std::true_type { ; };
00133 
00134 template <typename Key, typename Value>
00135 struct is_container< const QHash<Key, Value> > : public std::true_type { ; };
00136 
00137 template <typename Key, typename Value>
00138 struct is_container< const QHash<Key, Value> & > : public std::true_type { ; };
00139 
00140 #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
00141 template <typename T>
00142 struct is_container< QLinkedList<T> > : public std::true_type { ; };
00143 
00144 template <typename T>
00145 struct is_container< QLinkedList<T> & > : public std::true_type { ; };
00146 
00147 template <typename T>
00148 struct is_container< const QLinkedList<T> > : public std::true_type { ; };
00149 
00150 template <typename T>
00151 struct is_container< const QLinkedList<T> & > : public std::true_type { ; };
00152 #endif // (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
00153 
00154 template <typename T>
00155 struct is_container< QList<T> > : public std::true_type { ; };
00156 
00157 template <typename T>
00158 struct is_container< QList<T> & > : public std::true_type { ; };
00159 
00160 template <typename T>
00161 struct is_container< const QList<T> > : public std::true_type { ; };
00162 
00163 template <typename T>
00164 struct is_container< const QList<T> & > : public std::true_type { ; };
00165 
00166 template <typename Key, typename Value>
00167 struct is_container< QMap<Key, Value> > : public std::true_type { ; };
00168 
00169 template <typename Key, typename Value>
00170 struct is_container< QMap<Key, Value> & > : public std::true_type { ; };
00171 
00172 template <typename Key, typename Value>
00173 struct is_container< const QMap<Key, Value> > : public std::true_type { ; };
00174 
00175 template <typename Key, typename Value>
00176 struct is_container< const QMap<Key, Value> & > : public std::true_type { ; };
00177 
00178 template <typename Key, typename Value>
00179 struct is_container< QMultiHash<Key, Value> > : public std::true_type { ; };
00180 
00181 template <typename Key, typename Value>
00182 struct is_container< QMultiHash<Key, Value> & > : public std::true_type { ; };
00183 
00184 template <typename Key, typename Value>
00185 struct is_container< const QMultiHash<Key, Value> > : public std::true_type { ; };
00186 
00187 template <typename Key, typename Value>
00188 struct is_container< const QMultiHash<Key, Value> & > : public std::true_type { ; };
00189 
00190 template <typename Key, typename Value>
00191 struct is_container< QMultiMap<Key, Value> > : public std::true_type { ; };
00192 
00193 template <typename Key, typename Value>
00194 struct is_container< QMultiMap<Key, Value> & > : public std::true_type { ; };
00195 
00196 template <typename Key, typename Value>
00197 struct is_container< const QMultiMap<Key, Value> > : public std::true_type { ; };
00198 
00199 template <typename Key, typename Value>
00200 struct is_container< const QMultiMap<Key, Value> & > : public std::true_type { ; };
00201 
00202 template <typename T>
00203 struct is_container< QSet<T> > : public std::true_type { ; };
00204 
00205 template <typename T>
00206 struct is_container< QSet<T> & > : public std::true_type { ; };
00207 
00208 template <typename T>
00209 struct is_container< const QSet<T> > : public std::true_type { ; };
00210 
00211 template <typename T>
00212 struct is_container< const QSet<T> & > : public std::true_type { ; };
00213 
00214 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00215 template <typename T>
00216 struct is_container< QVector<T> > : public std::true_type { ; };
00217 
00218 template <typename T>
00219 struct is_container< QVector<T> & > : public std::true_type { ; };
00220 
00221 template <typename T>
00222 struct is_container< const QVector<T> > : public std::true_type { ; };
00223 
00224 template <typename T>
00225 struct is_container< const QVector<T> & > : public std::true_type { ; };
00226 #endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00227 
00228 template <typename Key, typename Value>
00229 struct is_container< qx::QxCollection<Key, Value> > : public std::true_type { ; };
00230 
00231 template <typename Key, typename Value>
00232 struct is_container< qx::QxCollection<Key, Value> & > : public std::true_type { ; };
00233 
00234 template <typename Key, typename Value>
00235 struct is_container< const qx::QxCollection<Key, Value> > : public std::true_type { ; };
00236 
00237 template <typename Key, typename Value>
00238 struct is_container< const qx::QxCollection<Key, Value> & > : public std::true_type { ; };
00239 
00240 template <typename T>
00241 struct is_container< std::list<T> > : public std::true_type { ; };
00242 
00243 template <typename T>
00244 struct is_container< std::list<T> & > : public std::true_type { ; };
00245 
00246 template <typename T>
00247 struct is_container< const std::list<T> > : public std::true_type { ; };
00248 
00249 template <typename T>
00250 struct is_container< const std::list<T> & > : public std::true_type { ; };
00251 
00252 template <typename Key, typename Value>
00253 struct is_container< std::map<Key, Value> > : public std::true_type { ; };
00254 
00255 template <typename Key, typename Value>
00256 struct is_container< std::map<Key, Value> & > : public std::true_type { ; };
00257 
00258 template <typename Key, typename Value>
00259 struct is_container< const std::map<Key, Value> > : public std::true_type { ; };
00260 
00261 template <typename Key, typename Value>
00262 struct is_container< const std::map<Key, Value> & > : public std::true_type { ; };
00263 
00264 template <typename T>
00265 struct is_container< std::set<T> > : public std::true_type { ; };
00266 
00267 template <typename T>
00268 struct is_container< std::set<T> & > : public std::true_type { ; };
00269 
00270 template <typename T>
00271 struct is_container< const std::set<T> > : public std::true_type { ; };
00272 
00273 template <typename T>
00274 struct is_container< const std::set<T> & > : public std::true_type { ; };
00275 
00276 template <typename T>
00277 struct is_container< std::vector<T> > : public std::true_type { ; };
00278 
00279 template <typename T>
00280 struct is_container< std::vector<T> & > : public std::true_type { ; };
00281 
00282 template <typename T>
00283 struct is_container< const std::vector<T> > : public std::true_type { ; };
00284 
00285 template <typename T>
00286 struct is_container< const std::vector<T> & > : public std::true_type { ; };
00287 
00288 template <typename Key, typename Value>
00289 struct is_container< std::unordered_map<Key, Value> > : public std::true_type { ; };
00290 
00291 template <typename Key, typename Value>
00292 struct is_container< std::unordered_map<Key, Value> & > : public std::true_type { ; };
00293 
00294 template <typename Key, typename Value>
00295 struct is_container< const std::unordered_map<Key, Value> > : public std::true_type { ; };
00296 
00297 template <typename Key, typename Value>
00298 struct is_container< const std::unordered_map<Key, Value> & > : public std::true_type { ; };
00299 
00300 template <typename Key, typename Value>
00301 struct is_container< std::unordered_multimap<Key, Value> > : public std::true_type { ; };
00302 
00303 template <typename Key, typename Value>
00304 struct is_container< std::unordered_multimap<Key, Value> & > : public std::true_type { ; };
00305 
00306 template <typename Key, typename Value>
00307 struct is_container< const std::unordered_multimap<Key, Value> > : public std::true_type { ; };
00308 
00309 template <typename Key, typename Value>
00310 struct is_container< const std::unordered_multimap<Key, Value> & > : public std::true_type { ; };
00311 
00312 template <typename T>
00313 struct is_container< std::unordered_set<T> > : public std::true_type { ; };
00314 
00315 template <typename T>
00316 struct is_container< std::unordered_set<T> & > : public std::true_type { ; };
00317 
00318 template <typename T>
00319 struct is_container< const std::unordered_set<T> > : public std::true_type { ; };
00320 
00321 template <typename T>
00322 struct is_container< const std::unordered_set<T> & > : public std::true_type { ; };
00323 
00324 template <typename T>
00325 struct is_container< std::unordered_multiset<T> > : public std::true_type { ; };
00326 
00327 template <typename T>
00328 struct is_container< std::unordered_multiset<T> & > : public std::true_type { ; };
00329 
00330 template <typename T>
00331 struct is_container< const std::unordered_multiset<T> > : public std::true_type { ; };
00332 
00333 template <typename T>
00334 struct is_container< const std::unordered_multiset<T> & > : public std::true_type { ; };
00335 
00336 } // namespace trait
00337 } // namespace qx
00338 
00339 #endif // _QX_IS_CONTAINER_H_