⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
userver
C++ Async Framework v2.0
Documentation
API Groups
Namespaces
Reference
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
w
y
Variables
k
n
r
u
w
Typedefs
c
d
h
m
n
o
p
s
t
u
v
Enumerations
a
b
c
d
f
h
i
l
o
p
r
s
t
u
v
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Symbols
File List
File Members
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
Toggle main menu visibility
▼
userver
Documentation
►
API Groups
►
Namespaces
▼
Reference
►
Namespace Members
►
Class List
Class Index
►
Class Hierarchy
►
Class Members
▼
File List
►
en
►
testsuite
►
userver
▼
userver
►
alerts
►
baggage
►
cache
►
clients
►
components
►
concurrent
►
congestion_control
►
dist_lock
►
drivers
▼
dump
►
aggregates.hpp
►
common.hpp
►
common_containers.hpp
config.hpp
►
dumper.hpp
factory.hpp
fwd.hpp
helpers.hpp
►
json_helpers.hpp
►
meta.hpp
meta_containers.hpp
operations.hpp
operations_encrypted.hpp
operations_file.hpp
►
to.hpp
unsafe.hpp
►
dynamic_config
►
engine
►
error_injection
►
fs
►
logging
►
moodycamel
►
net
►
os_signals
►
rcu
►
server
►
storages
►
testsuite
►
tracing
►
utils
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
userver
►
File Members
►
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
meta.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/dump/meta.hpp
4
/// @brief Provides dump::kIsDumpable and includes userver/dump/fwd.hpp
5
6
#
include
<
type_traits
>
7
8
#
include
<
userver
/
dump
/
fwd
.
hpp
>
9
#
include
<
userver
/
utils
/
meta_light
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
dump
{
14
15
namespace
impl {
16
17
template
<
typename
T>
18
using
WritableResult =
19
decltype
(Write(std::declval<
Writer
&>(), std::declval<
const
T&>()));
20
21
template
<
typename
T>
22
using
ReadableResult =
decltype
(Read(std::declval<
Reader
&>(), To<T>{}));
23
24
}
// namespace impl
25
26
/// Check if `writer.Write(T)` is available
27
template
<
typename
T
>
28
inline
constexpr
bool
kIsWritable
=
29
std
::
is_same_v
<
meta
::
DetectedType
<
impl
::
WritableResult
,
T
>,
void
>;
30
31
/// Check if `reader.Read<T>()` is available
32
template
<
typename
T
>
33
inline
constexpr
bool
kIsReadable
=
34
std
::
is_same_v
<
meta
::
DetectedType
<
impl
::
ReadableResult
,
T
>,
35
std
::
remove_const_t
<
T
>>;
36
37
/// Check if `T` is both writable and readable
38
template
<
typename
T
>
39
inline
constexpr
bool
kIsDumpable
=
kIsWritable
<
T
> &&
kIsReadable
<
T
>;
40
41
template
<
typename
T>
42
constexpr
bool
CheckDumpable() {
43
static_assert
(
44
kIsDumpable<T>,
45
"Type is not dumpable. Probably you forgot to include "
46
"<userver/dump/common.hpp>, <userver/dump/common_containers.hpp> or "
47
"other headers with Read and Write declarations"
);
48
49
return
true
;
50
}
51
52
}
// namespace dump
53
54
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
dump
meta.hpp
Generated on Wed May 15 2024 22:35:10 for userver by
Doxygen
1.10.0