diff options
author | Yang Gao <yangg@google.com> | 2017-05-04 12:51:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-04 12:51:44 -0700 |
commit | f31a80eac3fc507060f33c651bb13a6c3eaffab7 (patch) | |
tree | c1cd139d9e32ea49df06d6a6289775cbdaf8294f /src/compiler | |
parent | c2ad372d43c1fd31d9e9dabb8a5481c641b9a81a (diff) | |
parent | be6ccdbc14a328bcaad4e911a9d3ad7ffe7fe596 (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.cc | 6 |
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" |