grpc
src
core
lib
event_engine
channel_args_endpoint_config.cc
Go to the documentation of this file.
1
// Copyright 2021 The gRPC Authors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
#include <
grpc/support/port_platform.h
>
15
16
#include "
src/core/lib/event_engine/channel_args_endpoint_config.h
"
17
18
#include <string>
19
20
#include "absl/types/variant.h"
21
22
#include <
grpc/event_engine/endpoint_config.h
>
23
#include <
grpc/impl/codegen/grpc_types.h
>
24
25
#include "
src/core/lib/channel/channel_args.h
"
26
27
namespace
grpc_event_engine
{
28
namespace
experimental {
29
30
EndpointConfig::Setting
ChannelArgsEndpointConfig::Get
(
31
absl::string_view
key
)
const
{
32
const
grpc_arg
*
arg
=
grpc_channel_args_find
(
args_
,
std::string
(
key
).
c_str
());
33
if
(
arg
==
nullptr
) {
34
return
absl::monostate
();
35
}
36
switch
(
arg
->
type
) {
37
case
GRPC_ARG_STRING
:
38
return
absl::string_view
(
arg
->
value
.string);
39
case
GRPC_ARG_INTEGER
:
40
return
arg
->
value
.integer;
41
case
GRPC_ARG_POINTER
:
42
return
arg
->
value
.pointer.p;
43
}
44
GPR_UNREACHABLE_CODE
(
return
absl::monostate
());
45
}
46
47
}
// namespace experimental
48
}
// namespace grpc_event_engine
grpc_arg
Definition:
grpc_types.h:103
GRPC_ARG_INTEGER
@ GRPC_ARG_INTEGER
Definition:
grpc_types.h:81
GRPC_ARG_STRING
@ GRPC_ARG_STRING
Definition:
grpc_types.h:80
absl::string_view
Definition:
abseil-cpp/absl/strings/string_view.h:167
channel_args_endpoint_config.h
testing::internal::string
::std::string string
Definition:
bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
arg::value
void * value
Definition:
cmdline.cc:44
grpc_event_engine::experimental::ChannelArgsEndpointConfig::Get
Setting Get(absl::string_view key) const override
Definition:
channel_args_endpoint_config.cc:30
grpc_types.h
arg::type
argtype type
Definition:
cmdline.cc:43
gen_stats_data.c_str
def c_str(s, encoding='ascii')
Definition:
gen_stats_data.py:38
arg
Definition:
cmdline.cc:40
GPR_UNREACHABLE_CODE
#define GPR_UNREACHABLE_CODE(STATEMENT)
Definition:
impl/codegen/port_platform.h:652
key
const char * key
Definition:
hpack_parser_table.cc:164
string_view
absl::string_view string_view
Definition:
attr.cc:22
grpc_event_engine
Definition:
endpoint_config.h:24
grpc_event_engine::experimental::ChannelArgsEndpointConfig::args_
const grpc_channel_args * args_
Definition:
channel_args_endpoint_config.h:37
channel_args.h
GRPC_ARG_POINTER
@ GRPC_ARG_POINTER
Definition:
grpc_types.h:82
absl::monostate
Definition:
abseil-cpp/absl/types/variant.h:444
endpoint_config.h
absl::variant
Definition:
abseil-cpp/absl/types/internal/variant.h:46
grpc_channel_args_find
const grpc_arg * grpc_channel_args_find(const grpc_channel_args *args, const char *name)
Definition:
channel_args.cc:393
port_platform.h
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:52