diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-10 17:05:28 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-10 17:05:28 +0200 |
commit | 19d689b4757f4d52c60032076b2023fa6aa30837 (patch) | |
tree | b28d4e1a01b87449e7436aadcc5a448c41bc5dec | |
parent | b49d3e5e0e58e69b4fde856e37f73d101b5b2c0a (diff) |
Add ability to load result into an existing object
-rw-r--r-- | odb/mysql/result.hxx | 3 | ||||
-rw-r--r-- | odb/mysql/result.txx | 8 |
2 files changed, 11 insertions, 0 deletions
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 <typename T> void result_impl<T>:: + current (T& x) + { + if (state_ == query_statement::success) + traits::init (x, statements_.image ()); + } + + template <typename T> + void result_impl<T>:: next () { cur_ = pointer_type (); |