diff options
author | Vijay Pai <vpai@google.com> | 2017-10-27 10:22:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-27 10:22:51 -0700 |
commit | 7a648854e9e53f5228ad1218b559e358f72a9a38 (patch) | |
tree | 1319f074426dc2787361d0ffd5c918f12ed24a79 /src/compiler | |
parent | 06e174a088edadae2081ee5843c70cd4ba017f78 (diff) |
Adopt the static factory pattern (#10)
* Switch sync streams from "struct internal" to static factory in namespace internal
* Reduce diff size
* fix friends
* Use static factory pattern for async unary calls
* Use static factories for async streams
* clang-format
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/cpp_generator.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index 9efd6208b0..253280bd24 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -1203,8 +1203,8 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, printer->Print( *vars, " return " - "::grpc::ClientAsyncResponseReader< $Response$>::internal::Create(" - "channel_.get(), cq, " + "::grpc::internal::ClientAsyncResponseReaderFactory< $Response$>" + "::Create(channel_.get(), cq, " "rpcmethod_$Method$_, " "context, request, $AsyncStart$);\n" "}\n\n"); @@ -1216,7 +1216,7 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::ClientContext* context, $Response$* response) {\n"); printer->Print( *vars, - " return ::grpc::ClientWriter< $Request$>::internal::Create(" + " return ::grpc::internal::ClientWriterFactory< $Request$>::Create(" "channel_.get(), " "rpcmethod_$Method$_, " "context, response);\n" @@ -1233,8 +1233,8 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n"); printer->Print( *vars, - " return ::grpc::ClientAsyncWriter< $Request$>::internal::Create(" - "channel_.get(), cq, " + " return ::grpc::internal::ClientAsyncWriterFactory< $Request$>" + "::Create(channel_.get(), cq, " "rpcmethod_$Method$_, " "context, response, $AsyncStart$$AsyncCreateArgs$);\n" "}\n\n"); @@ -1247,7 +1247,7 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::ClientContext* context, const $Request$& request) {\n"); printer->Print( *vars, - " return ::grpc::ClientReader< $Response$>::internal::Create(" + " return ::grpc::internal::ClientReaderFactory< $Response$>::Create(" "channel_.get(), " "rpcmethod_$Method$_, " "context, request);\n" @@ -1265,8 +1265,8 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n"); printer->Print( *vars, - " return ::grpc::ClientAsyncReader< $Response$>::internal::Create(" - "channel_.get(), cq, " + " return ::grpc::internal::ClientAsyncReaderFactory< $Response$>" + "::Create(channel_.get(), cq, " "rpcmethod_$Method$_, " "context, request, $AsyncStart$$AsyncCreateArgs$);\n" "}\n\n"); @@ -1277,8 +1277,8 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::ClientReaderWriter< $Request$, $Response$>* " "$ns$$Service$::Stub::$Method$Raw(::grpc::ClientContext* context) {\n"); printer->Print(*vars, - " return ::grpc::ClientReaderWriter< " - "$Request$, $Response$>::internal::Create(" + " return ::grpc::internal::ClientReaderWriterFactory< " + "$Request$, $Response$>::Create(" "channel_.get(), " "rpcmethod_$Method$_, " "context);\n" @@ -1295,8 +1295,8 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer, "::grpc::CompletionQueue* cq$AsyncMethodParams$) {\n"); printer->Print(*vars, " return " - "::grpc::ClientAsyncReaderWriter< $Request$, " - "$Response$>::internal::Create(" + "::grpc::internal::ClientAsyncReaderWriterFactory< " + "$Request$, $Response$>::Create(" "channel_.get(), cq, " "rpcmethod_$Method$_, " "context, $AsyncStart$$AsyncCreateArgs$);\n" |