QxOrm  1.5.0
C++ Object Relational Mapping library
is_equal.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_TRAIT_IS_EQUAL_H_
00033 #define _QX_TRAIT_IS_EQUAL_H_
00034 
00035 #ifdef _MSC_VER
00036 #pragma once
00037 #endif
00038 
00046 #include <QtCore/qstring.h>
00047 #include <QtCore/qdatetime.h>
00048 #include <QtCore/qvariant.h>
00049 #include <QtCore/qbytearray.h>
00050 #include <QtCore/qpoint.h>
00051 #include <QtCore/qrect.h>
00052 #include <QtCore/qsize.h>
00053 #include <QtCore/qurl.h>
00054 #include <QtCore/quuid.h>
00055 #include <QtCore/qsharedpointer.h>
00056 
00057 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00058 #include <QtCore/qregexp.h>
00059 #endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00060 
00061 #ifdef _QX_ENABLE_QT_GUI
00062 #include <QtGui/qcolor.h>
00063 #include <QtGui/qfont.h>
00064 #include <QtGui/qimage.h>
00065 #include <QtGui/qbrush.h>
00066 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00067 #include <QtGui/qmatrix.h>
00068 #endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00069 #include <QtGui/qregion.h>
00070 #endif // _QX_ENABLE_QT_GUI
00071 
00072 #include <QxDao/QxDaoPointer.h>
00073 
00074 namespace qx {
00075 namespace trait {
00076 
00081 template <typename T>
00082 struct has_operator_equal_equal
00083 { enum { value = std::is_pointer<T>::value }; };
00084 
00085 } // namespace trait
00086 } // namespace qx
00087 
00088 #define QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(className) \
00089 namespace qx { namespace trait { \
00090 template <> \
00091 struct has_operator_equal_equal< className > { enum { value = true }; }; \
00092 } } // namespace qx::trait
00093 
00094 #define QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(className) \
00095 namespace qx { namespace trait { \
00096 template <typename T> \
00097 struct has_operator_equal_equal< className<T> > { enum { value = true }; }; \
00098 } } // namespace qx::trait
00099 
00100 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(bool)
00101 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(int)
00102 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(short)
00103 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(long)
00104 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(float)
00105 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(double)
00106 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(long double)
00107 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(char)
00108 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned int)
00109 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned short)
00110 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned long)
00111 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned char)
00112 
00113 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(std::string)
00114 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(std::wstring)
00115 
00116 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QString)
00117 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QByteArray)
00118 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QDate)
00119 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QDateTime)
00120 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QPoint)
00121 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRect)
00122 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QSize)
00123 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QTime)
00124 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QUrl)
00125 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QVariant)
00126 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QUuid)
00127 
00128 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00129 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRegExp)
00130 #endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00131 
00132 #ifdef _QX_ENABLE_QT_GUI
00133 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QColor)
00134 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QFont)
00135 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QImage)
00136 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QBrush)
00137 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00138 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QMatrix)
00139 #endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
00140 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRegion)
00141 #endif // _QX_ENABLE_QT_GUI
00142 
00143 #ifdef _QX_ENABLE_BOOST
00144 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(boost::shared_ptr)
00145 #endif // _QX_ENABLE_BOOST
00146 
00147 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(QSharedPointer)
00148 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(QWeakPointer)
00149 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(qx::dao::ptr)
00150 
00151 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(std::shared_ptr)
00152 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(std::weak_ptr)
00153 
00154 #endif // _QX_TRAIT_IS_EQUAL_H_