Main Page
Namespaces
Classes
Files
File List
File Members
libism
ISM
soci
src
core
values-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_VALUES_EXCHANGE_H_INCLUDED
9
#define SOCI_VALUES_EXCHANGE_H_INCLUDED
10
11
#include "
values.h
"
12
#include "
into-type.h
"
13
#include "
use-type.h
"
14
#include "
row-exchange.h
"
15
// std
16
#include <cstddef>
17
#include <string>
18
#include <vector>
19
20
namespace
soci
21
{
22
23
namespace
details
24
{
25
26
template
<>
27
struct
exchange_traits
<
values
>
28
{
29
typedef
basic_type_tag
type_family
;
30
31
// dummy value to satisfy the template engine, never used
32
enum
{
x_type
= 0 };
33
};
34
35
template
<>
36
class
use_type
<
values
> :
public
use_type_base
37
{
38
public
:
39
use_type
(
values
& v, std::string
const
&
/*name*/
= std::string())
40
: v_(v)
41
{}
42
43
// we ignore the possibility to have the whole values as NULL
44
use_type
(
values
& v,
indicator
/*ind*/
, std::string
const
&
/*name*/
= std::string())
45
: v_(v)
46
{}
47
48
virtual
void
bind
(
details::statement_impl
& st,
int
&
/*position*/
)
49
{
50
v_.uppercase_column_names(st.
session_
.
get_uppercase_column_names
());
51
52
convert_to_base();
53
st.
bind
(v_);
54
}
55
56
virtual
void
post_use
(
bool
/*gotData*/
)
57
{
58
v_.reset_get_counter();
59
convert_from_base();
60
}
61
62
virtual
void
pre_use
() {convert_to_base();}
63
virtual
void
clean_up
() {v_.clean_up();}
64
virtual
std::size_t
size
()
const
{
return
1; }
65
66
// these are used only to re-dispatch to derived class
67
// (the derived class might be generated automatically by
68
// user conversions)
69
virtual
void
convert_to_base
() {}
70
virtual
void
convert_from_base
() {}
71
72
private
:
73
values
&
v_
;
74
};
75
76
// this is not supposed to be used - no support for bulk ORM
77
template
<>
78
class
use_type
<
std
::vector<values> >
79
{
80
private
:
81
use_type
();
82
};
83
84
template
<>
85
class
into_type
<
values
> :
public
into_type
<row>
86
{
87
public
:
88
into_type
(
values
& v)
89
:
into_type
<
row
>(v.get_row()), v_(v)
90
{}
91
92
into_type
(
values
& v,
indicator
& ind)
93
:
into_type
<
row
>(v.get_row(), ind), v_(v)
94
{}
95
96
void
clean_up
()
97
{
98
v_.clean_up();
99
}
100
101
private
:
102
values
&
v_
;
103
};
104
105
// this is not supposed to be used - no support for bulk ORM
106
template
<>
107
class
into_type
<
std
::vector<values> >
108
{
109
private
:
110
into_type
();
111
};
112
113
}
// namespace details
114
115
}
// namespace soci
116
117
#endif // SOCI_VALUES_EXCHANGE_H_INCLUDED
soci::details::use_type< values >::clean_up
virtual void clean_up()
Definition:
values-exchange.h:63
soci::details::use_type< values >::use_type
use_type(values &v, indicator, std::string const &=std::string())
Definition:
values-exchange.h:44
soci::details::statement_impl::session_
session & session_
Definition:
statement.h:85
soci::details::statement_impl::bind
void bind(values &v)
Definition:
core/statement.cpp:73
soci::values
Definition:
values.h:44
soci::details::into_type< values >::v_
values & v_
Definition:
values-exchange.h:102
into-type.h
soci::details::use_type< values >::size
virtual std::size_t size() const
Definition:
values-exchange.h:64
soci::row
Definition:
row.h:41
std
soci::details::use_type< values >::convert_from_base
virtual void convert_from_base()
Definition:
values-exchange.h:70
soci::details::use_type< values >::use_type
use_type(values &v, std::string const &=std::string())
Definition:
values-exchange.h:39
soci::details::use_type
Definition:
use-type.h:142
soci::details::into_type< values >::into_type
into_type(values &v)
Definition:
values-exchange.h:88
soci::details::basic_type_tag
Definition:
exchange-traits.h:24
soci::details::use_type< values >::pre_use
virtual void pre_use()
Definition:
values-exchange.h:62
soci::details::exchange_traits::x_type
Definition:
exchange-traits.h:36
use-type.h
soci::details::use_type_base
Definition:
use-type.h:25
row-exchange.h
soci::indicator
indicator
Definition:
soci-backend.h:28
soci::details::use_type< values >::post_use
virtual void post_use(bool)
Definition:
values-exchange.h:56
soci::details::use_type< values >::bind
virtual void bind(details::statement_impl &st, int &)
Definition:
values-exchange.h:48
soci::details::use_type< values >::v_
values & v_
Definition:
values-exchange.h:73
soci::session::get_uppercase_column_names
bool get_uppercase_column_names() const
Definition:
core/session.cpp:340
soci::details::statement_impl
Definition:
statement.h:37
soci::details::use_type< values >::convert_to_base
virtual void convert_to_base()
Definition:
values-exchange.h:69
soci::details::exchange_traits< values >::type_family
basic_type_tag type_family
Definition:
values-exchange.h:29
soci::details::into_type< values >::clean_up
void clean_up()
Definition:
values-exchange.h:96
soci::details::into_type
Definition:
into-type.h:117
values.h
soci
Definition:
db2/common.h:15
soci::details::into_type< values >::into_type
into_type(values &v, indicator &ind)
Definition:
values-exchange.h:92
soci::details::exchange_traits
Definition:
exchange-traits.h:28
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:41