From 199a7a2da3e7020e9eb7c2dd256a4323e2a96a1e Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Wed, 6 Dec 2017 16:07:54 -0500 Subject: [PATCH] Made generated API C++ a bit more readeable. --- src/lib/api/public/ApiServer.h | 2 ++ src/lib/api/service_compiler/templates/cpp/server.pb.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/api/public/ApiServer.h b/src/lib/api/public/ApiServer.h index e50be4d3a..6608c1481 100644 --- a/src/lib/api/public/ApiServer.h +++ b/src/lib/api/public/ApiServer.h @@ -15,6 +15,8 @@ namespace bts { namespace api { +template using Response = std::function; + class ServiceContext; class BTS_EXPORT ApiServer { diff --git a/src/lib/api/service_compiler/templates/cpp/server.pb.h b/src/lib/api/service_compiler/templates/cpp/server.pb.h index bf871d788..e582225e0 100644 --- a/src/lib/api/service_compiler/templates/cpp/server.pb.h +++ b/src/lib/api/service_compiler/templates/cpp/server.pb.h @@ -36,7 +36,9 @@ protected: {{cap name}}Publisher make_{{name}}_publisher(const {{input_type}}& qualifier) const; {{else}} // {{comment}} - virtual void {{name}}(const {{input_type}}& request, const std::function& reply) = 0; + virtual void {{name}}( + const {{input_type}}& request, + const api::Response<{{output_type_cpp}}>& reply) = 0; {{/if}} {{/each}}