Fix const-ness of callback client read RPC requests (#25763)

* Fix const-ness of callback client read RPC requests

* Fix golden file
reviewable/pr25757/r1
Vijay Pai 4 years ago committed by GitHub
parent a98819007d
commit 33d7aaffe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/compiler/cpp_generator.cc
  2. 8
      test/cpp/codegen/compiler_test_golden

@ -633,12 +633,12 @@ void PrintHeaderClientMethodCallbackInterfaces(
printer->Print(*vars,
"#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"$Request$* request, "
"const $Request$* request, "
"::grpc::ClientReadReactor< $Response$>* "
"reactor) = 0;\n"
"#else\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"$Request$* request, "
"const $Request$* request, "
"::grpc::experimental::ClientReadReactor< $Response$>* "
"reactor) = 0;\n"
"#endif\n");
@ -730,12 +730,12 @@ void PrintHeaderClientMethodCallback(grpc_generator::Printer* printer,
printer->Print(*vars,
"#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"void $Method$(::grpc::ClientContext* context, "
"$Request$* request, "
"const $Request$* request, "
"::grpc::ClientReadReactor< $Response$>* "
"reactor) override;\n"
"#else\n"
"void $Method$(::grpc::ClientContext* context, "
"$Request$* request, "
"const $Request$* request, "
"::grpc::experimental::ClientReadReactor< $Response$>* "
"reactor) override;\n"
"#endif\n");
@ -2005,7 +2005,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
*vars,
"void $ns$$Service$::Stub::experimental_async::$Method$(::grpc::"
"ClientContext* context, "
"$Request$* request, "
"const $Request$* request, "
"::grpc::experimental::ClientReadReactor< $Response$>* reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackReaderFactory< "

@ -130,9 +130,9 @@ class ServiceA final {
// MethodA2 trailing comment 1
// Method A3 leading comment 1
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
virtual void MethodA3(::grpc::ClientContext* context, ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0;
virtual void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0;
#else
virtual void MethodA3(::grpc::ClientContext* context, ::grpc::testing::Request* request, ::grpc::experimental::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0;
virtual void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::experimental::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0;
#endif
// Method A3 trailing comment 1
// Method A4 leading comment 1
@ -215,9 +215,9 @@ class ServiceA final {
void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::experimental::ClientWriteReactor< ::grpc::testing::Request>* reactor) override;
#endif
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
void MethodA3(::grpc::ClientContext* context, ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) override;
void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) override;
#else
void MethodA3(::grpc::ClientContext* context, ::grpc::testing::Request* request, ::grpc::experimental::ClientReadReactor< ::grpc::testing::Response>* reactor) override;
void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::experimental::ClientReadReactor< ::grpc::testing::Response>* reactor) override;
#endif
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
void MethodA4(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) override;

Loading…
Cancel
Save