OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BINDINGS_TYPE_CONVERTER_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_TYPE_CONVERTER_H_ |
6 #define MOJO_PUBLIC_BINDINGS_TYPE_CONVERTER_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_TYPE_CONVERTER_H_ |
7 | 7 |
8 namespace mojo { | 8 namespace mojo { |
9 | 9 |
10 // Specialize to perform type conversion for Mojom-defined structs and arrays. | 10 // Specialize to perform type conversion for Mojom-defined structs and arrays. |
11 // Here, T is the Mojom-defined struct or array, and U is some other non-Mojom | 11 // Here, T is the Mojom-defined struct or array, and U is some other non-Mojom |
12 // struct or array type. | 12 // struct or array type. |
13 // | 13 // |
14 // EXAMPLE: | 14 // EXAMPLE: |
15 // | 15 // |
16 // Suppose you have the following Mojom-defined struct: | 16 // Suppose you have the following Mojom-defined struct: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // geometry::Point output = pt; | 58 // geometry::Point output = pt; |
59 // } | 59 // } |
60 // | 60 // |
61 template <typename T, typename U> class TypeConverter { | 61 template <typename T, typename U> class TypeConverter { |
62 // static T ConvertFrom(const U& input, Buffer* buf); | 62 // static T ConvertFrom(const U& input, Buffer* buf); |
63 // static U ConvertTo(const T& input); | 63 // static U ConvertTo(const T& input); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace mojo | 66 } // namespace mojo |
67 | 67 |
68 #endif // MOJO_PUBLIC_BINDINGS_TYPE_CONVERTER_H_ | 68 #endif // MOJO_PUBLIC_CPP_BINDINGS_TYPE_CONVERTER_H_ |
OLD | NEW |