Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: mojo/public/cpp/bindings/array.h

Issue 611633002: mojom: Add associative arrays to the mojom language. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved test classes to their own shared file. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/array_internal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/array_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698