aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler
diff options
context:
space:
mode:
authorGravatar James Eady <jmeady@google.com>2017-05-02 10:45:34 -0400
committerGravatar James Eady <jmeady@google.com>2017-05-02 10:45:34 -0400
commit3b26451025118b1f2764dcc618cb3a5fd8abdd4b (patch)
tree5d9e6ae8c142f45f914cc828d21c01949dacffd4 /src/compiler
parent305dcf3d32bed0614325ead76f121702768ce874 (diff)
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.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index d3e71625d6..bbf17314e9 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -804,6 +804,13 @@ 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"