QxOrm  1.4.4
C++ Object Relational Mapping library
is_equal.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** http://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/qregexp.h>
00053 #include <QtCore/qsize.h>
00054 #include <QtCore/qurl.h>
00055 #include <QtCore/quuid.h>
00056 #include <QtCore/qsharedpointer.h>
00057 
00058 #ifdef _QX_ENABLE_QT_GUI
00059 #include <QtGui/qcolor.h>
00060 #include <QtGui/qfont.h>
00061 #include <QtGui/qimage.h>
00062 #include <QtGui/qbrush.h>
00063 #include <QtGui/qmatrix.h>
00064 #include <QtGui/qregion.h>
00065 #endif // _QX_ENABLE_QT_GUI
00066 
00067 #include <QxDao/QxDaoPointer.h>
00068 
00069 namespace qx {
00070 namespace trait {
00071 
00076 template <typename T>
00077 struct has_operator_equal_equal
00078 { enum { value = std::is_pointer<T>::value }; };
00079 
00080 } // namespace trait
00081 } // namespace qx
00082 
00083 #define QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(className) \
00084 namespace qx { namespace trait { \
00085 template <> \
00086 struct has_operator_equal_equal< className > { enum { value = true }; }; \
00087 } } // namespace qx::trait
00088 
00089 #define QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(className) \
00090 namespace qx { namespace trait { \
00091 template <typename T> \
00092 struct has_operator_equal_equal< className<T> > { enum { value = true }; }; \
00093 } } // namespace qx::trait
00094 
00095 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(bool)
00096 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(int)
00097 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(short)
00098 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(long)
00099 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(float)
00100 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(double)
00101 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(long double)
00102 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(char)
00103 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned int)
00104 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned short)
00105 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned long)
00106 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned char)
00107 
00108 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(std::string)
00109 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(std::wstring)
00110 
00111 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QString)
00112 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QByteArray)
00113 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QDate)
00114 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QDateTime)
00115 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QPoint)
00116 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRect)
00117 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRegExp)
00118 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QSize)
00119 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QTime)
00120 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QUrl)
00121 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QVariant)
00122 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QUuid)
00123 
00124 #ifdef _QX_ENABLE_QT_GUI
00125 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QColor)
00126 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QFont)
00127 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QImage)
00128 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QBrush)
00129 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QMatrix)
00130 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRegion)
00131 #endif // _QX_ENABLE_QT_GUI
00132 
00133 #ifdef _QX_ENABLE_BOOST
00134 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(boost::shared_ptr)
00135 #endif // _QX_ENABLE_BOOST
00136 
00137 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(QSharedPointer)
00138 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(QWeakPointer)
00139 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(qx::dao::ptr)
00140 
00141 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(std::shared_ptr)
00142 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(std::weak_ptr)
00143 
00144 #endif // _QX_TRAIT_IS_EQUAL_H_