aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-04-23 16:48:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-04-23 16:48:02 +0200
commit118ef7b0b43f6a79540890a447b7b6d7bac2d548 (patch)
treee3562964aa5e5438921563643966a2471afd3b1a
parentcb669c6062b869dc20511e379795585de530cf29 (diff)
Polymorphic inheritance support
-rw-r--r--odb/qt/smart-ptr/pointer-traits.hxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/odb/qt/smart-ptr/pointer-traits.hxx b/odb/qt/smart-ptr/pointer-traits.hxx
index f8a424a..add6068 100644
--- a/odb/qt/smart-ptr/pointer-traits.hxx
+++ b/odb/qt/smart-ptr/pointer-traits.hxx
@@ -52,11 +52,25 @@ namespace odb
}
static unrestricted_pointer_type
- cast (const pointer_type& p)
+ const_pointer_cast (const pointer_type& p)
{
return qSharedPointerConstCast<unrestricted_element_type> (p);
}
+ template <typename T1>
+ static QSharedPointer<T1>
+ static_pointer_cast (const pointer_type& p)
+ {
+ return qSharedPointerCast<T1> (p);
+ }
+
+ template <typename T1>
+ static QSharedPointer<T1>
+ dynamic_pointer_cast (const pointer_type& p)
+ {
+ return qSharedPointerDynamicCast<T1> (p);
+ }
+
public:
static void*
allocate (std::size_t n)