Well, for probably the most common case (std::vector) we'll eventually just change the bindings to use this by default. I think that's still a goal but Yuzhu can confirm.
For other cases wrapping in a struct doesn't seem too clumsy to me and the cost seems negligible.
>
> Does typemapping of mojo::Arrays make sense? Thanks
Kind of, but I don't think we should do it. Lots of complexity for relatively little payoff.
>
> Fady
>
> --
> You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
> To post to this group, send email to chromi...@chromium.org.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMZzjT%3DkK-9X7rv15%3DH6O07kkQV2AAcFUvmxwuf7KkPsV1-U_Q%40mail.gmail.com.
On Jun 14, 2016 4:38 AM, "Fady Samuel" <fsa...@chromium.org> wrote:
>
> There are a couple of cases that I know of where we'd like to pass around arrays through interface methods:
>
> 1. https://codereview.chromium.org/1992443002/patch/200001/210008
> 2. https://cs.chromium.org/chromium/src/components/mus/public/interfaces/compositor_frame.mojom?q=compositor_frame.mojom&sq=package:chromium&l=33
>
> Currently the naive solution is to use type converters to an from mojo::Arrays which results in extra copies. A slightly better solution is to wrap the array in a struct and use StructTraits to map to an std::vector. This works, although maybe a little bit clumsy.Well, for probably the most common case (std::vector) we'll eventually just change the bindings to use this by default. I think that's still a goal but Yuzhu can confirm.
For other cases wrapping in a struct doesn't seem too clumsy to me and the cost seems negligible.
>
> Does typemapping of mojo::Arrays make sense? ThanksKind of, but I don't think we should do it. Lots of complexity for relatively little payoff.
>
--
> Fady
>
> --
> You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
> To post to this group, send email to chromi...@chromium.org.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMZzjT%3DkK-9X7rv15%3DH6O07kkQV2AAcFUvmxwuf7KkPsV1-U_Q%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CA%2BapAgG1gBCWLAuu7U939c%2BJjyENghXv4Ce%3Dz-Y6TRuh_8tWmA%40mail.gmail.com.