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..efefec06fa7f2128e4442048c8f323facd87e747 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}}() { |
} |
+ |
yzshen1
2014/10/14 21:47:21
(Results in two empty lines in the generated code)
|
{% 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 %} |
yzshen1
2014/10/14 21:47:21
nit: {%- to avoid an unnecessary empty line.
Aaron Boodman
2014/10/14 22:30:13
Done.
|
+ if (!mojo::internal::ValueTraits<{{field.kind|cpp_wrapper_type}}>::Equals({{field.name}}, other.{{field.name}})) |
+ return false; |
+{% endfor %} |
+ return true; |
+} |