From 476743786ba96c5761115fc216523bd0dd5b3aa0 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 20 Oct 2020 04:12:40 -0700 Subject: [PATCH] Also reduce templating for ClientUnaryReactor --- include/grpcpp/impl/codegen/client_callback.h | 7 +++++-- src/compiler/cpp_generator.cc | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/grpcpp/impl/codegen/client_callback.h b/include/grpcpp/impl/codegen/client_callback.h index 852ffda0e4e..f2ddaba07b8 100644 --- a/include/grpcpp/impl/codegen/client_callback.h +++ b/include/grpcpp/impl/codegen/client_callback.h @@ -1191,7 +1191,8 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary { class ClientCallbackUnaryFactory { public: - template + template static void Create(::grpc::ChannelInterface* channel, const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context, const Request* request, @@ -1203,7 +1204,9 @@ class ClientCallbackUnaryFactory { new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientCallbackUnaryImpl))) - ClientCallbackUnaryImpl(call, context, request, response, reactor); + ClientCallbackUnaryImpl(call, context, + static_cast(request), + static_cast(response), reactor); } }; diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index df212784d82..999bc129151 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -1911,6 +1911,8 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer, "::grpc::experimental::ClientUnaryReactor* reactor) {\n"); printer->Print(*vars, " ::grpc::internal::ClientCallbackUnaryFactory::Create" + "< ::grpc::protobuf::MessageLite, " + "::grpc::protobuf::MessageLite>" "(stub_->channel_.get(), stub_->rpcmethod_$Method$_, " "context, request, response, reactor);\n}\n\n");