| Index: mojo/public/cpp/bindings/type_converter.h
|
| diff --git a/mojo/public/cpp/bindings/type_converter.h b/mojo/public/cpp/bindings/type_converter.h
|
| index 147d83b495f2d39d918d732cd98be1616329ce05..83597747c55d2887b8ca1531a328ab448fd02730 100644
|
| --- a/mojo/public/cpp/bindings/type_converter.h
|
| +++ b/mojo/public/cpp/bindings/type_converter.h
|
| @@ -7,10 +7,26 @@
|
|
|
| namespace mojo {
|
|
|
| -// Specialize to perform type conversion for Mojom-defined structs and arrays.
|
| -// Here, T is the Mojom-defined struct or array, and U is some other non-Mojom
|
| +// Specialize the following class:
|
| +// template <typename T, typename U> class TypeConverter;
|
| +// to perform type conversion for Mojom-defined structs and arrays. Here, T is
|
| +// the Mojom-defined struct or array, and U is some other non-Mojom
|
| // struct or array type.
|
| //
|
| +// Specializations should implement the following interface:
|
| +// namespace mojo {
|
| +// template <>
|
| +// class TypeConverter<T, U> {
|
| +// public:
|
| +// static T ConvertFrom(const U& input, Buffer* buf);
|
| +// static U ConvertTo(const T& input);
|
| +//
|
| +// // Maybe (mutually exclusive):
|
| +// MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION();
|
| +// MOJO_INHERIT_IMPLICIT_TYPE_CONVERSION(X, Y);
|
| +// };
|
| +// }
|
| +//
|
| // EXAMPLE:
|
| //
|
| // Suppose you have the following Mojom-defined struct:
|
| @@ -94,14 +110,7 @@ namespace mojo {
|
| // Although these macros are convenient, they make conversions less obvious.
|
| // Users may do conversions excessively without paying attention to the cost. So
|
| // please use them wisely.
|
| -template <typename T, typename U> class TypeConverter {
|
| - // static T ConvertFrom(const U& input, Buffer* buf);
|
| - // static U ConvertTo(const T& input);
|
| -
|
| - // Maybe (mutually exclusive):
|
| - // MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION();
|
| - // MOJO_INHERIT_IMPLICIT_TYPE_CONVERSION(X, Y);
|
| -};
|
| +template <typename T, typename U> class TypeConverter;
|
|
|
| } // namespace mojo
|
|
|
|
|