| Index: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
|
| diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c743d6f49008a835a7abd00bca87f28b6ca1884d
|
| --- /dev/null
|
| +++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
|
| @@ -0,0 +1,21 @@
|
| +{%- macro get_default(field) -%}
|
| +{%- if field.default -%}
|
| +{{field.default|expression_to_text(module)}}
|
| +{%- endif -%}
|
| +{%- endmacro -%}
|
| +
|
| +// static
|
| +{{struct.name}}Ptr {{struct.name}}::New() {
|
| + {{struct.name}}Ptr rv;
|
| + mojo::internal::StructHelper<{{struct.name}}>::Initialize(&rv);
|
| + return rv.Pass();
|
| +}
|
| +
|
| +{{struct.name}}::{{struct.name}}()
|
| +{%-for field in struct.fields %}
|
| + {% if loop.first %}:{% else %} {% endif %} {{field.name}}({{get_default(field)}}){% if not loop.last %},{% endif %}
|
| +{%- endfor %} {
|
| +}
|
| +
|
| +{{struct.name}}::~{{struct.name}}() {
|
| +}
|
|
|