| 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 <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "mojo/public/cpp/bindings/lib/array_internal.h" | 14 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
| 15 #include "mojo/public/cpp/bindings/lib/template_util.h" | 15 #include "mojo/public/cpp/bindings/lib/template_util.h" |
| 16 #include "mojo/public/cpp/bindings/type_converter.h" | 16 #include "mojo/public/cpp/bindings/type_converter.h" |
| 17 | 17 |
| 18 namespace mojo { | 18 namespace mojo { |
| 19 | 19 |
| 20 // Provides read-only access to array data. | |
| 21 template <typename T> | 20 template <typename T> |
| 22 class Array { | 21 class Array { |
| 23 MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(Array, RValue) | 22 MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(Array, RValue) |
| 24 public: | 23 public: |
| 25 typedef internal::ArrayTraits<T, internal::IsMoveOnlyType<T>::value> Traits; | 24 typedef internal::ArrayTraits<T, internal::IsMoveOnlyType<T>::value> Traits; |
| 26 typedef typename Traits::ConstRefType ConstRefType; | 25 typedef typename Traits::ConstRefType ConstRefType; |
| 27 typedef typename Traits::RefType RefType; | 26 typedef typename Traits::RefType RefType; |
| 28 typedef typename Traits::StorageType StorageType; | 27 typedef typename Traits::StorageType StorageType; |
| 29 typedef typename Traits::ForwardType ForwardType; | 28 typedef typename Traits::ForwardType ForwardType; |
| 30 | 29 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 for (size_t i = 0; i < input.size(); ++i) | 142 for (size_t i = 0; i < input.size(); ++i) |
| 144 result[i] = TypeConverter<E, T>::Convert(input[i]); | 143 result[i] = TypeConverter<E, T>::Convert(input[i]); |
| 145 } | 144 } |
| 146 return result; | 145 return result; |
| 147 } | 146 } |
| 148 }; | 147 }; |
| 149 | 148 |
| 150 } // namespace mojo | 149 } // namespace mojo |
| 151 | 150 |
| 152 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 151 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
| OLD | NEW |