8 #ifndef SOCI_STATEMENT_H_INCLUDED 9 #define SOCI_STATEMENT_H_INCLUDED 35 class prepare_temp_type;
48 template <
typename T,
typename Indicator>
50 { intos_.exchange(ic); }
53 template <
typename T,
typename Indicator>
55 { uses_.exchange(uc); }
59 void prepare(std::string
const & query,
61 void define_and_bind();
62 void undefine_and_bind();
63 bool execute(
bool withDataExchange =
false);
64 long long get_affected_rows();
67 void set_row(
row * r);
69 template<
typename T,
typename Indicator>
71 { exchange_for_rowset_(ic); }
87 std::string rewrite_for_procedure_call(std::string
const & query);
107 template <
typename Into>
110 if (intos_.empty() ==
false)
112 throw soci_error(
"Explicit into elements not allowed with rowset.");
117 int definePosition = 1;
118 for(into_type_vector::iterator iter = intos_.begin(),
121 { (*iter)->define(*
this, definePosition); }
122 definePositionForRow_ = definePosition;
126 template <
typename T,
typename Indicator>
130 void define_for_row();
138 exchange_for_row(
into(*t, *ind));
146 std::size_t intos_size();
147 std::size_t uses_size();
150 void post_fetch(
bool gotData,
bool calledFromFetch);
151 void post_use(
bool gotData);
152 bool resize_intos(std::size_t upperBound = 0);
153 void truncate_intos();
171 : impl_(new details::statement_impl(s)) {}
173 : impl_(new details::statement_impl(prep)) {}
193 template <
typename T,
typename Indicator>
196 template <
typename T,
typename Indicator>
203 impl_->prepare(query, eType);
210 gotData_ = impl_->execute(withDataExchange);
216 return impl_->get_affected_rows();
221 gotData_ = impl_->fetch();
230 template <
typename T,
typename Indicator>
233 impl_->exchange_for_rowset(ic);
238 impl_->exchange_for_rowset(i);
245 return impl_->get_backend();
250 return impl_->make_into_type_backend();
255 return impl_->make_use_type_backend();
260 return impl_->make_vector_into_type_backend();
265 return impl_->make_vector_use_type_backend();
270 return impl_->rewrite_for_procedure_call(query);
307 std::string
const & name = std::string())
318 #endif // SOCI_STATEMENT_H_INCLUDED void exchange_for_rowset(into_type_ptr const &i)
into_type(statement &s, indicator &ind)
void exchange(into_type_ptr const &i)
details::into_container< T, details::no_indicator > into(T &t)
std::vector< indicator * > indicators_
std::string rewrite_for_procedure_call(std::string const &query)
int definePositionForRow_
use_type(statement &s, std::string const &name=std::string())
into_type_vector intosForRow_
details::statement_backend * get_backend()
void exchange(details::use_type_ptr const &u)
basic_type_tag type_family
std::size_t initialFetchSize_
void exchange(use_type_ptr const &u)
void exchange(into_container< T, Indicator > const &ic)
details::vector_use_type_backend * make_vector_use_type_backend()
details::standard_use_type_backend * make_use_type_backend()
void prepare(std::string const &query, details::statement_type eType=details::st_repeatable_query)
void exchange(use_container< T, Indicator > const &uc)
use_type(statement &s, indicator &ind, std::string const &name=std::string())
std::map< std::string, use_type_base * > namedUses_
long long get_affected_rows()
void exchange_for_rowset(details::into_container< T, Indicator > const &ic)
void exchange(details::into_container< T, Indicator > const &ic)
void exchange_for_rowset(details::into_type_ptr const &i)
soci::details::statement_backend * backEnd_
void exchange_for_row(into_type_ptr const &i)
details::standard_into_type_backend * make_into_type_backend()
details::vector_into_type_backend * make_vector_into_type_backend()
void add_holder(T *t, indicator *ind)
void exchange_for_rowset_(Into const &i)
void exchange_for_rowset(into_container< T, Indicator > const &ic)
void exchange_for_row(into_container< T, Indicator > const &ic)
void operator=(statement const &other)
void exchange(details::use_container< T, Indicator > const &uc)
void exchange(into_type_ptr const &i)
void exchange(details::into_type_ptr const &i)
statement_backend * get_backend()
statement(statement const &other)
details::statement_impl * impl_
statement(details::prepare_temp_type const &prep)
bool execute(bool withDataExchange=false)