row-exchange.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 //
7 
8 #ifndef SOCI_INTO_ROW_H_INCLUDED
9 #define SOCI_INTO_ROW_H_INCLUDED
10 
11 #include "into-type.h"
12 #include "exchange-traits.h"
13 #include "row.h"
14 #include "statement.h"
15 // std
16 #include <cstddef>
17 
18 namespace soci
19 {
20 
21 namespace details
22 {
23 
24 // Support selecting into a row for dynamic queries
25 
26 template <>
27 class into_type<row>
28  : public into_type_base // bypass the standard_into_type
29 {
30 public:
31  into_type(row & r) : r_(r) {}
32  into_type(row & r, indicator &) : r_(r) {}
33 
34 private:
35  // special handling for Row
36  virtual void define(statement_impl & st, int & /* position */)
37  {
38  st.set_row(&r_);
39 
40  // actual row description is performed
41  // as part of the statement execute
42  }
43 
44  virtual void pre_fetch() {}
45  virtual void post_fetch(bool gotData, bool /* calledFromFetch */)
46  {
47  r_.reset_get_counter();
48 
49  if (gotData)
50  {
51  // this is used only to re-dispatch to derived class, if any
52  // (the derived class might be generated automatically by
53  // user conversions)
55  }
56  }
57 
58  virtual void clean_up() {}
59 
60  virtual std::size_t size() const { return 1; }
61 
62  virtual void convert_from_base() {}
63 
64  row & r_;
65 };
66 
67 template <>
69 {
71 };
72 
73 } // namespace details
74 
75 } // namespace soci
76 
77 #endif
Definition: row.h:41
virtual std::size_t size() const
Definition: row-exchange.h:60
virtual void define(statement_impl &st, int &)
Definition: row-exchange.h:36
virtual void convert_from_base()
Definition: into-type.h:72
into_type(row &r, indicator &)
Definition: row-exchange.h:32
virtual void post_fetch(bool gotData, bool)
Definition: row-exchange.h:45


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40