From 19d689b4757f4d52c60032076b2023fa6aa30837 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Aug 2010 17:05:28 +0200 Subject: Add ability to load result into an existing object --- odb/mysql/result.hxx | 3 +++ odb/mysql/result.txx | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/odb/mysql/result.hxx b/odb/mysql/result.hxx index d852bc6..52d5b72 100644 --- a/odb/mysql/result.hxx +++ b/odb/mysql/result.hxx @@ -34,6 +34,9 @@ namespace odb pointer_type current (bool release); + virtual void + current (T&); + void next (); diff --git a/odb/mysql/result.txx b/odb/mysql/result.txx index b85e2e0..39100ab 100644 --- a/odb/mysql/result.txx +++ b/odb/mysql/result.txx @@ -40,6 +40,14 @@ namespace odb template void result_impl:: + current (T& x) + { + if (state_ == query_statement::success) + traits::init (x, statements_.image ()); + } + + template + void result_impl:: next () { cur_ = pointer_type (); -- cgit v1.1