Index: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl |
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl |
index 1ba72350e72fc5549c0670749c14688da1a7b9fc..cb5a5fac5bf008316a3ae5e220ddc1ca810d7800 100644 |
--- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl |
+++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl |
@@ -13,6 +13,7 @@ |
{{struct.name}}::~{{struct.name}}() { |
} |
+ |
{% if struct|is_cloneable_kind %} |
{{struct.name}}Ptr {{struct.name}}::Clone() const { |
{{struct.name}}Ptr rv(New()); |
@@ -26,3 +27,11 @@ |
return rv.Pass(); |
} |
{% endif %} |
+ |
+bool {{struct.name}}::Equals(const {{struct.name}}& other) const { |
+{%- for field in struct.fields %} |
+ if (!mojo::internal::ValueTraits<{{field.kind|cpp_wrapper_type}}>::Equals({{field.name}}, other.{{field.name}})) |
+ return false; |
+{%- endfor %} |
+ return true; |
+} |