channel_args_preconditioning.h
Go to the documentation of this file.
1 // Copyright 2021 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 
15 #ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
16 #define GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
17 
19 
20 #include <functional>
21 #include <vector>
22 
24 
26 
27 namespace grpc_core {
28 
29 // Registry of mutators for channel args.
30 // Surface APIs should call into this with channel args received from outside
31 // of gRPC, in order to prepare those channel args for the expections of the
32 // gRPC internals.
34  public:
35  // Take channel args and mutate them.
36  // Does not take ownership of the channel args passed in.
37  // Returns a new channel args object that is owned by the caller.
39 
40  class Builder {
41  public:
42  // Register a new channel args preconditioner.
43  void RegisterStage(Stage stage);
44  // Build out the preconditioners.
46 
47  private:
48  std::vector<Stage> stages_;
49  };
50 
51  // Take channel args and precondition them.
52  // Does not take ownership of the channel args passed in.
53  // Returns a new channel args object that is owned by the caller.
55 
56  private:
57  std::vector<Stage> stages_;
58 };
59 
60 } // namespace grpc_core
61 
62 #endif // GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
grpc_core::ChannelArgsPreconditioning::Builder::RegisterStage
void RegisterStage(Stage stage)
Definition: channel_args_preconditioning.cc:24
grpc_core::ChannelArgsPreconditioning::Builder
Definition: channel_args_preconditioning.h:40
grpc_core::ChannelArgsPreconditioning::Stage
std::function< ChannelArgs(ChannelArgs)> Stage
Definition: channel_args_preconditioning.h:38
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::ChannelArgsPreconditioning
Definition: channel_args_preconditioning.h:33
grpc_channel_args
Definition: grpc_types.h:132
grpc_core::ChannelArgsPreconditioning::Builder::Build
ChannelArgsPreconditioning Build()
Definition: channel_args_preconditioning.cc:28
grpc_types.h
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc_core::ChannelArgsPreconditioning::Builder::stages_
std::vector< Stage > stages_
Definition: channel_args_preconditioning.h:48
grpc_core::ChannelArgs
Definition: channel_args.h:111
grpc_core::ChannelArgsPreconditioning::stages_
std::vector< Stage > stages_
Definition: channel_args_preconditioning.h:57
channel_args.h
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
grpc_core::ChannelArgsPreconditioning::PreconditionChannelArgs
ChannelArgs PreconditionChannelArgs(const grpc_channel_args *args) const
Definition: channel_args_preconditioning.cc:34
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:43