aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/database.hxx16
-rw-r--r--odb/database.ixx30
2 files changed, 46 insertions, 0 deletions
diff --git a/odb/database.hxx b/odb/database.hxx
index 8ccc642..c7816f6 100644
--- a/odb/database.hxx
+++ b/odb/database.hxx
@@ -70,6 +70,22 @@ namespace odb
void
reload (T& object);
+ template <typename T>
+ void
+ reload (T* obj_ptr);
+
+ template <typename T, template <typename> class P>
+ void
+ reload (const P<T>& obj_ptr);
+
+ template <typename T, template <typename> class P>
+ void
+ reload (P<T>& obj_ptr);
+
+ template <typename T>
+ void
+ reload (const typename object_traits<T>::pointer_type& obj_ptr);
+
// Return NULL/false if not found.
//
template <typename T>
diff --git a/odb/database.ixx b/odb/database.ixx
index 7bc6520..11b59ca 100644
--- a/odb/database.ixx
+++ b/odb/database.ixx
@@ -65,6 +65,36 @@ namespace odb
template <typename T>
inline void database::
+ reload (T* p)
+ {
+ reload<T> (*p);
+ }
+
+ template <typename T, template <typename> class P>
+ inline void database::
+ reload (const P<T>& p)
+ {
+ reload (odb::pointer_traits< P<T> >::get_ref (p));
+ }
+
+ template <typename T, template <typename> class P>
+ inline void database::
+ reload (P<T>& p)
+ {
+ reload (odb::pointer_traits< P<T> >::get_ref (p));
+ }
+
+ template <typename T>
+ inline void database::
+ reload (const typename object_traits<T>::pointer_type& pobj)
+ {
+ typedef typename object_traits<T>::pointer_type pointer_type;
+
+ reload (odb::pointer_traits<pointer_type>::get_ref (pobj));
+ }
+
+ template <typename T>
+ inline void database::
update (T* p)
{
typedef typename object_traits<T>::pointer_type object_pointer;