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

Side by Side 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: Created 5 years, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {%- import "interface_macros.tmpl" as interface_macros %} 1 {%- import "interface_macros.tmpl" as interface_macros %}
2 class {{interface.name}}Proxy; 2 class {{interface.name}}Proxy;
3 class {{interface.name}}Stub; 3 class {{interface.name}}Stub;
4 4
5 class {{interface.name}}RequestValidator; 5 class {{interface.name}}RequestValidator;
6 {%- if interface|has_callbacks %} 6 {%- if interface|has_callbacks %}
7 class {{interface.name}}ResponseValidator; 7 class {{interface.name}}ResponseValidator;
8 {%- endif %} 8 {%- endif %}
9 {% if interface.client %} 9 {% if interface.client %}
10 class {{interface.client}}; 10 class {{interface.client}};
(...skipping 26 matching lines...) Expand all
37 {#--- Enums #} 37 {#--- Enums #}
38 {%- for enum in interface.enums %} 38 {%- for enum in interface.enums %}
39 {% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %} 39 {% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %}
40 {{enum_def()|indent(2)}} 40 {{enum_def()|indent(2)}}
41 {%- endfor %} 41 {%- endfor %}
42 42
43 {#--- Methods #} 43 {#--- Methods #}
44 virtual ~{{interface.name}}() {} 44 virtual ~{{interface.name}}() {}
45 45
46 {%- for method in interface.methods %} 46 {%- for method in interface.methods %}
47 {% if method.response_parameters != None %}
48 typedef {{interface_macros.declare_callback(method)}} {{method.name}}Callback;
jamesr 2015/01/28 17:25:32 can you use the 'using' syntax instead? i.e. usin
yzshen1 2015/01/28 18:30:43 Done.
49 {%- endif %}
47 virtual void {{method.name}}({{interface_macros.declare_request_params("", met hod)}}) = 0; 50 virtual void {{method.name}}({{interface_macros.declare_request_params("", met hod)}}) = 0;
48 {%- endfor %} 51 {%- endfor %}
49 }; 52 };
OLDNEW
« 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