| 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
|
| index e6d04268520aa5f0f0a77a4c4e14839711d1c5ed..7f6c24d6549e16740fa67112bbc778a0ca1fa722 100644
|
| --- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
|
| +++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
|
| @@ -1,18 +1,23 @@
|
| -// static
|
| -{{struct.name}}Ptr {{struct.name}}::New() {
|
| - {{struct.name}}Ptr rv;
|
| - mojo::internal::StructHelper<{{struct.name}}>::Initialize(&rv);
|
| - return rv;
|
| -}
|
| -
|
| -{{struct.name}}::{{struct.name}}()
|
| -{%- for field in struct.fields %}
|
| - {% if loop.first %}:{% else %} {% endif %} {{field.name}}({{field|default_value}}){% if not loop.last %},{% endif %}
|
| -{%- endfor %} {
|
| -}
|
| -
|
| -{{struct.name}}::~{{struct.name}}() {
|
| -}
|
| +{% for num_params in range(struct|num_constructor_params) %}
|
| +{{struct.name}}::{{struct.name}}(
|
| +{%- for field in struct.fields[:num_params] %}
|
| +{%- set type = field.kind|cpp_wrapper_param_type %}
|
| +{%- set name = field.name %}
|
| + {{type}} {{name}}_in
|
| +{%- if not loop.last -%},{%- endif %}
|
| +{%- endfor %})
|
| +{%- for field in struct.fields %}
|
| +{%- set name = field.name %}
|
| + {% if loop.first %}:{% else %} {% endif %} {{name}}(
|
| +{%- if loop.index0 < num_params -%}
|
| +std::move({{name}}_in)
|
| +{%- else -%}
|
| +{{ field|default_value }}
|
| +{%- endif -%}
|
| +){% if not loop.last %},{% endif %}
|
| +{%- endfor %} {}
|
| +{% endfor %}
|
| +{{struct.name}}::~{{struct.name}}() = default;
|
|
|
| {%- if struct|is_hashable %}
|
| size_t {{struct.name}}::Hash(size_t seed) const {
|
|
|