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/view-result.txx | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 odb/view-result.txx (limited to 'odb/view-result.txx') diff --git a/odb/view-result.txx b/odb/view-result.txx new file mode 100644 index 0000000..52d478e --- /dev/null +++ b/odb/view-result.txx @@ -0,0 +1,49 @@ +// file : odb/view-result.txx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +namespace odb +{ + // + // result_impl + // + + template + result_impl:: + ~result_impl () + { + } + + template + typename result_impl::pointer_type& + result_impl:: + current () + { + if (pointer_traits::null_ptr (current_) && !end_) + { + // For views, pointer_type is unrestricted_pointer_type. + // + pointer_type p (view_traits::create ()); + view_type& view (pointer_traits::get_ref (p)); + current (p); + load (view); + } + + return current_; + } + + // + // result_iterator + // + + template + void result_iterator:: + load (view_type& view) + { + if (res_->end ()) + return; + + res_->load (view); + } +} -- cgit v1.1