| {% for constructor in struct|struct_constructors %} |
| {{struct.name}}::{{struct.name}}( |
| {%- for field in constructor.params %} |
| {%- set type = field.kind|cpp_wrapper_param_type %} |
| {%- set name = field.name %} |
| {{type}} {{name}}_in |
| {%- if not loop.last -%},{%- endif %} |
| {%- endfor %}) |
| {%- for field, is_parameter in constructor.fields %} |
| {%- set name = field.name %} |
| {% if loop.first %}:{% else %} {% endif %} {{name}}( |
| {%- if is_parameter -%} |
| 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 { |
| {%- for field in struct.fields %} |
| {%- if for_blink %} |
| seed = mojo::internal::WTFHash(seed, this->{{field.name}}); |
| {%- else %} |
| seed = mojo::internal::Hash(seed, this->{{field.name}}); |
| {%- endif %} |
| {%- endfor %} |
| return seed; |
| } |
| {%- endif %} |
| |
| bool {{struct.name}}::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| return Data_::Validate(data, validation_context); |
| } |