OLD | NEW |
1 {% import 'fields/base.tmpl' as base %} | 1 {% import 'fields/base.tmpl' as base %} |
2 {% from 'fields/field.tmpl' import getter_expression, setter_expression %} | 2 {% from 'fields/field.tmpl' import getter_expression, setter_expression %} |
3 | 3 |
4 {% macro decl_public_methods(field) %} | 4 {% macro decl_public_methods(field) %} |
5 {{base.decl_initial_method(field)}} | 5 {{base.decl_initial_method(field)}} |
6 {{base.decl_getter_method(field)}} | 6 {{base.decl_getter_method(field)}} |
7 {{base.decl_setter_method(field)}} | 7 {{base.decl_setter_method(field)}} |
8 void {{field.setter_method_name}}({{field.type_name}}&& v) { | 8 void {{field.setter_method_name}}({{field.type_name}}&& v) { |
9 {% if field.group_member_name %} | 9 {% if field.group %} |
10 if (!({{getter_expression(field)}} == v)) | 10 if (!({{getter_expression(field)}} == v)) |
11 {{setter_expression(field)}} = std::move(v); | 11 {{setter_expression(field)}} = std::move(v); |
12 {% else %} | 12 {% else %} |
13 {{field.name}} = std::move(v); | 13 {{field.name}} = std::move(v); |
14 {% endif %} | 14 {% endif %} |
15 } | 15 } |
16 {{base.decl_resetter_method(field)}} | 16 {{base.decl_resetter_method(field)}} |
17 {% endmacro %} | 17 {% endmacro %} |
18 | 18 |
19 {% macro decl_protected_methods(field) -%} | 19 {% macro decl_protected_methods(field) -%} |
20 {{base.decl_mutable_method(field)}} | 20 {{base.decl_mutable_method(field)}} |
21 {%- endmacro %} | 21 {%- endmacro %} |
OLD | NEW |