diff options
author | Yang Gao <yangg@google.com> | 2015-02-13 14:11:31 -0800 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-02-13 14:11:31 -0800 |
commit | 07d8304f3029f825c29399996c55119ad2bc2c82 (patch) | |
tree | f00bac7480c242436e16af4ab43d00932d358bf4 | |
parent | bd98ed5420b27f137591aa4f4ea277eb4c501fa8 (diff) |
change stub API for server streaming, pass in const Request& instead of const Request* for the first request
-rw-r--r-- | src/compiler/cpp_generator.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index 2a9895e43c..60dc02d7af 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -197,10 +197,10 @@ void PrintHeaderClientMethod(google::protobuf::io::Printer *printer, printer->Print( *vars, "::grpc::ClientReader< $Response$>* $Method$(" - "::grpc::ClientContext* context, const $Request$* request);\n"); + "::grpc::ClientContext* context, const $Request$& request);\n"); printer->Print(*vars, "::grpc::ClientAsyncReader< $Response$>* $Method$(" - "::grpc::ClientContext* context, const $Request$* request, " + "::grpc::ClientContext* context, const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag);\n"); } else if (BidiStreaming(method)) { printer->Print(*vars, @@ -415,25 +415,25 @@ void PrintSourceClientMethod(google::protobuf::io::Printer *printer, printer->Print( *vars, "::grpc::ClientReader< $Response$>* $Service$::Stub::$Method$(" - "::grpc::ClientContext* context, const $Request$* request) {\n"); + "::grpc::ClientContext* context, const $Request$& request) {\n"); printer->Print(*vars, " return new ::grpc::ClientReader< $Response$>(" "channel()," "::grpc::RpcMethod($Service$_method_names[$Idx$], " "::grpc::RpcMethod::RpcType::SERVER_STREAMING), " - "context, *request);\n" + "context, request);\n" "}\n\n"); printer->Print( *vars, "::grpc::ClientAsyncReader< $Response$>* $Service$::Stub::$Method$(" - "::grpc::ClientContext* context, const $Request$* request, " + "::grpc::ClientContext* context, const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag) {\n"); printer->Print(*vars, " return new ::grpc::ClientAsyncReader< $Response$>(" "channel(), cq, " "::grpc::RpcMethod($Service$_method_names[$Idx$], " "::grpc::RpcMethod::RpcType::SERVER_STREAMING), " - "context, *request, tag);\n" + "context, request, tag);\n" "}\n\n"); } else if (BidiStreaming(method)) { printer->Print( |