aboutsummaryrefslogtreecommitdiff
path: root/odb/result.txx
blob: e58af1f42ec2f95ed6fc06882fd69ec4242d5460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// file      : odb/result.txx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

namespace odb
{
  template <typename T>
  result_impl<T>::
  ~result_impl ()
  {
  }

  template <typename T>
  typename result_impl<T>::pointer_type result_impl<T>::
  current (bool release)
  {
    if (pointer_traits::null_ptr (current_) && !end_)
    {
      current (traits::create ());
      current (pointer_traits::get_ref (current_));
    }

    pointer_type r (current_);

    if (release)
    {
      current_ = pointer_type ();
      guard_.release ();
    }

    return r;
  }
}