QxOrm 1.4.9
C++ Object Relational Mapping library
Loading...
Searching...
No Matches
is_smart_ptr.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_SMART_PTR_H_
33#define _QX_IS_SMART_PTR_H_
34
35#ifdef _MSC_VER
36#pragma once
37#endif
38
58
59namespace qx {
60namespace trait {
61
66template <typename T>
67struct is_smart_ptr : public std::false_type { ; };
68
69#ifdef _QX_ENABLE_BOOST
70
71template <typename T>
72struct is_smart_ptr< boost::shared_ptr<T> > : public std::true_type { ; };
73
74template <typename T>
75struct is_smart_ptr< boost::shared_ptr<T> & > : public std::true_type { ; };
76
77template <typename T>
78struct is_smart_ptr< const boost::shared_ptr<T> > : public std::true_type { ; };
79
80template <typename T>
81struct is_smart_ptr< const boost::shared_ptr<T> & > : public std::true_type { ; };
82
83template <typename T>
84struct is_smart_ptr< boost::intrusive_ptr<T> > : public std::true_type { ; };
85
86template <typename T>
87struct is_smart_ptr< boost::intrusive_ptr<T> & > : public std::true_type { ; };
88
89template <typename T>
90struct is_smart_ptr< const boost::intrusive_ptr<T> > : public std::true_type { ; };
91
92template <typename T>
93struct is_smart_ptr< const boost::intrusive_ptr<T> & > : public std::true_type { ; };
94
95template <typename T>
96struct is_smart_ptr< boost::scoped_ptr<T> > : public std::true_type { ; };
97
98template <typename T>
99struct is_smart_ptr< boost::scoped_ptr<T> & > : public std::true_type { ; };
100
101template <typename T>
102struct is_smart_ptr< const boost::scoped_ptr<T> > : public std::true_type { ; };
103
104template <typename T>
105struct is_smart_ptr< const boost::scoped_ptr<T> & > : public std::true_type { ; };
106
107template <typename T>
108struct is_smart_ptr< boost::weak_ptr<T> > : public std::true_type { ; };
109
110template <typename T>
111struct is_smart_ptr< boost::weak_ptr<T> & > : public std::true_type { ; };
112
113template <typename T>
114struct is_smart_ptr< const boost::weak_ptr<T> > : public std::true_type { ; };
115
116template <typename T>
117struct is_smart_ptr< const boost::weak_ptr<T> & > : public std::true_type { ; };
118
119#endif // _QX_ENABLE_BOOST
120
121#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
122
123template <typename T>
124struct is_smart_ptr< QScopedPointer<T> > : public std::true_type { ; };
125
126template <typename T>
127struct is_smart_ptr< QScopedPointer<T> & > : public std::true_type { ; };
128
129template <typename T>
130struct is_smart_ptr< const QScopedPointer<T> > : public std::true_type { ; };
131
132template <typename T>
133struct is_smart_ptr< const QScopedPointer<T> & > : public std::true_type { ; };
134
135#endif // (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
136
137template <typename T>
138struct is_smart_ptr< QSharedDataPointer<T> > : public std::true_type { ; };
139
140template <typename T>
141struct is_smart_ptr< QSharedDataPointer<T> & > : public std::true_type { ; };
142
143template <typename T>
144struct is_smart_ptr< const QSharedDataPointer<T> > : public std::true_type { ; };
145
146template <typename T>
147struct is_smart_ptr< const QSharedDataPointer<T> & > : public std::true_type { ; };
148
149template <typename T>
150struct is_smart_ptr< QSharedPointer<T> > : public std::true_type { ; };
151
152template <typename T>
153struct is_smart_ptr< QSharedPointer<T> & > : public std::true_type { ; };
154
155template <typename T>
156struct is_smart_ptr< const QSharedPointer<T> > : public std::true_type { ; };
157
158template <typename T>
159struct is_smart_ptr< const QSharedPointer<T> & > : public std::true_type { ; };
160
161template <typename T>
162struct is_smart_ptr< QWeakPointer<T> > : public std::true_type { ; };
163
164template <typename T>
165struct is_smart_ptr< QWeakPointer<T> & > : public std::true_type { ; };
166
167template <typename T>
168struct is_smart_ptr< const QWeakPointer<T> > : public std::true_type { ; };
169
170template <typename T>
171struct is_smart_ptr< const QWeakPointer<T> & > : public std::true_type { ; };
172
173template <typename T>
174struct is_smart_ptr< qx::dao::ptr<T> > : public std::true_type { ; };
175
176template <typename T>
177struct is_smart_ptr< qx::dao::ptr<T> & > : public std::true_type { ; };
178
179template <typename T>
180struct is_smart_ptr< const qx::dao::ptr<T> > : public std::true_type { ; };
181
182template <typename T>
183struct is_smart_ptr< const qx::dao::ptr<T> & > : public std::true_type { ; };
184
185template <typename T>
186struct is_smart_ptr< std::shared_ptr<T> > : public std::true_type { ; };
187
188template <typename T>
189struct is_smart_ptr< std::shared_ptr<T> & > : public std::true_type { ; };
190
191template <typename T>
192struct is_smart_ptr< const std::shared_ptr<T> > : public std::true_type { ; };
193
194template <typename T>
195struct is_smart_ptr< const std::shared_ptr<T> & > : public std::true_type { ; };
196
197template <typename T>
198struct is_smart_ptr< std::unique_ptr<T> > : public std::true_type { ; };
199
200template <typename T>
201struct is_smart_ptr< std::unique_ptr<T> & > : public std::true_type { ; };
202
203template <typename T>
204struct is_smart_ptr< const std::unique_ptr<T> > : public std::true_type { ; };
205
206template <typename T>
207struct is_smart_ptr< const std::unique_ptr<T> & > : public std::true_type { ; };
208
209template <typename T>
210struct is_smart_ptr< std::weak_ptr<T> > : public std::true_type { ; };
211
212template <typename T>
213struct is_smart_ptr< std::weak_ptr<T> & > : public std::true_type { ; };
214
215template <typename T>
216struct is_smart_ptr< const std::weak_ptr<T> > : public std::true_type { ; };
217
218template <typename T>
219struct is_smart_ptr< const std::weak_ptr<T> & > : public std::true_type { ; };
220
221} // namespace trait
222} // namespace qx
223
224#endif // _QX_IS_SMART_PTR_H_
qx::dao::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) wi...
qx::trait::is_boost_intrusive_ptr<T>::value : return true if T is a boost::intrusive_ptr<> smart-poin...
qx::trait::is_boost_scoped_ptr<T>::value : return true if T is a boost::scoped_ptr<> smart-pointer,...
qx::trait::is_boost_shared_ptr<T>::value : return true if T is a boost::shared_ptr<> smart-pointer,...
qx::trait::is_boost_weak_ptr<T>::value : return true if T is a boost::weak_ptr<> smart-pointer,...
qx::trait::is_qt_scoped_ptr<T>::value : return true if T is a QScopedPointer<> smart-pointer of Qt li...
qx::trait::is_qt_shared_data_ptr<T>::value : return true if T is a QSharedDataPointer<> smart-pointer...
qx::trait::is_qt_shared_ptr<T>::value : return true if T is a QSharedPointer<> smart-pointer of Qt li...
qx::trait::is_qt_weak_ptr<T>::value : return true if T is a QWeakPointer<> smart-pointer of Qt librar...
qx::trait::is_qx_dao_ptr<T>::value : return true if T is a qx::dao::ptr<> smart-pointer of QxOrm libr...
qx::trait::is_std_shared_ptr<T>::value : return true if T is a std::shared_ptr<> smart-pointer,...
qx::trait::is_std_unique_ptr<T>::value : return true if T is a std::unique_ptr<> smart-pointer,...
qx::trait::is_std_weak_ptr<T>::value : return true if T is a std::weak_ptr<> smart-pointer,...
Root namespace for all QxOrm library features.
qx::trait::is_smart_ptr<T>::value : return true if T is a smart-pointer of boost, Qt or QxOrm librari...