aboutsummaryrefslogtreecommitdiff
path: root/common/session/custom/session.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-01-20 08:20:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-01-20 08:20:56 +0200
commit539c92147e8d58c49f350c4070051a6ddf6b2354 (patch)
tree42620646906353b49970e4f45eddb89f0fc613ca /common/session/custom/session.hxx
parentf73c92b7b61368fb60a112b1a44212ae95aad84d (diff)
Add cache_ suffix to session cache functions
This way they won't conflict with other functions (e.g., delayed database operations) that may have the same names.
Diffstat (limited to 'common/session/custom/session.hxx')
-rw-r--r--common/session/custom/session.hxx29
1 files changed, 15 insertions, 14 deletions
diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx
index ce7e43c..b0a6694 100644
--- a/common/session/custom/session.hxx
+++ b/common/session/custom/session.hxx
@@ -96,13 +96,13 @@ private:
//
public:
template <typename T>
- struct position
+ struct cache_position
{
typedef object_map<T> map;
typedef typename map::iterator iterator;
- position (): map_ (0) {}
- position (map& m, const iterator& p): map_ (&m), pos_ (p) {}
+ cache_position (): map_ (0) {}
+ cache_position (map& m, const iterator& p): map_ (&m), pos_ (p) {}
map* map_;
iterator pos_;
@@ -111,18 +111,18 @@ public:
// Cache management.
//
template <typename T>
- static position<T>
- insert (odb::database&,
- const typename odb::object_traits<T>::id_type&,
- const typename odb::object_traits<T>::pointer_type&);
+ static cache_position<T>
+ _cache_insert (odb::database&,
+ const typename odb::object_traits<T>::id_type&,
+ const typename odb::object_traits<T>::pointer_type&);
template <typename T>
static typename odb::object_traits<T>::pointer_type
- find (odb::database&, const typename odb::object_traits<T>::id_type&);
+ _cache_find (odb::database&, const typename odb::object_traits<T>::id_type&);
template <typename T>
static void
- erase (const position<T>& p)
+ _cache_erase (const cache_position<T>& p)
{
if (p.map_ != 0)
p.map_->erase (p.pos_);
@@ -132,22 +132,23 @@ public:
//
template <typename T>
static void
- persist (const position<T>& p)
+ _cache_persist (const cache_position<T>& p)
{
- load (p);
+ _cache_load (p);
}
template <typename T>
static void
- load (const position<T>&);
+ _cache_load (const cache_position<T>&);
template <typename T>
static void
- update (odb::database&, const T&);
+ _cache_update (odb::database&, const T&);
template <typename T>
static void
- erase (odb::database&, const typename odb::object_traits<T>::id_type&);
+ _cache_erase (odb::database&,
+ const typename odb::object_traits<T>::id_type&);
private:
// Post-commit/rollback callback.