OLD | NEW |
| (Empty) |
1 {%- import "struct_macros.tmpl" as struct_macros %} | |
2 {%- set class_name = "%s::internal::%s_Data"|format(namespace, struct.name) %} | |
3 {%- set param_name = "params" %} | |
4 template <> | |
5 class ObjectTraits<{{class_name}}> { | |
6 public: | |
7 static void CloseHandles({{class_name}}* {{param_name}}) { | |
8 {%- for pf in struct.packed.packed_fields if pf.field.kind|is_object_kind %} | |
9 mojo::internal::CloseHandles({{param_name}}->{{pf.field.name}}_.ptr); | |
10 {%- endfor %} | |
11 } | |
12 | |
13 static void EncodePointersAndHandles( | |
14 {{class_name}}* {{param_name}}, | |
15 std::vector<Handle>* handles) { | |
16 {{ struct_macros.encodes(struct, param_name)|indent(4) }} | |
17 } | |
18 | |
19 static bool DecodePointersAndHandles( | |
20 {{class_name}}* {{param_name}}, | |
21 Message* message) { | |
22 {{ struct_macros.decodes(struct, param_name)|indent(4) }} | |
23 return true; | |
24 } | |
25 }; | |
OLD | NEW |