| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
| 13 #include "mojo/public/cpp/bindings/struct_traits.h" | |
| 14 | 13 |
| 15 namespace mojo { | 14 namespace mojo { |
| 16 namespace test { | 15 namespace test { |
| 17 | 16 |
| 18 // The mojom types are forward-declared to avoid circular dependencies between | |
| 19 // this and generated headers. | |
| 20 class StructWithTraits; | |
| 21 class StructWithTraits_Reader; | |
| 22 | |
| 23 // A type which knows how to look like a mojo::test::StructWithTraits mojom type | 17 // A type which knows how to look like a mojo::test::StructWithTraits mojom type |
| 24 // by way of mojo::StructTraits. | 18 // by way of mojo::StructTraits. |
| 25 class StructWithTraitsImpl { | 19 class StructWithTraitsImpl { |
| 26 public: | 20 public: |
| 27 StructWithTraitsImpl(); | 21 StructWithTraitsImpl(); |
| 28 ~StructWithTraitsImpl(); | 22 ~StructWithTraitsImpl(); |
| 29 | 23 |
| 30 void set_bool(bool value) { bool_ = value; } | 24 void set_bool(bool value) { bool_ = value; } |
| 31 bool get_bool() const { return bool_; } | 25 bool get_bool() const { return bool_; } |
| 32 | 26 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 43 bool bool_ = false; | 37 bool bool_ = false; |
| 44 uint32_t uint32_ = 0; | 38 uint32_t uint32_ = 0; |
| 45 uint64_t uint64_ = 0; | 39 uint64_t uint64_ = 0; |
| 46 std::string string_; | 40 std::string string_; |
| 47 }; | 41 }; |
| 48 | 42 |
| 49 } // namespace test | 43 } // namespace test |
| 50 } // namespace mojo | 44 } // namespace mojo |
| 51 | 45 |
| 52 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ | 46 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ |
| OLD | NEW |