32#ifndef _QX_IS_SMART_PTR_BASE_OF_H_
33#define _QX_IS_SMART_PTR_BASE_OF_H_
48#define qx_smart_ptr_base_of_test_0() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr(b, d)) == sizeof(char))
49#define qx_smart_ptr_base_of_test_1() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_boost_scoped_ptr), d)) == sizeof(char))
50#define qx_smart_ptr_base_of_test_2() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_boost_shared_ptr), d)) == sizeof(char))
51#define qx_smart_ptr_base_of_test_3() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_boost_weak_ptr), d)) == sizeof(char))
52#define qx_smart_ptr_base_of_test_4() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_boost_intrusive_ptr), d)) == sizeof(char))
53#define qx_smart_ptr_base_of_test_5() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_qt_shared_data_ptr), d)) == sizeof(char))
54#define qx_smart_ptr_base_of_test_6() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_qt_shared_ptr), d)) == sizeof(char))
55#define qx_smart_ptr_base_of_test_7() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_qt_weak_ptr), d)) == sizeof(char))
56#define qx_smart_ptr_base_of_test_8() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_qx_dao_ptr), d)) == sizeof(char))
58#define qx_smart_ptr_base_of_test_9() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_std_unique_ptr), d)) == sizeof(char))
59#define qx_smart_ptr_base_of_test_10() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_std_shared_ptr), d)) == sizeof(char))
60#define qx_smart_ptr_base_of_test_11() (sizeof(qx::trait::is_smart_ptr_base_of<B, D>::removeSmartPtr((* b_std_weak_ptr), d)) == sizeof(char))
62#define qx_smart_ptr_base_of_all_test() \
63qx_smart_ptr_base_of_test_1() || qx_smart_ptr_base_of_test_2() || qx_smart_ptr_base_of_test_3() || \
64qx_smart_ptr_base_of_test_4() || qx_smart_ptr_base_of_test_5() || qx_smart_ptr_base_of_test_6() || \
65qx_smart_ptr_base_of_test_7() || qx_smart_ptr_base_of_test_8() || qx_smart_ptr_base_of_test_9() || \
66qx_smart_ptr_base_of_test_10() || qx_smart_ptr_base_of_test_11()
75template <
typename B,
typename D>
81#ifdef _QX_ENABLE_BOOST
83 template <
typename V,
typename W>
84 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const boost::scoped_ptr<V> &,
const boost::scoped_ptr<W> &);
86 template <
typename V,
typename W>
87 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const boost::shared_ptr<V> &,
const boost::shared_ptr<W> &);
89 template <
typename V,
typename W>
90 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const boost::weak_ptr<V> &,
const boost::weak_ptr<W> &);
92 template <
typename V,
typename W>
93 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const boost::intrusive_ptr<V> &,
const boost::intrusive_ptr<W> &);
97 template <
typename V,
typename W>
98 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const QSharedDataPointer<V> &,
const QSharedDataPointer<W> &);
100 template <
typename V,
typename W>
101 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const QSharedPointer<V> &,
const QSharedPointer<W> &);
103 template <
typename V,
typename W>
104 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const QWeakPointer<V> &,
const QWeakPointer<W> &);
106 template <
typename V,
typename W>
109 template <
typename V,
typename W>
110 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const std::unique_ptr<V> &,
const std::unique_ptr<W> &);
112 template <
typename V,
typename W>
113 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const std::shared_ptr<V> &,
const std::shared_ptr<W> &);
115 template <
typename V,
typename W>
116 static typename std::conditional<std::is_base_of<V, W>::value, char,
int>
::type removeSmartPtr(
const std::weak_ptr<V> &,
const std::weak_ptr<W> &);
122#ifdef _QX_ENABLE_BOOST
149 typedef typename std::conditional<qx::trait::is_smart_ptr_base_of<B, D>::value, std::true_type, std::false_type>
::type type;
qx::dao::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) wi...
qx::trait::is_smart_ptr_base_of<B, D>::value : return true if B and D are smart-pointers of boost,...
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const std::shared_ptr< V > &, const std::shared_ptr< W > &)
static std::unique_ptr< B > * b_std_unique_ptr
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const QWeakPointer< V > &, const QWeakPointer< W > &)
static QSharedPointer< B > * b_qt_shared_ptr
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const boost::scoped_ptr< V > &, const boost::scoped_ptr< W > &)
static int removeSmartPtr(...)
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const QSharedPointer< V > &, const QSharedPointer< W > &)
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const boost::shared_ptr< V > &, const boost::shared_ptr< W > &)
static boost::scoped_ptr< B > * b_boost_scoped_ptr
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const boost::weak_ptr< V > &, const boost::weak_ptr< W > &)
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const std::weak_ptr< V > &, const std::weak_ptr< W > &)
static QSharedDataPointer< B > * b_qt_shared_data_ptr
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const std::unique_ptr< V > &, const std::unique_ptr< W > &)
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const qx::dao::ptr< V > &, const qx::dao::ptr< W > &)
std::conditional< qx::trait::is_smart_ptr_base_of< B, D >::value, std::true_type, std::false_type >::type type
static boost::weak_ptr< B > * b_boost_weak_ptr
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const boost::intrusive_ptr< V > &, const boost::intrusive_ptr< W > &)
static boost::intrusive_ptr< B > * b_boost_intrusive_ptr
static boost::shared_ptr< B > * b_boost_shared_ptr
static std::shared_ptr< B > * b_std_shared_ptr
static std::weak_ptr< B > * b_std_weak_ptr
static QWeakPointer< B > * b_qt_weak_ptr
static std::conditional< std::is_base_of< V, W >::value, char, int >::type removeSmartPtr(const QSharedDataPointer< V > &, const QSharedDataPointer< W > &)
static qx::dao::ptr< B > * b_qx_dao_ptr
qx::trait::is_smart_ptr<T>::value : return true if T is a smart-pointer of boost, Qt or QxOrm librari...
#define qx_smart_ptr_base_of_test_0()
#define qx_smart_ptr_base_of_all_test()
Root namespace for all QxOrm library features.
qx::trait::is_smart_ptr<T>::value : return true if T is a smart-pointer of boost, Qt or QxOrm librari...