Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl

Issue 884043003: Cpp bindings: add typedef for callbacks. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: use using instead of typedef in cpp templates Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
index 30d20d8993e601f078e81340bba453341494eb4c..25c01bb987d3870d9565081b8e30f84fdc3316a7 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
@@ -14,19 +14,19 @@ class {{interface.name}} {
public:
static const char* Name_;
- typedef {{interface.name}}Proxy Proxy_;
- typedef {{interface.name}}Stub Stub_;
+ using Proxy_ = {{interface.name}}Proxy;
+ using Stub_ = {{interface.name}}Stub;
- typedef {{interface.name}}RequestValidator RequestValidator_;
+ using RequestValidator_ = {{interface.name}}RequestValidator;
{%- if interface|has_callbacks %}
- typedef {{interface.name}}ResponseValidator ResponseValidator_;
+ using ResponseValidator_ = {{interface.name}}ResponseValidator;
{%- else %}
- typedef mojo::PassThroughFilter ResponseValidator_;
+ using ResponseValidator_ = mojo::PassThroughFilter;
{%- endif %}
{% if interface.client %}
- typedef {{interface.client}} Client;
+ using Client = {{interface.client}};
{% else %}
- typedef mojo::NoInterface Client;
+ using Client = mojo::NoInterface;
{% endif %}
{#--- Constants #}
@@ -44,6 +44,9 @@ class {{interface.name}} {
virtual ~{{interface.name}}() {}
{%- for method in interface.methods %}
+{% if method.response_parameters != None %}
+ using {{method.name}}Callback = {{interface_macros.declare_callback(method)}};
+{%- endif %}
virtual void {{method.name}}({{interface_macros.declare_request_params("", method)}}) = 0;
{%- endfor %}
};
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698