From b14d811c7ea34c6ec423c0a7b90f4c271213b4af Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Jan 2013 14:56:36 +0200 Subject: Add support for low-level access to object cache --- odb/session.hxx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/odb/session.hxx b/odb/session.hxx index f9c8739..4db10b3 100644 --- a/odb/session.hxx +++ b/odb/session.hxx @@ -73,10 +73,9 @@ namespace odb }; template - struct object_map: - object_map_base, - std::map::id_type, - typename object_traits::pointer_type> + struct object_map: object_map_base, + std::map::id_type, + typename object_traits::pointer_type> { }; @@ -84,9 +83,9 @@ namespace odb // 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. + // for this class template are: default and copy-constructible as + // well as copy-assignable. In particular, a standard iterator can + // be used as a position. // template struct position @@ -119,13 +118,22 @@ namespace odb void erase (const position&); - protected: + // Low-level object cache access (iteration, etc). + // + public: typedef std::map, details::type_info_comparator> type_map; typedef std::map database_map; + database_map& + map () {return db_map_;} + + const database_map& + map () const {return db_map_;} + + protected: database_map db_map_; }; } -- cgit v1.1