Remove `include/grpcpp/impl/codegen/delegating_channel.h` (#31495)

* Remove `include/grpcpp/impl/codegen/delegating_channel.h`

* Update

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests
pull/31532/head^2
Cheng-Yu Chung 2 years ago committed by GitHub
parent 405de7ac72
commit a02cc7d88a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      BUILD
  2. 2
      CMakeLists.txt
  3. 2
      build_autogenerated.yaml
  4. 1
      gRPC-C++.podspec
  5. 70
      include/grpcpp/impl/codegen/delegating_channel.h
  6. 91
      include/grpcpp/impl/delegating_channel.h
  7. 2
      test/cpp/end2end/delegating_channel_test.cc
  8. 1
      tools/doxygen/Doxyfile.c++
  9. 1
      tools/doxygen/Doxyfile.c++.internal

@ -342,6 +342,7 @@ GRPCXX_PUBLIC_HDRS = [
"include/grpcpp/impl/client_unary_call.h",
"include/grpcpp/impl/codegen/core_codegen.h",
"include/grpcpp/impl/completion_queue_tag.h",
"include/grpcpp/impl/delegating_channel.h",
"include/grpcpp/impl/grpc_library.h",
"include/grpcpp/impl/method_handler_impl.h",
"include/grpcpp/impl/rpc_method.h",

2
CMakeLists.txt generated

@ -3446,6 +3446,7 @@ foreach(_hdr
include/grpcpp/impl/codegen/sync_stream.h
include/grpcpp/impl/codegen/time.h
include/grpcpp/impl/completion_queue_tag.h
include/grpcpp/impl/delegating_channel.h
include/grpcpp/impl/grpc_library.h
include/grpcpp/impl/method_handler_impl.h
include/grpcpp/impl/rpc_method.h
@ -4133,6 +4134,7 @@ foreach(_hdr
include/grpcpp/impl/codegen/sync_stream.h
include/grpcpp/impl/codegen/time.h
include/grpcpp/impl/completion_queue_tag.h
include/grpcpp/impl/delegating_channel.h
include/grpcpp/impl/grpc_library.h
include/grpcpp/impl/method_handler_impl.h
include/grpcpp/impl/rpc_method.h

@ -2821,6 +2821,7 @@ libs:
- include/grpcpp/impl/codegen/sync_stream.h
- include/grpcpp/impl/codegen/time.h
- include/grpcpp/impl/completion_queue_tag.h
- include/grpcpp/impl/delegating_channel.h
- include/grpcpp/impl/grpc_library.h
- include/grpcpp/impl/method_handler_impl.h
- include/grpcpp/impl/rpc_method.h
@ -3239,6 +3240,7 @@ libs:
- include/grpcpp/impl/codegen/sync_stream.h
- include/grpcpp/impl/codegen/time.h
- include/grpcpp/impl/completion_queue_tag.h
- include/grpcpp/impl/delegating_channel.h
- include/grpcpp/impl/grpc_library.h
- include/grpcpp/impl/method_handler_impl.h
- include/grpcpp/impl/rpc_method.h

1
gRPC-C++.podspec generated

@ -147,6 +147,7 @@ Pod::Spec.new do |s|
'include/grpcpp/impl/codegen/sync_stream.h',
'include/grpcpp/impl/codegen/time.h',
'include/grpcpp/impl/completion_queue_tag.h',
'include/grpcpp/impl/delegating_channel.h',
'include/grpcpp/impl/grpc_library.h',
'include/grpcpp/impl/method_handler_impl.h',
'include/grpcpp/impl/rpc_method.h',

@ -21,73 +21,7 @@
// IWYU pragma: private
#include <memory>
#include <grpcpp/impl/codegen/channel_interface.h>
namespace grpc {
namespace experimental {
class DelegatingChannel : public grpc::ChannelInterface {
public:
~DelegatingChannel() override {}
explicit DelegatingChannel(
std::shared_ptr<grpc::ChannelInterface> delegate_channel)
: delegate_channel_(delegate_channel) {}
grpc_connectivity_state GetState(bool try_to_connect) override {
return delegate_channel()->GetState(try_to_connect);
}
std::shared_ptr<grpc::ChannelInterface> delegate_channel() {
return delegate_channel_;
}
private:
internal::Call CreateCall(const internal::RpcMethod& method,
ClientContext* context,
grpc::CompletionQueue* cq) final {
return delegate_channel()->CreateCall(method, context, cq);
}
void PerformOpsOnCall(internal::CallOpSetInterface* ops,
internal::Call* call) final {
delegate_channel()->PerformOpsOnCall(ops, call);
}
void* RegisterMethod(const char* method) final {
return delegate_channel()->RegisterMethod(method);
}
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline, grpc::CompletionQueue* cq,
void* tag) override {
delegate_channel()->NotifyOnStateChangeImpl(last_observed, deadline, cq,
tag);
}
bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) override {
return delegate_channel()->WaitForStateChangeImpl(last_observed, deadline);
}
internal::Call CreateCallInternal(const internal::RpcMethod& method,
ClientContext* context,
grpc::CompletionQueue* cq,
size_t interceptor_pos) final {
return delegate_channel()->CreateCallInternal(method, context, cq,
interceptor_pos);
}
grpc::CompletionQueue* CallbackCQ() final {
return delegate_channel()->CallbackCQ();
}
std::shared_ptr<grpc::ChannelInterface> delegate_channel_;
};
} // namespace experimental
} // namespace grpc
/// TODO(chengyuc): Remove this file after solving compatibility.
#include <grpcpp/impl/delegating_channel.h>
#endif // GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H

@ -0,0 +1,91 @@
/*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPCPP_IMPL_DELEGATING_CHANNEL_H
#define GRPCPP_IMPL_DELEGATING_CHANNEL_H
#include <memory>
#include <grpcpp/impl/channel_interface.h>
namespace grpc {
namespace experimental {
class DelegatingChannel : public grpc::ChannelInterface {
public:
~DelegatingChannel() override {}
explicit DelegatingChannel(
std::shared_ptr<grpc::ChannelInterface> delegate_channel)
: delegate_channel_(delegate_channel) {}
grpc_connectivity_state GetState(bool try_to_connect) override {
return delegate_channel()->GetState(try_to_connect);
}
std::shared_ptr<grpc::ChannelInterface> delegate_channel() {
return delegate_channel_;
}
private:
internal::Call CreateCall(const internal::RpcMethod& method,
ClientContext* context,
grpc::CompletionQueue* cq) final {
return delegate_channel()->CreateCall(method, context, cq);
}
void PerformOpsOnCall(internal::CallOpSetInterface* ops,
internal::Call* call) final {
delegate_channel()->PerformOpsOnCall(ops, call);
}
void* RegisterMethod(const char* method) final {
return delegate_channel()->RegisterMethod(method);
}
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline, grpc::CompletionQueue* cq,
void* tag) override {
delegate_channel()->NotifyOnStateChangeImpl(last_observed, deadline, cq,
tag);
}
bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) override {
return delegate_channel()->WaitForStateChangeImpl(last_observed, deadline);
}
internal::Call CreateCallInternal(const internal::RpcMethod& method,
ClientContext* context,
grpc::CompletionQueue* cq,
size_t interceptor_pos) final {
return delegate_channel()->CreateCallInternal(method, context, cq,
interceptor_pos);
}
grpc::CompletionQueue* CallbackCQ() final {
return delegate_channel()->CallbackCQ();
}
std::shared_ptr<grpc::ChannelInterface> delegate_channel_;
};
} // namespace experimental
} // namespace grpc
#endif // GRPCPP_IMPL_DELEGATING_CHANNEL_H

@ -25,8 +25,8 @@
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
#include <grpcpp/generic/generic_stub.h>
#include <grpcpp/impl/codegen/delegating_channel.h>
#include <grpcpp/impl/codegen/proto_utils.h>
#include <grpcpp/impl/delegating_channel.h>
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>

@ -1011,6 +1011,7 @@ include/grpcpp/impl/codegen/sync.h \
include/grpcpp/impl/codegen/sync_stream.h \
include/grpcpp/impl/codegen/time.h \
include/grpcpp/impl/completion_queue_tag.h \
include/grpcpp/impl/delegating_channel.h \
include/grpcpp/impl/grpc_library.h \
include/grpcpp/impl/method_handler_impl.h \
include/grpcpp/impl/rpc_method.h \

@ -1011,6 +1011,7 @@ include/grpcpp/impl/codegen/sync.h \
include/grpcpp/impl/codegen/sync_stream.h \
include/grpcpp/impl/codegen/time.h \
include/grpcpp/impl/completion_queue_tag.h \
include/grpcpp/impl/delegating_channel.h \
include/grpcpp/impl/grpc_library.h \
include/grpcpp/impl/method_handler_impl.h \
include/grpcpp/impl/rpc_method.h \

Loading…
Cancel
Save