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 <map> | 10 #include <map> |
(...skipping 18 matching lines...) Expand all Loading... |
29 int32_t value = 0; | 29 int32_t value = 0; |
30 }; | 30 }; |
31 | 31 |
32 // A type which knows how to look like a mojo::test::StructWithTraits mojom type | 32 // A type which knows how to look like a mojo::test::StructWithTraits mojom type |
33 // by way of mojo::StructTraits. | 33 // by way of mojo::StructTraits. |
34 class StructWithTraitsImpl { | 34 class StructWithTraitsImpl { |
35 public: | 35 public: |
36 StructWithTraitsImpl(); | 36 StructWithTraitsImpl(); |
37 ~StructWithTraitsImpl(); | 37 ~StructWithTraitsImpl(); |
38 | 38 |
| 39 StructWithTraitsImpl(const StructWithTraitsImpl& other); |
| 40 |
39 void set_bool(bool value) { bool_ = value; } | 41 void set_bool(bool value) { bool_ = value; } |
40 bool get_bool() const { return bool_; } | 42 bool get_bool() const { return bool_; } |
41 | 43 |
42 void set_uint32(uint32_t value) { uint32_ = value; } | 44 void set_uint32(uint32_t value) { uint32_ = value; } |
43 uint32_t get_uint32() const { return uint32_; } | 45 uint32_t get_uint32() const { return uint32_; } |
44 | 46 |
45 void set_uint64(uint64_t value) { uint64_ = value; } | 47 void set_uint64(uint64_t value) { uint64_ = value; } |
46 uint64_t get_uint64() const { return uint64_; } | 48 uint64_t get_uint64() const { return uint64_; } |
47 | 49 |
48 void set_string(std::string value) { string_ = value; } | 50 void set_string(std::string value) { string_ = value; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 class PassByValueStructWithTraitsImpl { | 90 class PassByValueStructWithTraitsImpl { |
89 public: | 91 public: |
90 PassByValueStructWithTraitsImpl(); | 92 PassByValueStructWithTraitsImpl(); |
91 PassByValueStructWithTraitsImpl(PassByValueStructWithTraitsImpl&& other); | 93 PassByValueStructWithTraitsImpl(PassByValueStructWithTraitsImpl&& other); |
92 ~PassByValueStructWithTraitsImpl(); | 94 ~PassByValueStructWithTraitsImpl(); |
93 | 95 |
94 ScopedHandle& get_mutable_handle() { return handle_; } | 96 ScopedHandle& get_mutable_handle() { return handle_; } |
95 | 97 |
96 private: | 98 private: |
97 ScopedHandle handle_; | 99 ScopedHandle handle_; |
| 100 DISALLOW_COPY_AND_ASSIGN(PassByValueStructWithTraitsImpl); |
98 }; | 101 }; |
99 | 102 |
100 } // namespace test | 103 } // namespace test |
101 } // namespace mojo | 104 } // namespace mojo |
102 | 105 |
103 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ | 106 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ |
OLD | NEW |