delegating_channel.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2019 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
20 #define GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
21 
22 // IWYU pragma: private
23 
24 #include <memory>
25 
27 
28 namespace grpc {
29 namespace experimental {
30 
32  public:
33  ~DelegatingChannel() override {}
34 
36  std::shared_ptr<grpc::ChannelInterface> delegate_channel)
38 
40  return delegate_channel()->GetState(try_to_connect);
41  }
42 
43  std::shared_ptr<grpc::ChannelInterface> delegate_channel() {
44  return delegate_channel_;
45  }
46 
47  private:
50  grpc::CompletionQueue* cq) final {
51  return delegate_channel()->CreateCall(method, context, cq);
52  }
53 
55  internal::Call* call) final {
56  delegate_channel()->PerformOpsOnCall(ops, call);
57  }
58 
59  void* RegisterMethod(const char* method) final {
60  return delegate_channel()->RegisterMethod(method);
61  }
62 
65  void* tag) override {
66  delegate_channel()->NotifyOnStateChangeImpl(last_observed, deadline, cq,
67  tag);
68  }
69 
71  gpr_timespec deadline) override {
72  return delegate_channel()->WaitForStateChangeImpl(last_observed, deadline);
73  }
74 
78  size_t interceptor_pos) final {
79  return delegate_channel()->CreateCallInternal(method, context, cq,
80  interceptor_pos);
81  }
82 
84  return delegate_channel()->CallbackCQ();
85  }
86 
87  std::shared_ptr<grpc::ChannelInterface> delegate_channel_;
88 };
89 
90 } // namespace experimental
91 } // namespace grpc
92 
93 #endif // GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
grpc
Definition: grpcpp/alarm.h:33
grpc::experimental::DelegatingChannel::CreateCallInternal
internal::Call CreateCallInternal(const internal::RpcMethod &method, ClientContext *context, grpc::CompletionQueue *cq, size_t interceptor_pos) final
Definition: delegating_channel.h:75
grpc::internal::CallOpSetInterface
Definition: call_op_set_interface.h:36
grpc::experimental::DelegatingChannel::CreateCall
internal::Call CreateCall(const internal::RpcMethod &method, ClientContext *context, grpc::CompletionQueue *cq) final
Definition: delegating_channel.h:48
grpc_connectivity_state
grpc_connectivity_state
Definition: include/grpc/impl/codegen/connectivity_state.h:30
call
FilterStackCall * call
Definition: call.cc:750
grpc::ChannelInterface
Codegen interface for grpc::Channel.
Definition: grpcpp/impl/codegen/channel_interface.h:73
grpc::internal::RpcMethod
Descriptor of an RPC method.
Definition: grpcpp/impl/codegen/rpc_method.h:31
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
grpc::experimental::DelegatingChannel::~DelegatingChannel
~DelegatingChannel() override
Definition: delegating_channel.h:33
grpc::experimental::DelegatingChannel::RegisterMethod
void * RegisterMethod(const char *method) final
Definition: delegating_channel.h:59
grpc::experimental::DelegatingChannel::delegate_channel
std::shared_ptr< grpc::ChannelInterface > delegate_channel()
Definition: delegating_channel.h:43
grpc::internal::Call
Straightforward wrapping of the C call object.
Definition: include/grpcpp/impl/codegen/call.h:37
grpc::experimental::DelegatingChannel::CallbackCQ
grpc::CompletionQueue * CallbackCQ() final
Definition: delegating_channel.h:83
grpc::ClientContext
Definition: grpcpp/impl/codegen/client_context.h:195
grpc::experimental::DelegatingChannel::WaitForStateChangeImpl
bool WaitForStateChangeImpl(grpc_connectivity_state last_observed, gpr_timespec deadline) override
Definition: delegating_channel.h:70
grpc::experimental::DelegatingChannel::NotifyOnStateChangeImpl
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed, gpr_timespec deadline, grpc::CompletionQueue *cq, void *tag) override
Definition: delegating_channel.h:63
channel_interface.h
grpc::experimental::DelegatingChannel::delegate_channel_
std::shared_ptr< grpc::ChannelInterface > delegate_channel_
Definition: delegating_channel.h:87
grpc::experimental::DelegatingChannel::PerformOpsOnCall
void PerformOpsOnCall(internal::CallOpSetInterface *ops, internal::Call *call) final
Definition: delegating_channel.h:54
grpc::experimental::DelegatingChannel::GetState
grpc_connectivity_state GetState(bool try_to_connect) override
Definition: delegating_channel.h:39
grpc::experimental::DelegatingChannel
Definition: delegating_channel.h:31
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
grpc::experimental::DelegatingChannel::DelegatingChannel
DelegatingChannel(std::shared_ptr< grpc::ChannelInterface > delegate_channel)
Definition: delegating_channel.h:35
grpc::CompletionQueue
Definition: include/grpcpp/impl/codegen/completion_queue.h:104
gpr_timespec
Definition: gpr_types.h:50
tests.unit._exit_scenarios.try_to_connect
try_to_connect
Definition: _exit_scenarios.py:189
method
NSString * method
Definition: ProtoMethod.h:28
ops
static grpc_op ops[6]
Definition: test/core/fling/client.cc:39
cq
static grpc_completion_queue * cq
Definition: test/core/fling/client.cc:37


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:09