Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_declaration.tmpl

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_declaration.tmpl
deleted file mode 100644
index 91ea7cf70f7ccf7fc09de9f85f44693db8f404d2..0000000000000000000000000000000000000000
--- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_declaration.tmpl
+++ /dev/null
@@ -1,50 +0,0 @@
-class {{union.name}} {
- public:
- typedef internal::{{union.name}}_Data Data_;
- typedef Data_::{{union.name}}_Tag Tag;
-
- static {{union.name}}Ptr New();
-
- template <typename U>
- static {{union.name}}Ptr From(const U& u) {
- return mojo::TypeConverter<{{union.name}}Ptr, U>::Convert(u);
- }
-
- template <typename U>
- U To() const {
- return mojo::TypeConverter<U, {{union.name}}>::Convert(*this);
- }
-
- {{union.name}}();
- ~{{union.name}}();
-
-{% if union|is_cloneable_kind %}
- {{union.name}}Ptr Clone() const;
-{%- endif %}
- bool Equals(const {{union.name}}& other) const;
-
- Tag which() const {
- return tag_;
- }
-
-{% for field in union.fields %}
- bool is_{{field.name}}() const;
- {{field.kind|cpp_result_type}} get_{{field.name}}() const;
- void set_{{field.name}}({{field.kind|cpp_const_wrapper_type}} {{field.name}});
-{%- endfor %}
-
- private:
- friend class mojo::internal::UnionAccessor<{{union.name}}>;
- union Union_ {
- Union_() {}
- ~Union_() {}
-{% for field in union.fields %}
- {{field.kind|cpp_wrapper_type}} {{field.name}};
-{%- endfor %}
- };
- void SwitchActive(Tag new_active);
- void SetActive(Tag new_active);
- void DestroyActive();
- Tag tag_;
- Union_ data_;
-};

Powered by Google App Engine
This is Rietveld 408576698