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

Unified Diff: mojo/public/cpp/bindings/tests/struct_with_traits_impl.h

Issue 2014403002: Mojo C++ bindings: custom type mapping of map (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/cpp/bindings/tests/struct_with_traits_impl.h
diff --git a/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h b/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h
index a714da9477489e290f97fc002fee006aaedc4540..abcb23e8210ce7c1ed3bdf0faa498978c1ec46ae 100644
--- a/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h
+++ b/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include <map>
#include <string>
#include <vector>
@@ -18,6 +19,9 @@ namespace test {
struct NestedStructWithTraitsImpl {
public:
+ NestedStructWithTraitsImpl();
+ explicit NestedStructWithTraitsImpl(int32_t in_value);
+
bool operator==(const NestedStructWithTraitsImpl& other) const {
return value == other.value;
}
@@ -60,6 +64,14 @@ class StructWithTraitsImpl {
return struct_array_;
}
+ const std::map<std::string, NestedStructWithTraitsImpl>& get_struct_map()
+ const {
+ return struct_map_;
+ }
+ std::map<std::string, NestedStructWithTraitsImpl>& get_mutable_struct_map() {
+ return struct_map_;
+ }
+
private:
bool bool_ = false;
uint32_t uint32_ = 0;
@@ -68,6 +80,7 @@ class StructWithTraitsImpl {
std::vector<std::string> string_array_;
NestedStructWithTraitsImpl struct_;
std::vector<NestedStructWithTraitsImpl> struct_array_;
+ std::map<std::string, NestedStructWithTraitsImpl> struct_map_;
};
// A type which knows how to look like a mojo::test::PassByValueStructWithTraits
« no previous file with comments | « mojo/public/cpp/bindings/tests/struct_traits_unittest.cc ('k') | mojo/public/cpp/bindings/tests/struct_with_traits_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698