QxOrm 1.4.9
C++ Object Relational Mapping library
Loading...
Searching...
No Matches
is_container.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** https://www.qxorm.com/
4** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
5**
6** This file is part of the QxOrm library
7**
8** This software is provided 'as-is', without any express or implied
9** warranty. In no event will the authors be held liable for any
10** damages arising from the use of this software
11**
12** Commercial Usage
13** Licensees holding valid commercial QxOrm licenses may use this file in
14** accordance with the commercial license agreement provided with the
15** Software or, alternatively, in accordance with the terms contained in
16** a written agreement between you and Lionel Marty
17**
18** GNU General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU
20** General Public License version 3.0 as published by the Free Software
21** Foundation and appearing in the file 'license.gpl3.txt' included in the
22** packaging of this file. Please review the following information to
23** ensure the GNU General Public License version 3.0 requirements will be
24** met : http://www.gnu.org/copyleft/gpl.html
25**
26** If you are unsure which license is appropriate for your use, or
27** if you have questions regarding the use of this file, please contact :
28** contact@qxorm.com
29**
30****************************************************************************/
31
32#ifndef _QX_IS_CONTAINER_H_
33#define _QX_IS_CONTAINER_H_
34
35#ifdef _MSC_VER
36#pragma once
37#endif
38
48#include <QxTraits/is_qt_hash.h>
50#include <QxTraits/is_qt_list.h>
51#include <QxTraits/is_qt_map.h>
54#include <QxTraits/is_qt_set.h>
58#include <QxTraits/is_std_map.h>
59#include <QxTraits/is_std_set.h>
63
65
66namespace qx {
67namespace trait {
68
73template <typename T>
74struct is_container : public std::false_type { ; };
75
76#ifdef _QX_ENABLE_BOOST
77
78template <typename Key, typename Value>
79struct is_container< boost::unordered_map<Key, Value> > : public std::true_type { ; };
80
81template <typename Key, typename Value>
82struct is_container< boost::unordered_map<Key, Value> & > : public std::true_type { ; };
83
84template <typename Key, typename Value>
85struct is_container< const boost::unordered_map<Key, Value> > : public std::true_type { ; };
86
87template <typename Key, typename Value>
88struct is_container< const boost::unordered_map<Key, Value> & > : public std::true_type { ; };
89
90template <typename Key, typename Value>
91struct is_container< boost::unordered_multimap<Key, Value> > : public std::true_type { ; };
92
93template <typename Key, typename Value>
94struct is_container< boost::unordered_multimap<Key, Value> & > : public std::true_type { ; };
95
96template <typename Key, typename Value>
97struct is_container< const boost::unordered_multimap<Key, Value> > : public std::true_type { ; };
98
99template <typename Key, typename Value>
100struct is_container< const boost::unordered_multimap<Key, Value> & > : public std::true_type { ; };
101
102template <typename T>
103struct is_container< boost::unordered_set<T> > : public std::true_type { ; };
104
105template <typename T>
106struct is_container< boost::unordered_set<T> & > : public std::true_type { ; };
107
108template <typename T>
109struct is_container< const boost::unordered_set<T> > : public std::true_type { ; };
110
111template <typename T>
112struct is_container< const boost::unordered_set<T> & > : public std::true_type { ; };
113
114template <typename T>
115struct is_container< boost::unordered_multiset<T> > : public std::true_type { ; };
116
117template <typename T>
118struct is_container< boost::unordered_multiset<T> & > : public std::true_type { ; };
119
120template <typename T>
121struct is_container< const boost::unordered_multiset<T> > : public std::true_type { ; };
122
123template <typename T>
124struct is_container< const boost::unordered_multiset<T> & > : public std::true_type { ; };
125
126#endif // _QX_ENABLE_BOOST
127
128template <typename Key, typename Value>
129struct is_container< QHash<Key, Value> > : public std::true_type { ; };
130
131template <typename Key, typename Value>
132struct is_container< QHash<Key, Value> & > : public std::true_type { ; };
133
134template <typename Key, typename Value>
135struct is_container< const QHash<Key, Value> > : public std::true_type { ; };
136
137template <typename Key, typename Value>
138struct is_container< const QHash<Key, Value> & > : public std::true_type { ; };
139
140#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
141template <typename T>
142struct is_container< QLinkedList<T> > : public std::true_type { ; };
143
144template <typename T>
145struct is_container< QLinkedList<T> & > : public std::true_type { ; };
146
147template <typename T>
148struct is_container< const QLinkedList<T> > : public std::true_type { ; };
149
150template <typename T>
151struct is_container< const QLinkedList<T> & > : public std::true_type { ; };
152#endif // (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
153
154template <typename T>
155struct is_container< QList<T> > : public std::true_type { ; };
156
157template <typename T>
158struct is_container< QList<T> & > : public std::true_type { ; };
159
160template <typename T>
161struct is_container< const QList<T> > : public std::true_type { ; };
162
163template <typename T>
164struct is_container< const QList<T> & > : public std::true_type { ; };
165
166template <typename Key, typename Value>
167struct is_container< QMap<Key, Value> > : public std::true_type { ; };
168
169template <typename Key, typename Value>
170struct is_container< QMap<Key, Value> & > : public std::true_type { ; };
171
172template <typename Key, typename Value>
173struct is_container< const QMap<Key, Value> > : public std::true_type { ; };
174
175template <typename Key, typename Value>
176struct is_container< const QMap<Key, Value> & > : public std::true_type { ; };
177
178template <typename Key, typename Value>
179struct is_container< QMultiHash<Key, Value> > : public std::true_type { ; };
180
181template <typename Key, typename Value>
182struct is_container< QMultiHash<Key, Value> & > : public std::true_type { ; };
183
184template <typename Key, typename Value>
185struct is_container< const QMultiHash<Key, Value> > : public std::true_type { ; };
186
187template <typename Key, typename Value>
188struct is_container< const QMultiHash<Key, Value> & > : public std::true_type { ; };
189
190template <typename Key, typename Value>
191struct is_container< QMultiMap<Key, Value> > : public std::true_type { ; };
192
193template <typename Key, typename Value>
194struct is_container< QMultiMap<Key, Value> & > : public std::true_type { ; };
195
196template <typename Key, typename Value>
197struct is_container< const QMultiMap<Key, Value> > : public std::true_type { ; };
198
199template <typename Key, typename Value>
200struct is_container< const QMultiMap<Key, Value> & > : public std::true_type { ; };
201
202template <typename T>
203struct is_container< QSet<T> > : public std::true_type { ; };
204
205template <typename T>
206struct is_container< QSet<T> & > : public std::true_type { ; };
207
208template <typename T>
209struct is_container< const QSet<T> > : public std::true_type { ; };
210
211template <typename T>
212struct is_container< const QSet<T> & > : public std::true_type { ; };
213
214#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
215template <typename T>
216struct is_container< QVector<T> > : public std::true_type { ; };
217
218template <typename T>
219struct is_container< QVector<T> & > : public std::true_type { ; };
220
221template <typename T>
222struct is_container< const QVector<T> > : public std::true_type { ; };
223
224template <typename T>
225struct is_container< const QVector<T> & > : public std::true_type { ; };
226#endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
227
228template <typename Key, typename Value>
229struct is_container< qx::QxCollection<Key, Value> > : public std::true_type { ; };
230
231template <typename Key, typename Value>
232struct is_container< qx::QxCollection<Key, Value> & > : public std::true_type { ; };
233
234template <typename Key, typename Value>
235struct is_container< const qx::QxCollection<Key, Value> > : public std::true_type { ; };
236
237template <typename Key, typename Value>
238struct is_container< const qx::QxCollection<Key, Value> & > : public std::true_type { ; };
239
240template <typename T>
241struct is_container< std::list<T> > : public std::true_type { ; };
242
243template <typename T>
244struct is_container< std::list<T> & > : public std::true_type { ; };
245
246template <typename T>
247struct is_container< const std::list<T> > : public std::true_type { ; };
248
249template <typename T>
250struct is_container< const std::list<T> & > : public std::true_type { ; };
251
252template <typename Key, typename Value>
253struct is_container< std::map<Key, Value> > : public std::true_type { ; };
254
255template <typename Key, typename Value>
256struct is_container< std::map<Key, Value> & > : public std::true_type { ; };
257
258template <typename Key, typename Value>
259struct is_container< const std::map<Key, Value> > : public std::true_type { ; };
260
261template <typename Key, typename Value>
262struct is_container< const std::map<Key, Value> & > : public std::true_type { ; };
263
264template <typename T>
265struct is_container< std::set<T> > : public std::true_type { ; };
266
267template <typename T>
268struct is_container< std::set<T> & > : public std::true_type { ; };
269
270template <typename T>
271struct is_container< const std::set<T> > : public std::true_type { ; };
272
273template <typename T>
274struct is_container< const std::set<T> & > : public std::true_type { ; };
275
276template <typename T>
277struct is_container< std::vector<T> > : public std::true_type { ; };
278
279template <typename T>
280struct is_container< std::vector<T> & > : public std::true_type { ; };
281
282template <typename T>
283struct is_container< const std::vector<T> > : public std::true_type { ; };
284
285template <typename T>
286struct is_container< const std::vector<T> & > : public std::true_type { ; };
287
288template <typename Key, typename Value>
289struct is_container< std::unordered_map<Key, Value> > : public std::true_type { ; };
290
291template <typename Key, typename Value>
292struct is_container< std::unordered_map<Key, Value> & > : public std::true_type { ; };
293
294template <typename Key, typename Value>
295struct is_container< const std::unordered_map<Key, Value> > : public std::true_type { ; };
296
297template <typename Key, typename Value>
298struct is_container< const std::unordered_map<Key, Value> & > : public std::true_type { ; };
299
300template <typename Key, typename Value>
301struct is_container< std::unordered_multimap<Key, Value> > : public std::true_type { ; };
302
303template <typename Key, typename Value>
304struct is_container< std::unordered_multimap<Key, Value> & > : public std::true_type { ; };
305
306template <typename Key, typename Value>
307struct is_container< const std::unordered_multimap<Key, Value> > : public std::true_type { ; };
308
309template <typename Key, typename Value>
310struct is_container< const std::unordered_multimap<Key, Value> & > : public std::true_type { ; };
311
312template <typename T>
313struct is_container< std::unordered_set<T> > : public std::true_type { ; };
314
315template <typename T>
316struct is_container< std::unordered_set<T> & > : public std::true_type { ; };
317
318template <typename T>
319struct is_container< const std::unordered_set<T> > : public std::true_type { ; };
320
321template <typename T>
322struct is_container< const std::unordered_set<T> & > : public std::true_type { ; };
323
324template <typename T>
325struct is_container< std::unordered_multiset<T> > : public std::true_type { ; };
326
327template <typename T>
328struct is_container< std::unordered_multiset<T> & > : public std::true_type { ; };
329
330template <typename T>
331struct is_container< const std::unordered_multiset<T> > : public std::true_type { ; };
332
333template <typename T>
334struct is_container< const std::unordered_multiset<T> & > : public std::true_type { ; };
335
336} // namespace trait
337} // namespace qx
338
339#endif // _QX_IS_CONTAINER_H_
QxOrm thread-safe container (keep insertion order + quick access by index + quick access by key)
qx::QxCollection<Key, Value> : QxOrm thread-safe container (keep insertion order + quick access by in...
qx::trait::is_boost_unordered_map<T>::value : return true if T is a boost::unordered_map<> or boost::...
qx::trait::is_boost_unordered_set<T>::value : return true if T is a boost::unordered_set<> or boost::...
qx::trait::is_qt_hash<T>::value : return true if T is a QHash<> container of Qt library,...
qx::trait::is_qt_list<T>::value : return true if T is a QList<> container of Qt library,...
qx::trait::is_qt_map<T>::value : return true if T is a QMap<> container of Qt library,...
qx::trait::is_qt_multi_hash<T>::value : return true if T is a QMultiHash<> container of Qt library,...
qx::trait::is_qt_multi_map<T>::value : return true if T is a QMultiMap<> container of Qt library,...
qx::trait::is_qt_set<T>::value : return true if T is a QSet<> container of Qt library,...
qx::trait::is_qt_vector<T>::value : return true if T is a QVector<> container of Qt library,...
qx::trait::is_qx_collection<T>::value : return true if T is a qx::QxCollection<> container of QxOrm l...
qx::trait::is_std_list<T>::value : return true if T is a std::list<> container of stl library,...
qx::trait::is_std_map<T>::value : return true if T is a std::map<> container of stl library,...
qx::trait::is_std_set<T>::value : return true if T is a std::set<> container of stl library,...
qx::trait::is_std_unordered_map<T>::value : return true if T is a std::unordered_map<> or std::unorde...
qx::trait::is_std_unordered_set<T>::value : return true if T is a std::unordered_set<> or std::unorde...
qx::trait::is_std_vector<T>::value : return true if T is a std::vector<> container of stl library,...
Root namespace for all QxOrm library features.
qx::trait::is_container<T>::value : return true if T is a container from stl, boost,...