aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2017-05-04 12:51:44 -0700
committerGravatar GitHub <noreply@github.com>2017-05-04 12:51:44 -0700
commitf31a80eac3fc507060f33c651bb13a6c3eaffab7 (patch)
treec1cd139d9e32ea49df06d6a6289775cbdaf8294f /src/compiler
parentc2ad372d43c1fd31d9e9dabb8a5481c641b9a81a (diff)
parentbe6ccdbc14a328bcaad4e911a9d3ad7ffe7fe596 (diff)
Merge pull request #10950 from jeady/service_name_metadata
Add static method to generated code to return fully qualified protobuf service name
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/cpp_generator.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index d3e71625d6..a1a0258c68 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -804,6 +804,12 @@ void PrintHeaderService(grpc_generator::Printer *printer,
" public:\n");
printer->Indent();
+ // Service metadata
+ printer->Print(*vars,
+ "static constexpr char const* service_full_name() {\n"
+ " return \"$Package$$Service$\";\n"
+ "}\n");
+
// Client side
printer->Print(
"class StubInterface {\n"