| OLD | NEW |
| 1 size_t GetSerializedSize_(const {{struct.name}}Ptr& input, | 1 size_t GetSerializedSize_(const {{struct.name}}Ptr& input, |
| 2 mojo::internal::SerializationContext* context); | 2 mojo::internal::SerializationContext* context); |
| 3 void Serialize_({{struct.name}}Ptr input, mojo::internal::Buffer* buffer, | 3 void Serialize_({{struct.name}}Ptr input, mojo::internal::Buffer* buffer, |
| 4 internal::{{struct.name}}_Data** output, | 4 internal::{{struct.name}}_Data** output, |
| 5 mojo::internal::SerializationContext* context); | 5 mojo::internal::SerializationContext* context); |
| 6 bool Deserialize_(internal::{{struct.name}}_Data* input, | 6 bool Deserialize_(internal::{{struct.name}}_Data* input, |
| 7 {{struct.name}}Ptr* output, | 7 {{struct.name}}Ptr* output, |
| 8 mojo::internal::SerializationContext* context); | 8 mojo::internal::SerializationContext* context); |
| 9 | 9 |
| 10 {%- if struct|is_native_only_kind and struct|is_typemapped_kind %} | 10 {%- if struct|is_native_only_kind and struct|is_typemapped_kind %} |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 {%- for namespace in namespaces_as_array %} | 37 {%- for namespace in namespaces_as_array %} |
| 38 namespace {{namespace}} { | 38 namespace {{namespace}} { |
| 39 {%- endfor %} | 39 {%- endfor %} |
| 40 {%- if variant %} | 40 {%- if variant %} |
| 41 namespace {{variant}} { | 41 namespace {{variant}} { |
| 42 {%- endif %} | 42 {%- endif %} |
| 43 | 43 |
| 44 {%- endif %} | 44 {%- endif %} |
| 45 | 45 |
| 46 {%- if not variant and not struct|is_native_only_kind %} | 46 {%- if not variant and not struct|is_native_only_kind %} |
| 47 | 47 |
| 48 {# NOTE: Generated Reader instances are intentionally cheap to copy and devoid | 48 {# NOTE: Generated Reader instances are intentionally cheap to copy and devoid |
| 49 of heap allocations. They should stay this way. #} | 49 of heap allocations. They should stay this way. #} |
| 50 class {{struct.name}}_Reader { | 50 class {{struct.name}}_Reader { |
| 51 public: | 51 public: |
| 52 {{struct.name}}_Reader(internal::{{struct.name}}_Data* data, | 52 {{struct.name}}_Reader(internal::{{struct.name}}_Data* data, |
| 53 mojo::internal::SerializationContext* context); | 53 mojo::internal::SerializationContext* context); |
| 54 | 54 |
| 55 {%- for pf in struct.packed.packed_fields_in_ordinal_order %} | 55 {%- for pf in struct.packed.packed_fields_in_ordinal_order %} |
| 56 {%- set kind = pf.field.kind -%} | 56 {%- set kind = pf.field.kind -%} |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 static bool Deserialize(internal::{{struct.name}}_Data* input, | 148 static bool Deserialize(internal::{{struct.name}}_Data* input, |
| 149 NativeType* output, | 149 NativeType* output, |
| 150 mojo::internal::SerializationContext* context) { | 150 mojo::internal::SerializationContext* context) { |
| 151 return mojo::StructTraits<{{struct.name}}, NativeType>::Read( | 151 return mojo::StructTraits<{{struct.name}}, NativeType>::Read( |
| 152 {{struct.name}}_Reader(input, context), output); | 152 {{struct.name}}_Reader(input, context), output); |
| 153 } | 153 } |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 {%- endif %} {# not variant #} | 156 {%- endif %} {# not variant #} |
| OLD | NEW |