OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
6 #define THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
7 | 7 |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/array_internal.h" | 15 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
16 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/bindings_internal.h" | 16 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
17 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/template_util.h" | 17 #include "mojo/public/cpp/bindings/lib/template_util.h" |
18 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/value_traits.h" | 18 #include "mojo/public/cpp/bindings/lib/value_traits.h" |
19 #include "third_party/mojo/src/mojo/public/cpp/bindings/type_converter.h" | 19 #include "mojo/public/cpp/bindings/type_converter.h" |
20 | 20 |
21 namespace mojo { | 21 namespace mojo { |
22 | 22 |
23 // Represents a moveable array with contents of type |T|. The array can be null, | 23 // Represents a moveable array with contents of type |T|. The array can be null, |
24 // meaning that no value has been assigned to it. Null is distinct from empty. | 24 // meaning that no value has been assigned to it. Null is distinct from empty. |
25 template <typename T> | 25 template <typename T> |
26 class Array { | 26 class Array { |
27 MOJO_MOVE_ONLY_TYPE(Array) | 27 MOJO_MOVE_ONLY_TYPE(Array) |
28 public: | 28 public: |
29 typedef internal::ArrayTraits<T, internal::IsMoveOnlyType<T>::value> Traits; | 29 typedef internal::ArrayTraits<T, internal::IsMoveOnlyType<T>::value> Traits; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 if (!input.is_null()) { | 239 if (!input.is_null()) { |
240 for (size_t i = 0; i < input.size(); ++i) | 240 for (size_t i = 0; i < input.size(); ++i) |
241 result.insert(TypeConverter<E, T>::Convert(input[i])); | 241 result.insert(TypeConverter<E, T>::Convert(input[i])); |
242 } | 242 } |
243 return result; | 243 return result; |
244 } | 244 } |
245 }; | 245 }; |
246 | 246 |
247 } // namespace mojo | 247 } // namespace mojo |
248 | 248 |
249 #endif // THIRD_PARTY_MOJO_SRC_MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 249 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
OLD | NEW |