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

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

Issue 1618963006: Mojo C++ bindings: support enum validation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 {%- 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 9
10 class {{interface.name}} { 10 class {{interface.name}} {
(...skipping 10 matching lines...) Expand all
21 using RequestValidator_ = {{interface.name}}RequestValidator; 21 using RequestValidator_ = {{interface.name}}RequestValidator;
22 {%- if interface|has_callbacks %} 22 {%- if interface|has_callbacks %}
23 using ResponseValidator_ = {{interface.name}}ResponseValidator; 23 using ResponseValidator_ = {{interface.name}}ResponseValidator;
24 {%- else %} 24 {%- else %}
25 using ResponseValidator_ = mojo::PassThroughFilter; 25 using ResponseValidator_ = mojo::PassThroughFilter;
26 {%- endif %} 26 {%- endif %}
27 27
28 {#--- Enums #} 28 {#--- Enums #}
29 {% from "enum_macros.tmpl" import enum_decl -%} 29 {% from "enum_macros.tmpl" import enum_decl -%}
30 {%- for enum in interface.enums %} 30 {%- for enum in interface.enums %}
31 {{enum_decl(enum, is_static=true)|indent(2)}} 31 {{enum_decl(enum)|indent(2)}}
32 {%- endfor %} 32 {%- endfor %}
33 33
34 {#--- Constants #} 34 {#--- Constants #}
35 {%- for constant in interface.constants %} 35 {%- for constant in interface.constants %}
36 {%- if constant.kind|is_integral_kind %} 36 {%- if constant.kind|is_integral_kind %}
37 static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|con stant_value}}; 37 static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|con stant_value}};
38 {%- else %} 38 {%- else %}
39 static const {{constant.kind|cpp_pod_type}} {{constant.name}}; 39 static const {{constant.kind|cpp_pod_type}} {{constant.name}};
40 {%- endif %} 40 {%- endif %}
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 %} 47 {% if method.response_parameters != None %}
48 using {{method.name}}Callback = {{interface_macros.declare_callback(method)}}; 48 using {{method.name}}Callback = {{interface_macros.declare_callback(method)}};
49 {%- endif %} 49 {%- endif %}
50 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;
51 {%- endfor %} 51 {%- endfor %}
52 }; 52 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698