QxOrm  1.3.2
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 #ifdef _QX_CPP_11_SMART_PTR
00064 #ifndef BOOST_NO_CXX11_SMART_PTR
00065 #include <memory>
00066 #endif // BOOST_NO_CXX11_SMART_PTR
00067 #endif // _QX_CPP_11_SMART_PTR
00068 
00069 #if _QX_ENABLE_QT_GUI_DEPENDENCY
00070 #include <QtGui/qcolor.h>
00071 #include <QtGui/qfont.h>
00072 #include <QtGui/qimage.h>
00073 #include <QtGui/qbrush.h>
00074 #include <QtGui/qmatrix.h>
00075 #include <QtGui/qregion.h>
00076 #endif // _QX_ENABLE_QT_GUI_DEPENDENCY
00077 
00078 #include <QxDao/QxDaoPointer.h>
00079 
00080 namespace qx {
00081 namespace trait {
00082 
00087 template <typename T>
00088 struct has_operator_equal_equal
00089 { enum { value = boost::is_pointer<T>::value }; };
00090 
00091 } // namespace trait
00092 } // namespace qx
00093 
00094 #define QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(className) \
00095 namespace qx { namespace trait { \
00096 template <> \
00097 struct has_operator_equal_equal< className > { enum { value = true }; }; \
00098 } } // namespace qx::trait
00099 
00100 #define QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(className) \
00101 namespace qx { namespace trait { \
00102 template <typename T> \
00103 struct has_operator_equal_equal< className<T> > { enum { value = true }; }; \
00104 } } // namespace qx::trait
00105 
00106 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(bool)
00107 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(int)
00108 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(short)
00109 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(long)
00110 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(float)
00111 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(double)
00112 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(long double)
00113 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(char)
00114 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned int)
00115 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned short)
00116 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned long)
00117 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(unsigned char)
00118 
00119 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(std::string)
00120 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(std::wstring)
00121 
00122 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QString)
00123 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QByteArray)
00124 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QDate)
00125 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QDateTime)
00126 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QPoint)
00127 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRect)
00128 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRegExp)
00129 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QSize)
00130 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QTime)
00131 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QUrl)
00132 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QVariant)
00133 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QUuid)
00134 
00135 #if _QX_ENABLE_QT_GUI_DEPENDENCY
00136 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QColor)
00137 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QFont)
00138 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QImage)
00139 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QBrush)
00140 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QMatrix)
00141 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL(QRegion)
00142 #endif // _QX_ENABLE_QT_GUI_DEPENDENCY
00143 
00144 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(boost::shared_ptr)
00145 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(QSharedPointer)
00146 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(QWeakPointer)
00147 QX_TYPE_HAS_OPERATOR_EQUAL_EQUAL_TEMPLATE_1(qx::dao::ptr)
00148 
00149 #ifdef _QX_CPP_11_SMART_PTR
00150 #ifndef BOOST_NO_CXX11_SMART_PTR
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 #endif // BOOST_NO_CXX11_SMART_PTR
00154 #endif // _QX_CPP_11_SMART_PTR
00155 
00156 #endif // _QX_TRAIT_IS_EQUAL_H_