userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
any_value.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/tracing/any_value.hpp
4
/// @brief @copybrief tracing::AnyValue
5
6
#
include
<
cstdint
>
7
#
include
<
string
>
8
#
include
<
variant
>
9
10
#
include
<
userver
/
formats
/
json_fwd
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
tracing
{
15
16
/// @see
17
/// https://github.com/open-telemetry/opentelemetry-proto/blob/v1.3.2/opentelemetry/proto/common/v1/common.proto#L28
18
class
AnyValue
{
19
using
Data = std::variant<std::string,
bool
, std::int64_t,
double
>;
20
21
public
:
22
explicit
AnyValue(std::string string_value);
23
explicit
AnyValue(
const
char
* string_value);
24
explicit
AnyValue(
bool
bool_value);
25
explicit
AnyValue(
int
int_value);
26
explicit
AnyValue(
long
int_value);
27
explicit
AnyValue(
long
long
int_value);
28
explicit
AnyValue(
unsigned
int
int_value);
29
explicit
AnyValue(
unsigned
long
int_value);
30
explicit
AnyValue(
unsigned
long
long
int_value);
31
explicit
AnyValue(
float
double_value);
32
explicit
AnyValue(
double
double_value);
33
34
/// @cond
35
const
Data& GetData()
const
;
36
/// @endcond
37
38
private
:
39
Data value_;
40
};
41
42
AnyValue
Parse(
const
formats
::
json
::Value& value,
formats
::
parse
::
To
<
AnyValue
>);
43
44
void
WriteToStream(
const
AnyValue
& any_value,
formats
::
json
::StringBuilder& sw);
45
46
}
// namespace tracing
47
48
USERVER_NAMESPACE_END
userver
tracing
any_value.hpp
Generated on Thu Mar 27 2025 11:50:59 for userver by
Doxygen
1.10.0