GRPC Core  43.0.0
endpoint_config.h
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 #ifndef GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
15 #define GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
16 
17 #include <string>
18 
19 #include "absl/strings/string_view.h"
20 #include "absl/types/optional.h"
21 
23 
24 namespace grpc_event_engine {
25 namespace experimental {
26 
32  public:
33  virtual ~EndpointConfig() = default;
34  // If the key points to an integer config, an integer value gets returned.
35  // Otherwise it returns an absl::nullopt_t
36  virtual absl::optional<int> GetInt(absl::string_view key) const = 0;
37  // If the key points to an string config, an string value gets returned.
38  // Otherwise it returns an absl::nullopt_t
39  virtual absl::optional<absl::string_view> GetString(
40  absl::string_view key) const = 0;
41  // If the key points to an void* config, a void* pointer value gets returned.
42  // Otherwise it returns nullptr
43  virtual void* GetVoidPointer(absl::string_view key) const = 0;
44 };
45 
46 } // namespace experimental
47 } // namespace grpc_event_engine
48 
49 #endif // GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
grpc_event_engine::experimental::EndpointConfig::GetString
virtual absl::optional< absl::string_view > GetString(absl::string_view key) const =0
grpc_event_engine::experimental::EndpointConfig::GetVoidPointer
virtual void * GetVoidPointer(absl::string_view key) const =0
grpc_event_engine::experimental::EndpointConfig
Collection of parameters used to configure client and server endpoints.
Definition: endpoint_config.h:31
grpc_event_engine
Definition: endpoint_config.h:24
grpc_event_engine::experimental::EndpointConfig::GetInt
virtual absl::optional< int > GetInt(absl::string_view key) const =0
grpc_event_engine::experimental::EndpointConfig::~EndpointConfig
virtual ~EndpointConfig()=default
port_platform.h