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>
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 {
42  : t(_t) {}
43 
44  T &t;
45 };
46 
47 } // namespace details
48 
49 template <typename T>
51  into(T &t)
53 
54 template <typename T, typename Indicator>
56  into(T &t, Indicator &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
details::into_container< T, details::no_indicator > into(T &t)
Definition: into.h:51
void no_indicator
Definition: into.h:37
type_ptr< into_type_base > into_type_ptr
Definition: into-type.h:47
into_container(T &_t, Indicator &_ind)
Definition: into.h:30


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