into-type.cpp
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 #define SOCI_SOURCE
9 #include "into-type.h"
10 #include "statement.h"
11 
12 using namespace soci;
13 using namespace soci::details;
14 
16 {
17  delete backEnd_;
18 }
19 
20 void standard_into_type::define(statement_impl & st, int & position)
21 {
23  backEnd_->define_by_pos(position, data_, type_);
24 }
25 
27 {
29 }
30 
31 void standard_into_type::post_fetch(bool gotData, bool calledFromFetch)
32 {
33  backEnd_->post_fetch(gotData, calledFromFetch, ind_);
34 
35  if (gotData)
36  {
38  }
39 }
40 
42 {
43  // backEnd_ might be NULL if IntoType<Row> was used
44  if (backEnd_ != NULL)
45  {
46  backEnd_->clean_up();
47  }
48 }
49 
51 {
52  delete backEnd_;
53 }
54 
55 void vector_into_type::define(statement_impl & st, int & position)
56 {
58  backEnd_->define_by_pos(position, data_, type_);
59 }
60 
62 {
64 }
65 
66 void vector_into_type::post_fetch(bool gotData, bool /* calledFromFetch */)
67 {
68  if (indVec_ != NULL && indVec_->empty() == false)
69  {
70  assert(indVec_->empty() == false);
71  backEnd_->post_fetch(gotData, &(*indVec_)[0]);
72  }
73  else
74  {
75  backEnd_->post_fetch(gotData, NULL);
76  }
77 
78  if (gotData)
79  {
81  }
82 }
83 
84 void vector_into_type::resize(std::size_t sz)
85 {
86  if (indVec_ != NULL)
87  {
88  indVec_->resize(sz);
89  }
90 
91  backEnd_->resize(sz);
92 }
93 
94 std::size_t vector_into_type::size() const
95 {
96  return backEnd_->size();
97 }
98 
100 {
101  if (backEnd_ != NULL)
102  {
103  backEnd_->clean_up();
104  }
105 }
vector_into_type_backend * make_vector_into_type_backend()
virtual void post_fetch(bool gotData, bool calledFromFetch, indicator *ind)=0
virtual void post_fetch(bool gotData, bool calledFromFetch)
Definition: into-type.cpp:66
virtual void define(statement_impl &st, int &position)
Definition: into-type.cpp:20
standard_into_type_backend * make_into_type_backend()
virtual void convert_from_base()
Definition: into-type.h:72
virtual void define(statement_impl &st, int &position)
Definition: into-type.cpp:55
virtual void resize(std::size_t sz)
Definition: into-type.cpp:84
standard_into_type_backend * backEnd_
Definition: into-type.h:78
virtual std::size_t size() const
Definition: into-type.cpp:94
virtual void post_fetch(bool gotData, bool calledFromFetch)
Definition: into-type.cpp:31
virtual void define_by_pos(int &position, void *data, exchange_type type)=0


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