userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
buffer_io_base.hpp
1
#
pragma
once
2
3
#
include
<
userver
/
storages
/
postgres
/
io
/
type_mapping
.
hpp
>
4
5
USERVER_NAMESPACE_BEGIN
6
7
namespace
storages::
postgres
::
io
::detail {
8
9
template
<
typename
T>
10
inline
constexpr
bool
kShouldInitMapping =
requires
{ T::init; };
11
12
template
<
typename
T>
13
struct
BufferParserBase {
14
using
ValueType = T;
15
16
ValueType& value;
17
explicit
BufferParserBase(ValueType& v)
18
: value{v}
19
{
20
using
PgMapping =
CppToPg
<ValueType>;
21
if
constexpr
(kShouldInitMapping<PgMapping>) {
22
ForceReference(PgMapping::init);
23
}
24
}
25
};
26
27
template
<
typename
T>
28
struct
BufferParserBase<T&&> {
29
using
ValueType = T;
30
31
ValueType value;
32
explicit
BufferParserBase(ValueType&& v)
33
: value{std::move(v)}
34
{
35
using
PgMapping =
CppToPg
<ValueType>;
36
if
constexpr
(kShouldInitMapping<PgMapping>) {
37
ForceReference(PgMapping::init);
38
}
39
}
40
};
41
42
template
<
typename
T>
43
struct
BufferFormatterBase {
44
using
ValueType = T;
45
const
ValueType& value;
46
explicit
BufferFormatterBase(
const
ValueType& v)
47
: value{v}
48
{}
49
};
50
51
}
// namespace storages::postgres::io::detail
52
53
USERVER_NAMESPACE_END
userver
storages
postgres
io
buffer_io_base.hpp
Generated on
for userver by
Doxygen
1.17.0