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 MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
7 | 7 |
| 8 #include <stddef.h> |
8 #include <string.h> | 9 #include <string.h> |
9 | 10 |
10 #include <algorithm> | 11 #include <algorithm> |
11 #include <cstddef> | 12 #include <cstddef> |
12 #include <set> | 13 #include <set> |
13 #include <string> | 14 #include <string> |
14 #include <vector> | 15 #include <vector> |
15 | 16 |
16 #include "mojo/public/cpp/bindings/lib/array_internal.h" | 17 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
17 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" | 18 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
(...skipping 13 matching lines...) Expand all Loading... |
31 using Traits = internal::ArrayTraits<T, internal::IsMoveOnlyType<T>::value>; | 32 using Traits = internal::ArrayTraits<T, internal::IsMoveOnlyType<T>::value>; |
32 using ForwardType = typename Traits::ForwardType; | 33 using ForwardType = typename Traits::ForwardType; |
33 | 34 |
34 typedef internal::Array_Data<typename internal::WrapperTraits<T>::DataType> | 35 typedef internal::Array_Data<typename internal::WrapperTraits<T>::DataType> |
35 Data_; | 36 Data_; |
36 | 37 |
37 // Constructs a new array that is null. | 38 // Constructs a new array that is null. |
38 Array() : is_null_(true) {} | 39 Array() : is_null_(true) {} |
39 | 40 |
40 // Makes null arrays implicitly constructible from |nullptr|. | 41 // Makes null arrays implicitly constructible from |nullptr|. |
41 Array(decltype(nullptr)) : is_null_(true) {} | 42 Array(std::nullptr_t) : is_null_(true) {} |
42 | 43 |
43 ~Array() {} | 44 ~Array() {} |
44 | 45 |
45 // Moves the contents of |other| into this array. | 46 // Moves the contents of |other| into this array. |
46 Array(Array&& other) : is_null_(true) { Take(&other); } | 47 Array(Array&& other) : is_null_(true) { Take(&other); } |
47 Array& operator=(Array&& other) { | 48 Array& operator=(Array&& other) { |
48 Take(&other); | 49 Take(&other); |
49 return *this; | 50 return *this; |
50 } | 51 } |
51 | 52 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 for (size_t i = 0; i < input.size(); ++i) | 306 for (size_t i = 0; i < input.size(); ++i) |
306 result.insert(TypeConverter<E, T>::Convert(input[i])); | 307 result.insert(TypeConverter<E, T>::Convert(input[i])); |
307 } | 308 } |
308 return result; | 309 return result; |
309 } | 310 } |
310 }; | 311 }; |
311 | 312 |
312 } // namespace mojo | 313 } // namespace mojo |
313 | 314 |
314 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 315 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
OLD | NEW |