aboutsummaryrefslogtreecommitdiff
path: root/odb/session.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-01-07 12:51:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-01-16 07:42:54 +0200
commitb366c3176462d470e445bc8aeb93a13df87e0518 (patch)
treee99b84576bef2011b1650354cba8f65197aab733 /odb/session.hxx
parent765d9f0580aa873bcd67172724e9bc592b593889 (diff)
Cleanup object cache position type
Diffstat (limited to 'odb/session.hxx')
-rw-r--r--odb/session.hxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/odb/session.hxx b/odb/session.hxx
index cfeebce..f9c8739 100644
--- a/odb/session.hxx
+++ b/odb/session.hxx
@@ -83,22 +83,26 @@ namespace odb
// Object cache.
//
public:
+ // Position in the cache of an inserted element. The requirements
+ // for this class template are: default and copy-constructible and
+ // copy-assignable. In particular, a standard iterator can be used
+ // as a position.
+ //
template <typename T>
- struct object_position
+ struct position
{
- typedef T object_type;
- typedef object_map<object_type> map;
+ typedef object_map<T> map;
typedef typename map::iterator iterator;
- object_position (): map_ (0) {}
- object_position (map& m, const iterator& p): map_ (&m), pos_ (p) {}
+ position () {}
+ position (map& m, const iterator& p): map_ (&m), pos_ (p) {}
map* map_;
iterator pos_;
};
template <typename T>
- object_position<T>
+ position<T>
insert (database_type&,
const typename object_traits<T>::id_type&,
const typename object_traits<T>::pointer_type&);
@@ -113,7 +117,7 @@ namespace odb
template <typename T>
void
- erase (const object_position<T>&);
+ erase (const position<T>&);
protected:
typedef std::map<const std::type_info*,