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

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

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows bustage Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 {%- macro get_default(field) -%}
2 {%- if field.default -%}
3 {{field.default|expression_to_text(module)}}
4 {%- endif -%}
5 {%- endmacro -%}
6
7 // static
8 {{struct.name}}Ptr {{struct.name}}::New() {
9 {{struct.name}}Ptr rv;
10 mojo::internal::StructHelper<{{struct.name}}>::Initialize(&rv);
11 return rv.Pass();
12 }
13
14 {{struct.name}}::{{struct.name}}()
15 {%-for field in struct.fields %}
16 {% if loop.first %}:{% else %} {% endif %} {{field.name}}({{get_default(fiel d)}}){% if not loop.last %},{% endif %}
17 {%- endfor %} {
18 }
19
20 {{struct.name}}::~{{struct.name}}() {
21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698