QxOrm 1.1.8
C++ Object Relational Mapping library
is_smart_ptr.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** http://www.qxorm.com/
00004 ** http://sourceforge.net/projects/qxorm/
00005 ** Original file by Lionel Marty
00006 **
00007 ** This file is part of the QxOrm library
00008 **
00009 ** This software is provided 'as-is', without any express or implied
00010 ** warranty. In no event will the authors be held liable for any
00011 ** damages arising from the use of this software.
00012 **
00013 ** GNU Lesser General Public License Usage
00014 ** This file must be used under the terms of the GNU Lesser
00015 ** General Public License version 2.1 as published by the Free Software
00016 ** Foundation and appearing in the file 'license.lgpl.txt' included in the
00017 ** packaging of this file.  Please review the following information to
00018 ** ensure the GNU Lesser General Public License version 2.1 requirements
00019 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
00020 **
00021 ** If you have questions regarding the use of this file, please contact :
00022 ** contact@qxorm.com
00023 **
00024 ****************************************************************************/
00025 
00026 #ifndef _QX_IS_SMART_PTR_H_
00027 #define _QX_IS_SMART_PTR_H_
00028 
00029 #ifdef _MSC_VER
00030 #pragma once
00031 #endif
00032 
00040 #include <boost/mpl/if.hpp>
00041 #include <boost/mpl/or.hpp>
00042 #include <boost/mpl/logical.hpp>
00043 
00044 #include <QxTraits/is_boost_intrusive_ptr.h>
00045 #include <QxTraits/is_boost_scoped_ptr.h>
00046 #include <QxTraits/is_boost_shared_ptr.h>
00047 #include <QxTraits/is_boost_weak_ptr.h>
00048 #include <QxTraits/is_qt_shared_data_ptr.h>
00049 #include <QxTraits/is_qt_scoped_ptr.h>
00050 #include <QxTraits/is_qt_shared_ptr.h>
00051 #include <QxTraits/is_qt_weak_ptr.h>
00052 #include <QxTraits/is_qx_dao_ptr.h>
00053 
00054 namespace qx {
00055 namespace trait {
00056 
00061 template <typename T>
00062 class is_smart_ptr
00063 {
00064 
00065 private:
00066 
00067    typedef typename boost::mpl::or_< qx::trait::is_qx_dao_ptr<T>, 
00068                                      qx::trait::is_boost_intrusive_ptr<T>, 
00069                                      qx::trait::is_boost_scoped_ptr<T>, 
00070                                      qx::trait::is_boost_shared_ptr<T>, 
00071                                      qx::trait::is_boost_weak_ptr<T> >::type cond_is_boost_smart_ptr;
00072 
00073    typedef typename boost::mpl::or_< typename qx::trait::is_smart_ptr<T>::cond_is_boost_smart_ptr, 
00074                                      qx::trait::is_qt_scoped_ptr<T>, 
00075                                      qx::trait::is_qt_shared_ptr<T>, 
00076                                      qx::trait::is_qt_weak_ptr<T>, 
00077                                      qx::trait::is_qt_shared_data_ptr<T> >::type cond_is_smart_ptr;
00078 
00079    typedef typename boost::mpl::if_< typename qx::trait::is_smart_ptr<T>::cond_is_smart_ptr, 
00080                                      boost::mpl::true_, 
00081                                      boost::mpl::false_ >::type type_is_smart_ptr;
00082 
00083 public:
00084 
00085    enum { value = qx::trait::is_smart_ptr<T>::type_is_smart_ptr::value };
00086 
00087    typedef typename qx::trait::is_smart_ptr<T>::type_is_smart_ptr type;
00088 
00089 };
00090 
00091 } // namespace trait
00092 } // namespace qx
00093 
00094 #endif // _QX_IS_SMART_PTR_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines