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

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

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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/struct_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
index 701ad333f1bf9072b8dfdce25f83336d749c87ea..adb958aee00c781ebce166841b129f40422c8a52 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
@@ -3,28 +3,17 @@
class {{class_name}} {
public:
- typedef {{struct.name}} Wrapper;
+ static {{class_name}}* New(mojo::internal::Buffer* buf);
- static {{class_name}}* New(mojo::Buffer* buf, mojo::Buffer::Destructor dtor = NULL);
+ mojo::internal::StructHeader header_;
+{{struct_macros.fields(struct)}}
-{#--- Setters -#}
-{{ struct_macros.setters(struct) }}
-
-{#--- Getters -#}
-{{ struct_macros.getters(struct) }}
-
- size_t ComputeSize() const;
- {{class_name}}* Clone(mojo::Buffer* buf) const;
- void CloseHandles();
void EncodePointersAndHandles(std::vector<mojo::Handle>* handles);
bool DecodePointersAndHandles(mojo::Message* message);
private:
{{class_name}}();
~{{class_name}}(); // NOT IMPLEMENTED
-
- mojo::internal::StructHeader _header_;
-{{ struct_macros.fields(struct) }}
};
MOJO_COMPILE_ASSERT(sizeof({{class_name}}) == {{struct.packed|struct_size}},
bad_sizeof_{{class_name}});

Powered by Google App Engine
This is Rietveld 408576698