OLD | NEW |
1 {%- import "validation_macros.tmpl" as validation_macros %} | 1 {%- import "validation_macros.tmpl" as validation_macros %} |
2 {%- set class_name = union.name ~ "_Data" %} | 2 {%- set class_name = union.name ~ "_Data" %} |
3 {%- set enum_name = union.name ~ "_Tag" -%} | 3 {%- set enum_name = union.name ~ "_Tag" -%} |
4 | 4 |
5 // static | 5 // static |
6 {{class_name}}* {{class_name}}::New(mojo::internal::Buffer* buf) { | 6 {{class_name}}* {{class_name}}::New(mojo::internal::Buffer* buf) { |
7 return new (buf->Allocate(sizeof({{class_name}}))) {{class_name}}(); | 7 return new (buf->Allocate(sizeof({{class_name}}))) {{class_name}}(); |
8 } | 8 } |
9 | 9 |
10 // static | 10 // static |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 {%- elif field.kind|is_interface_kind %} | 87 {%- elif field.kind|is_interface_kind %} |
88 mojo::internal::DecodeHandle( | 88 mojo::internal::DecodeHandle( |
89 reinterpret_cast<mojo::internal::Interface_Data*>( | 89 reinterpret_cast<mojo::internal::Interface_Data*>( |
90 &data.f_{{field.name}}), handles); | 90 &data.f_{{field.name}}), handles); |
91 {%- endif %} | 91 {%- endif %} |
92 return; | 92 return; |
93 } | 93 } |
94 {%- endfor %} | 94 {%- endfor %} |
95 } | 95 } |
96 } | 96 } |
OLD | NEW |