From fb2519f6f9d79c7626a0281ad24925b4976cd81d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 May 2013 19:22:51 -0400 Subject: Add ability to get underlying eager pointer in weak pointers --- odb/lazy-ptr.ixx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'odb/lazy-ptr.ixx') diff --git a/odb/lazy-ptr.ixx b/odb/lazy-ptr.ixx index 724142a..da02528 100644 --- a/odb/lazy-ptr.ixx +++ b/odb/lazy-ptr.ixx @@ -137,6 +137,13 @@ namespace odb } template + inline T* lazy_ptr:: + get_eager () const + { + return p_; + } + + template template inline lazy_ptr:: lazy_ptr (DB& db, const ID& id): p_ (0), i_ (db, id) {} @@ -396,6 +403,13 @@ namespace odb } template + inline std::auto_ptr& lazy_auto_ptr:: + get_eager () const + { + return p_; + } + + template template inline lazy_auto_ptr:: lazy_auto_ptr (DB& db, const ID& id): i_ (db, id) {} @@ -667,6 +681,13 @@ namespace odb } template + inline std::unique_ptr& lazy_unique_ptr:: + get_eager () const + { + return p_; + } + + template template inline lazy_unique_ptr:: lazy_unique_ptr (DB& db, const ID& id): i_ (db, id) {} @@ -1150,6 +1171,13 @@ namespace odb } template + inline std::shared_ptr lazy_shared_ptr:: + get_eager () const + { + return p_; + } + + template template inline lazy_shared_ptr:: lazy_shared_ptr (DB& db, const ID& id): i_ (db, id) {} @@ -1536,6 +1564,13 @@ namespace odb } template + inline std::weak_ptr lazy_weak_ptr:: + get_eager () const + { + return p_; + } + + template template inline lazy_weak_ptr:: lazy_weak_ptr (DB& db, const ID& id): i_ (db, id) {} -- cgit v1.1