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

Side by Side Diff: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_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, 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
OLDNEW
1 1
2 class {{struct.name}} { 2 class {{struct.name}} {
3 public: 3 public:
4 typedef internal::{{struct.name}}_Data Data_; 4 using Data_ = internal::{{struct.name}}_Data;
5 5
6 {#--- Constants #} 6 {#--- Constants #}
7 {%- for constant in struct.constants %} 7 {%- for constant in struct.constants %}
8 static const {{constant.kind|cpp_pod_type}} {{constant.name}}; 8 static const {{constant.kind|cpp_pod_type}} {{constant.name}};
9 {%- endfor %} 9 {%- endfor %}
10 {#--- Enums #} 10 {#--- Enums #}
11 {%- for enum in struct.enums -%} 11 {%- for enum in struct.enums -%}
12 {% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %} 12 {% macro enum_def() %}{% include "enum_declaration.tmpl" %}{% endmacro %}
13 {{enum_def()|indent(2)}} 13 {{enum_def()|indent(2)}}
14 {%- endfor %} 14 {%- endfor %}
(...skipping 17 matching lines...) Expand all
32 {%- endif %} 32 {%- endif %}
33 bool Equals(const {{struct.name}}& other) const; 33 bool Equals(const {{struct.name}}& other) const;
34 34
35 {#--- Getters #} 35 {#--- Getters #}
36 {% for field in struct.fields %} 36 {% for field in struct.fields %}
37 {%- set type = field.kind|cpp_wrapper_type %} 37 {%- set type = field.kind|cpp_wrapper_type %}
38 {%- set name = field.name %} 38 {%- set name = field.name %}
39 {{type}} {{name}}; 39 {{type}} {{name}};
40 {%- endfor %} 40 {%- endfor %}
41 }; 41 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698