QxOrm  1.2.6
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 <string>
00047 
00048 #include <boost/shared_ptr.hpp>
00049 #include <boost/type_traits/is_pointer.hpp>
00050 
00051 #include <QtCore/qstring.h>
00052 #include <QtCore/qdatetime.h>
00053 #include <QtCore/qvariant.h>
00054 #include <QtCore/qbytearray.h>
00055 #include <QtCore/qpoint.h>
00056 #include <QtCore/qrect.h>
00057 #include <QtCore/qregexp.h>
00058 #include <QtCore/qsize.h>
00059 #include <QtCore/qurl.h>
00060 #include <QtCore/quuid.h>
00061 #include <QtCore/qsharedpointer.h>
00062 
00063 #if _QX_ENABLE_QT_GUI_DEPENDENCY
00064 #include <QtGui/qcolor.h>
00065 #include <QtGui/qfont.h>
00066 #include <QtGui/qimage.h>
00067 #include <QtGui/qbrush.h>
00068 #include <QtGui/qmatrix.h>
00069 #include <QtGui/qregion.h>
00070 #endif // _QX_ENABLE_QT_GUI_DEPENDENCY
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 = boost::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(QRegExp)
00123 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QSize)
00124 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QTime)
00125 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QUrl)
00126 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QVariant)
00127 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QUuid)
00128 
00129 #if _QX_ENABLE_QT_GUI_DEPENDENCY
00130 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QColor)
00131 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QFont)
00132 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QImage)
00133 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QBrush)
00134 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QMatrix)
00135 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRegion)
00136 #endif // _QX_ENABLE_QT_GUI_DEPENDENCY
00137 
00138 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(boost::shared_ptr)
00139 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(QSharedPointer)
00140 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(QWeakPointer)
00141 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(qx::dao::ptr)
00142 
00143 #endif // _QX_TRAIT_IS_EQUAL_H_