From 1896d36996ab48ed7271e855d7e32b4e61f64896 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Apr 2012 16:48:00 +0200 Subject: Polymorphic inheritance support --- odb/object-result.txx | 112 -------------------------------------------------- 1 file changed, 112 deletions(-) delete mode 100644 odb/object-result.txx (limited to 'odb/object-result.txx') diff --git a/odb/object-result.txx b/odb/object-result.txx deleted file mode 100644 index 7972da1..0000000 --- a/odb/object-result.txx +++ /dev/null @@ -1,112 +0,0 @@ -// file : odb/object-result.txx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#include -#include - -namespace odb -{ - // - // object_result_impl - // - - template - object_result_impl:: - ~object_result_impl () - { - } - - template - typename object_result_impl::pointer_type& - object_result_impl:: - current () - { - if (pointer_traits::null_ptr (current_) && !end_) - { - if (!session::has_current ()) - { - pointer_type p (object_traits::create ()); - object_type& obj (pointer_traits::get_ref (p)); - current (p); - load (obj); - } - else - { - // First check the session. - // - const id_type& id (load_id ()); - - pointer_type p ( - pointer_cache_traits::find (database (), id)); - - if (!pointer_traits::null_ptr (p)) - current (p); - else - { - pointer_type p (object_traits::create ()); - - typename pointer_cache_traits::insert_guard ig ( - pointer_cache_traits::insert (database (), id, p)); - - object_type& obj (pointer_traits::get_ref (p)); - current (p); - load (obj, false); - ig.release (); - } - } - } - - return current_; - } - - // - // object_result_impl_no_id - // - template - object_result_impl_no_id:: - ~object_result_impl_no_id () - { - } - - template - typename object_result_impl_no_id::pointer_type& - object_result_impl_no_id:: - current () - { - if (pointer_traits::null_ptr (current_) && !end_) - { - // Objects without ids are not stored in session cache. - // - pointer_type p (object_traits::create ()); - object_type& obj (pointer_traits::get_ref (p)); - current (p); - load (obj); - } - - return current_; - } - - // - // object_result_iterator - // - - template - void object_result_iterator:: - load (object_type& obj) - { - if (res_->end ()) - return; - - if (!session::has_current ()) - res_->load (obj); - else - { - typename reference_cache_traits::insert_guard ig ( - reference_cache_traits::insert ( - res_->database (), res_->load_id (), obj)); - res_->load (obj, false); - ig.release (); - } - } -} -- cgit v1.1