OLD | NEW |
| (Empty) |
1 {%- import "struct_macros.tmpl" as struct_macros %} | |
2 {%- set class_name = struct.name ~ "_Data" -%} | |
3 | |
4 class {{class_name}} { | |
5 public: | |
6 static {{class_name}}* New(mojo::internal::Buffer* buf); | |
7 | |
8 static bool Validate(const void* data, | |
9 mojo::internal::BoundsChecker* bounds_checker); | |
10 | |
11 mojo::internal::StructHeader header_; | |
12 {{struct_macros.fields(struct)}} | |
13 | |
14 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles); | |
15 void DecodePointersAndHandles(std::vector<mojo::Handle>* handles); | |
16 | |
17 private: | |
18 {{class_name}}(); | |
19 ~{{class_name}}() = delete; | |
20 }; | |
21 static_assert(sizeof({{class_name}}) == {{struct.packed|struct_size}}, | |
22 "Bad sizeof({{class_name}})"); | |
OLD | NEW |