From 9c275a93cec797a021571ba8545906e0b4ffbfbc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Sep 2011 10:20:47 +0200 Subject: Support for views; native part --- odb/result.txx | 86 ---------------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 odb/result.txx (limited to 'odb/result.txx') diff --git a/odb/result.txx b/odb/result.txx deleted file mode 100644 index b0c4d61..0000000 --- a/odb/result.txx +++ /dev/null @@ -1,86 +0,0 @@ -// file : odb/result.txx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#include -#include - -namespace odb -{ - template - result_impl:: - ~result_impl () - { - } - - template - typename result_impl::pointer_type& result_impl:: - current () - { - typedef typename object_traits::pointer_type unrestricted_pointer_type; - typedef typename object_traits::pointer_traits unrestricted_pointer_traits; - - if (pointer_traits::null_ptr (current_) && !end_) - { - if (!session::has_current ()) - { - unrestricted_pointer_type up (object_traits::create ()); - object_type& obj (unrestricted_pointer_traits::get_ref (up)); - current (pointer_type (up)); - 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 - { - unrestricted_pointer_type up (object_traits::create ()); - - typename - pointer_cache_traits::insert_guard ig ( - pointer_cache_traits::insert ( - database (), id, up)); - - object_type& obj (unrestricted_pointer_traits::get_ref (up)); - current (pointer_type (up)); - load (obj); - ig.release (); - } - } - } - - return current_; - } - - // - // result_iterator - // - - template - void 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); - ig.release (); - } - } -} -- cgit v1.1