Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / mojo / public / tools / bindings / generators / cpp_templates / wrapper_class_definition.tmpl
index 29bdd8e..da93e07 100644 (file)
@@ -6,10 +6,32 @@
 }
 
 {{struct.name}}::{{struct.name}}()
-{%-for field in struct.fields %}
+{%- for field in struct.fields %}
     {% if loop.first %}:{% else %} {% endif %} {{field.name}}({{field|default_value}}){% if not loop.last %},{% endif %}
 {%- endfor %} {
 }
 
 {{struct.name}}::~{{struct.name}}() {
 }
+
+{%  if struct|is_cloneable_kind %}
+{{struct.name}}Ptr {{struct.name}}::Clone() const {
+  {{struct.name}}Ptr rv(New());
+{%-   for field in struct.fields %}
+{%-     if field.kind|is_struct_kind or field.kind|is_array_kind or field.kind|is_map_kind %}
+  rv->{{field.name}} = {{field.name}}.Clone();
+{%-     else %}
+  rv->{{field.name}} = {{field.name}};
+{%-     endif %}
+{%-   endfor %}
+  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;
+}