OLD | NEW |
1 {%- set class_name = struct.name ~ "_Data" %} | 1 {%- set class_name = struct.name ~ "_Data" %} |
2 | 2 |
3 {#- TODO(yzshen): Consider eliminating _validate_object() and | 3 {#- TODO(yzshen): Consider eliminating _validate_object() and |
4 _validate_handle(). #} | 4 _validate_handle(). #} |
5 | 5 |
6 {#- Validates the specified struct field, which is supposed to be an object | 6 {#- Validates the specified struct field, which is supposed to be an object |
7 (struct/array/string/map/union). | 7 (struct/array/string/map/union). |
8 This macro is expanded by the Validate() method. #} | 8 This macro is expanded by the Validate() method. #} |
9 {%- macro _validate_object(struct, packed_field) %} | 9 {%- macro _validate_object(struct, packed_field) %} |
10 {%- set name = packed_field.field.name %} | 10 {%- set name = packed_field.field.name %} |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 mojo::internal::DecodeHandle(&{{name}}, handles); | 202 mojo::internal::DecodeHandle(&{{name}}, handles); |
203 {%- endif %} | 203 {%- endif %} |
204 {%- endif %} | 204 {%- endif %} |
205 {%- endfor %} | 205 {%- endfor %} |
206 } | 206 } |
207 | 207 |
208 {{class_name}}::{{class_name}}() { | 208 {{class_name}}::{{class_name}}() { |
209 header_.num_bytes = sizeof(*this); | 209 header_.num_bytes = sizeof(*this); |
210 header_.version = {{struct.versions[-1].version}}; | 210 header_.version = {{struct.versions[-1].version}}; |
211 } | 211 } |
OLD | NEW |