Main Page
Namespaces
Classes
Files
File List
File Members
libism
ISM
soci
src
core
into.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_H_INCLUDED
9
#define SOCI_INTO_H_INCLUDED
10
11
#include "
into-type.h
"
12
#include "
exchange-traits.h
"
13
#include "
type-conversion.h
"
14
// std
15
#include <cstddef>
16
#include <vector>
17
18
namespace
soci
19
{
20
21
// the into function is a helper for defining output variables
22
// these helpers work with both basic and user-defined types thanks to
23
// the tag-dispatching, as defined in exchange_traits template
24
25
namespace
details
26
{
27
template
<
typename
T,
typename
Indicator>
28
struct
into_container
29
{
30
into_container
(T &_t, Indicator &_ind)
31
:
t
(_t),
ind
(_ind) {}
32
33
T &
t
;
34
Indicator &
ind
;
35
};
36
37
typedef
void
no_indicator
;
38
template
<
typename
T>
39
struct
into_container
<T, no_indicator>
40
{
41
into_container
(T &_t)
42
:
t
(_t) {}
43
44
T &
t
;
45
};
46
47
}
// namespace details
48
49
template
<
typename
T>
50
details::into_container<T, details::no_indicator>
51
into
(T &
t
)
52
{
return
details::into_container<T, details::no_indicator>
(
t
); }
53
54
template
<
typename
T,
typename
Indicator>
55
details::into_container<T, Indicator>
56
into
(T &
t
, Indicator &
ind
)
57
{
return
details::into_container<T, Indicator>
(
t
,
ind
); }
58
59
// for char buffer with run-time size information
60
template
<
typename
T>
61
details::into_type_ptr
into
(T &
t
, std::size_t bufSize)
62
{
63
return
details::into_type_ptr
(
new
details::into_type<T>
(t, bufSize));
64
}
65
66
}
// namespace soci
67
68
#endif // SOCI_INTO_H_INCLUDED
type-conversion.h
soci::into
details::into_container< T, details::no_indicator > into(T &t)
Definition:
into.h:51
into-type.h
soci::details::into_container< T, no_indicator >::t
T & t
Definition:
into.h:44
soci::details::into_container::ind
Indicator & ind
Definition:
into.h:34
exchange-traits.h
soci::details::no_indicator
void no_indicator
Definition:
into.h:37
soci::details::into_container::t
T & t
Definition:
into.h:33
soci::details::into_type_ptr
type_ptr< into_type_base > into_type_ptr
Definition:
into-type.h:47
soci::details::into_container::into_container
into_container(T &_t, Indicator &_ind)
Definition:
into.h:30
soci::details::into_container
Definition:
into.h:28
soci::details::into_container< T, no_indicator >::into_container
into_container(T &_t)
Definition:
into.h:41
soci::details::into_type
Definition:
into-type.h:117
soci::details::type_ptr
Definition:
type-ptr.h:14
soci
Definition:
db2/common.h:15
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