Index: mojo/public/bindings/generators/cpp_templates/struct_serialization_definition |
diff --git a/mojo/public/bindings/generators/cpp_templates/struct_serialization_definition b/mojo/public/bindings/generators/cpp_templates/struct_serialization_definition |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1d688bb8ecd1782d62d473a20c5a4846c6b34ac5 |
--- /dev/null |
+++ b/mojo/public/bindings/generators/cpp_templates/struct_serialization_definition |
@@ -0,0 +1,16 @@ |
+// static |
+size_t ObjectTraits<$CLASS>::ComputeSizeOf( |
+ const $CLASS* $NAME) { |
+$SIZES |
+} |
+ |
+// static |
+$CLASS* ObjectTraits<$CLASS>::Clone( |
+ const $CLASS* $NAME, Buffer* buf) { |
+ $CLASS* clone = $CLASS::New(buf); |
+ memcpy(clone, $NAME, sizeof(*$NAME)); |
+$CLONES |
+ return clone; |
+} |
+ |
+$SERIALIZATION |