GRPC C++
1.78.1
include
grpcpp
impl
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_DELEGATING_CHANNEL_H
20
#define GRPCPP_IMPL_DELEGATING_CHANNEL_H
21
22
#include <
grpcpp/impl/channel_interface.h
>
23
24
#include <memory>
25
26
namespace
grpc
{
27
namespace
experimental {
28
29
class
DelegatingChannel
:
public
grpc::ChannelInterface
{
30
public
:
31
~DelegatingChannel
()
override
{}
32
33
explicit
DelegatingChannel
(
34
std::shared_ptr<grpc::ChannelInterface>
delegate_channel
)
35
: delegate_channel_(
delegate_channel
) {}
36
37
grpc_connectivity_state
GetState
(
bool
try_to_connect)
override
{
38
return
delegate_channel
()->GetState(try_to_connect);
39
}
40
41
grpc_event_engine::experimental::MemoryAllocator
*
memory_allocator
()
42
const override
{
43
return
delegate_channel_->memory_allocator();
44
}
45
46
std::shared_ptr<grpc::ChannelInterface>
delegate_channel
() {
47
return
delegate_channel_;
48
}
49
50
private
:
51
internal::Call
CreateCall(
const
internal::RpcMethod
& method,
52
ClientContext
* context,
53
grpc::CompletionQueue
* cq)
final
{
54
return
delegate_channel
()->CreateCall(method, context, cq);
55
}
56
57
void
PerformOpsOnCall(
internal::CallOpSetInterface
* ops,
58
internal::Call
* call)
final
{
59
delegate_channel
()->PerformOpsOnCall(ops, call);
60
}
61
62
void
* RegisterMethod(
const
char
* method)
final
{
63
return
delegate_channel
()->RegisterMethod(method);
64
}
65
66
void
NotifyOnStateChangeImpl(
grpc_connectivity_state
last_observed,
67
gpr_timespec
deadline,
grpc::CompletionQueue
* cq,
68
void
* tag)
override
{
69
delegate_channel
()->NotifyOnStateChangeImpl(last_observed, deadline, cq,
70
tag);
71
}
72
73
bool
WaitForStateChangeImpl(
grpc_connectivity_state
last_observed,
74
gpr_timespec
deadline)
override
{
75
return
delegate_channel
()->WaitForStateChangeImpl(last_observed, deadline);
76
}
77
78
internal::Call CreateCallInternal(
const
internal::RpcMethod& method,
79
ClientContext* context,
80
grpc::CompletionQueue
* cq,
81
size_t
interceptor_pos)
final
{
82
return
delegate_channel
()->CreateCallInternal(method, context, cq,
83
interceptor_pos);
84
}
85
86
grpc::CompletionQueue
* CallbackCQ() final {
87
return
delegate_channel
()->CallbackCQ();
88
}
89
90
std::shared_ptr<grpc::ChannelInterface> delegate_channel_;
91
};
92
93
}
// namespace experimental
94
}
// namespace grpc
95
96
#endif // GRPCPP_IMPL_DELEGATING_CHANNEL_H
grpc::experimental::DelegatingChannel::GetState
grpc_connectivity_state GetState(bool try_to_connect) override
Get the current channel state.
Definition:
delegating_channel.h:37
grpc
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition:
alarm.h:33
grpc::experimental::DelegatingChannel::delegate_channel
std::shared_ptr< grpc::ChannelInterface > delegate_channel()
Definition:
delegating_channel.h:46
grpc::internal::Call
Straightforward wrapping of the C call object.
Definition:
call.h:36
grpc::experimental::DelegatingChannel::~DelegatingChannel
~DelegatingChannel() override
Definition:
delegating_channel.h:31
grpc::experimental::DelegatingChannel::DelegatingChannel
DelegatingChannel(std::shared_ptr< grpc::ChannelInterface > delegate_channel)
Definition:
delegating_channel.h:33
grpc::ClientContext
A ClientContext allows the person implementing a service client to:
Definition:
client_context.h:194
grpc_connectivity_state
grpc_connectivity_state
Connectivity state of a channel.
Definition:
connectivity_state.h:30
grpc::internal::CallOpSetInterface
An abstract collection of call ops, used to generate the grpc_call_op structure to pass down to the l...
Definition:
call_op_set_interface.h:36
grpc::experimental::DelegatingChannel
Definition:
delegating_channel.h:29
channel_interface.h
grpc::ChannelInterface
Codegen interface for grpc::Channel.
Definition:
channel_interface.h:72
grpc::experimental::DelegatingChannel::memory_allocator
grpc_event_engine::experimental::MemoryAllocator * memory_allocator() const override
Definition:
delegating_channel.h:41
grpc::CompletionQueue
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition:
completion_queue.h:104
grpc_event_engine::experimental::MemoryAllocator
Definition:
memory_allocator.h:33
grpc::internal::RpcMethod
Descriptor of an RPC method.
Definition:
rpc_method.h:29
gpr_timespec
Analogous to struct timespec.
Definition:
time.h:47
Generated on Fri Feb 20 2026 17:27:58 for GRPC C++ by
1.8.17