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

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

Issue 1968623002: Mojo C++ bindings: expose public <struct>DataView and StringDataView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@25_totally_new
Patch Set: Created 4 years, 7 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 // 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 variant -%} 5 {%- if variant -%}
6 {%- set variant_path = "%s-%s"|format(module.path, variant) -%} 6 {%- set variant_path = "%s-%s"|format(module.path, variant) -%}
7 {%- else -%} 7 {%- else -%}
8 {%- set variant_path = module.path -%} 8 {%- set variant_path = module.path -%}
9 {%- endif %} 9 {%- endif %}
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 {%- endif %} 89 {%- endif %}
90 {%- endfor %} 90 {%- endfor %}
91 91
92 {#--- Union definitions #} 92 {#--- Union definitions #}
93 {% for union in unions %} 93 {% for union in unions %}
94 {%- include "union_definition.tmpl" %} 94 {%- include "union_definition.tmpl" %}
95 {%- endfor %} 95 {%- endfor %}
96 96
97 } // namespace internal 97 } // namespace internal
98 98
99 namespace {
100
101 {#--- Interface parameter data view definitions #}
102 {%- for interface in interfaces %}
103 {%- for method in interface.methods %}
104 {% set struct = method.param_struct %}
105 {% include "struct_data_view_declaration.tmpl" %}
106 {% include "struct_data_view_definition.tmpl" %}
107 {%- if method.response_parameters != None %}
108 {%- set struct = method.response_param_struct %}
109 {% include "struct_data_view_declaration.tmpl" %}
110 {% include "struct_data_view_definition.tmpl" %}
111 {%- endif %}
112 {%- endfor %}
113 {%- endfor %}
114
115 } // namespace
116
99 {#--- Struct Constants #} 117 {#--- Struct Constants #}
100 {%- for struct in structs %} 118 {%- for struct in structs %}
101 {%- for constant in struct.constants %} 119 {%- for constant in struct.constants %}
102 {%- if constant.kind|is_integral_kind %} 120 {%- if constant.kind|is_integral_kind %}
103 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}}; 121 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}};
104 {%- else %} 122 {%- else %}
105 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons tant|constant_value}}; 123 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons tant|constant_value}};
106 {%- endif %} 124 {%- endif %}
107 {%- endfor %} 125 {%- endfor %}
108 {%- endfor %} 126 {%- endfor %}
109 127
110 {#--- Struct builder definitions #} 128 {#--- Struct builder definitions #}
111 {%- for struct in structs %} 129 {%- for struct in structs %}
112 {%- if not struct|is_native_only_kind %} 130 {%- if not struct|is_native_only_kind %}
113 {%- include "wrapper_class_definition.tmpl" %} 131 {%- include "wrapper_class_definition.tmpl" %}
132 {%- include "struct_data_view_definition.tmpl" %}
114 {%- endif %} 133 {%- endif %}
115 {%- endfor %} 134 {%- endfor %}
116 135
117 {#--- Union builder definitions #} 136 {#--- Union builder definitions #}
118 {%- for union in unions %} 137 {%- for union in unions %}
119 {%- include "wrapper_union_class_definition.tmpl" %} 138 {%- include "wrapper_union_class_definition.tmpl" %}
120 {%- endfor %} 139 {%- endfor %}
121 140
122 {#--- Interface definitions #} 141 {#--- Interface definitions #}
123 {%- for interface in interfaces %} 142 {%- for interface in interfaces %}
(...skipping 22 matching lines...) Expand all
146 {%- endfor %} 165 {%- endfor %}
147 166
148 } // namespace mojo 167 } // namespace mojo
149 168
150 169
151 #if defined(__clang__) 170 #if defined(__clang__)
152 #pragma clang diagnostic pop 171 #pragma clang diagnostic pop
153 #elif defined(_MSC_VER) 172 #elif defined(_MSC_VER)
154 #pragma warning(pop) 173 #pragma warning(pop)
155 #endif 174 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698