diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-08-14 11:27:36 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-08-14 11:27:36 +0200 |
commit | 031a5b46f3333f2b0aa0bb92acd2c92f99e6359b (patch) | |
tree | 30365cc3b97471876376b4d7893c0b8b7a4f47f4 /odb/boost/smart-ptr/lazy-ptr.txx | |
parent | ca82b73b8a51dacce0395dc24560733e378fb3bb (diff) |
Reimplement lazy_weak_ptr lock() to preserve database type
Now we initialize the returned lazy_shared_ptr with the same loader
function as the one set for weak_ptr.
Diffstat (limited to 'odb/boost/smart-ptr/lazy-ptr.txx')
-rw-r--r-- | odb/boost/smart-ptr/lazy-ptr.txx | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/odb/boost/smart-ptr/lazy-ptr.txx b/odb/boost/smart-ptr/lazy-ptr.txx index 9087bbb..8481bb5 100644 --- a/odb/boost/smart-ptr/lazy-ptr.txx +++ b/odb/boost/smart-ptr/lazy-ptr.txx @@ -40,32 +40,5 @@ namespace odb return i_.database () == r.i_.database () && object_id<object_type1> () == r.template object_id<object_type2> (); } - - // - // lazy_weak_ptr - // - - template <class T> - lazy_shared_ptr<T> lazy_weak_ptr<T>:: - lock () const - { - ::boost::shared_ptr<T> sp (p_.lock ()); - - if (sp) - { - if (database_type* db = i_.database ()) - return lazy_shared_ptr<T> (*db, sp); - else - return lazy_shared_ptr<T> (sp); - } - else - { - if (i_) - return lazy_shared_ptr<T> ( - *i_.database (), i_.template object_id<T> ()); - else - return lazy_shared_ptr<T> (); - } - } } } |