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

Side by Side Diff: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl

Issue 1524703002: [mojo] Support native types with mojom wire format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindings-5-pickles
Patch Set: doc Created 5 years 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 {% from "enum_macros.tmpl" import enum_decl -%} 1 {% from "enum_macros.tmpl" import enum_decl -%}
2
3 class {{struct.name}}_Reader;
4
2 class {{struct.name}} { 5 class {{struct.name}} {
3 public: 6 public:
4 using Data_ = internal::{{struct.name}}_Data; 7 using Data_ = internal::{{struct.name}}_Data;
8 using Reader = {{struct.name}}_Reader;
5 9
6 {#--- Enums #} 10 {#--- Enums #}
7 {%- for enum in struct.enums -%} 11 {%- for enum in struct.enums -%}
8 {{enum_decl(enum, is_static=true)|indent(2)}} 12 {{enum_decl(enum, is_static=true)|indent(2)}}
9 {%- endfor %} 13 {%- endfor %}
10 14
11 {#--- Constants #} 15 {#--- Constants #}
12 {%- for constant in struct.constants %} 16 {%- for constant in struct.constants %}
13 {%- if constant.kind|is_integral_kind %} 17 {%- if constant.kind|is_integral_kind %}
14 static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|con stant_value}}; 18 static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|con stant_value}};
(...skipping 22 matching lines...) Expand all
37 {%- endif %} 41 {%- endif %}
38 bool Equals(const {{struct.name}}& other) const; 42 bool Equals(const {{struct.name}}& other) const;
39 43
40 {#--- Struct members #} 44 {#--- Struct members #}
41 {% for field in struct.fields %} 45 {% for field in struct.fields %}
42 {%- set type = field.kind|cpp_wrapper_type %} 46 {%- set type = field.kind|cpp_wrapper_type %}
43 {%- set name = field.name %} 47 {%- set name = field.name %}
44 {{type}} {{name}}; 48 {{type}} {{name}};
45 {%- endfor %} 49 {%- endfor %}
46 }; 50 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698