diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-21 19:22:51 -0400 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-21 19:22:51 -0400 |
commit | fb2519f6f9d79c7626a0281ad24925b4976cd81d (patch) | |
tree | 0363e3f37d2466b9411485e44638c76141deeacf /odb/tr1/lazy-ptr.hxx | |
parent | 6c666b0dfa38cf1f6407817261a829645e86d855 (diff) |
Add ability to get underlying eager pointer in weak pointers
Diffstat (limited to 'odb/tr1/lazy-ptr.hxx')
-rw-r--r-- | odb/tr1/lazy-ptr.hxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/odb/tr1/lazy-ptr.hxx b/odb/tr1/lazy-ptr.hxx index d877998..5e040cf 100644 --- a/odb/tr1/lazy-ptr.hxx +++ b/odb/tr1/lazy-ptr.hxx @@ -98,6 +98,11 @@ namespace odb // void unload () const; + // Get the underlying eager pointer. If this is an unloaded pointer + // to a persistent object, then the returned pointer will be NULL. + // + std::tr1::shared_ptr<T> get_eager () const; + template <class DB, class ID> lazy_shared_ptr (DB&, const ID&); template <class DB, class Y> lazy_shared_ptr (DB&, Y*); template <class DB, class Y, class D> lazy_shared_ptr (DB&, Y*, D); @@ -207,6 +212,11 @@ namespace odb // void unload () const; + // Get the underlying eager pointer. If this is an unloaded pointer + // to a persistent object, then the returned pointer will be NULL. + // + std::tr1::weak_ptr<T> get_eager () const; + template <class DB, class ID> lazy_weak_ptr (DB&, const ID&); template <class DB, class Y> lazy_weak_ptr (DB&, const std::tr1::shared_ptr<Y>&); template <class DB, class Y> lazy_weak_ptr (DB&, const std::tr1::weak_ptr<Y>&); |