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

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

Issue 917333003: Mojo C++ bindings templates: use the same templates for user-defined structs and method params. (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/params_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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(__clang__) 5 #if defined(__clang__)
6 #pragma clang diagnostic push 6 #pragma clang diagnostic push
7 #pragma clang diagnostic ignored "-Wunused-private-field" 7 #pragma clang diagnostic ignored "-Wunused-private-field"
8 #elif defined(_MSC_VER) 8 #elif defined(_MSC_VER)
9 #pragma warning(push) 9 #pragma warning(push)
10 #pragma warning(disable:4056) 10 #pragma warning(disable:4056)
(...skipping 29 matching lines...) Expand all
40 namespace { 40 namespace {
41 41
42 #pragma pack(push, 1) 42 #pragma pack(push, 1)
43 43
44 {#--- Interface parameter definitions #} 44 {#--- Interface parameter definitions #}
45 {%- for interface in interfaces %} 45 {%- for interface in interfaces %}
46 {%- for method in interface.methods %} 46 {%- for method in interface.methods %}
47 {%- set method_name = "k%s_%s_Name"|format(interface.name, method.name) %} 47 {%- set method_name = "k%s_%s_Name"|format(interface.name, method.name) %}
48 const uint32_t {{method_name}} = {{method.ordinal}}; 48 const uint32_t {{method_name}} = {{method.ordinal}};
49 {% set struct = method|struct_from_method %} 49 {% set struct = method|struct_from_method %}
50 {%- include "params_definition.tmpl" %} 50 {% include "struct_declaration.tmpl" %}
51 {%- include "struct_definition.tmpl" %}
51 {%- if method.response_parameters != None %} 52 {%- if method.response_parameters != None %}
52 {%- set struct = method|response_struct_from_method %} 53 {%- set struct = method|response_struct_from_method %}
53 {%- include "params_definition.tmpl" %} 54 {% include "struct_declaration.tmpl" %}
55 {%- include "struct_definition.tmpl" %}
54 {%- endif %} 56 {%- endif %}
55 {%- endfor %} 57 {%- endfor %}
56 {%- endfor %} 58 {%- endfor %}
57 59
58 #pragma pack(pop) 60 #pragma pack(pop)
59 61
60 } // namespace 62 } // namespace
61 63
62 {#--- Struct definitions #} 64 {#--- Struct definitions #}
63 {% for struct in structs %} 65 {% for struct in structs %}
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 107
106 {%- for namespace in namespaces_as_array|reverse %} 108 {%- for namespace in namespaces_as_array|reverse %}
107 } // namespace {{namespace}} 109 } // namespace {{namespace}}
108 {%- endfor %} 110 {%- endfor %}
109 111
110 #if defined(__clang__) 112 #if defined(__clang__)
111 #pragma clang diagnostic pop 113 #pragma clang diagnostic pop
112 #elif defined(_MSC_VER) 114 #elif defined(_MSC_VER)
113 #pragma warning(pop) 115 #pragma warning(pop)
114 #endif 116 #endif
OLDNEW
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698