[vtk-developers] zero-copy mixed language support in vtkDataArray

Burlen Loring burlen.loring at gmail.com
Fri Jan 17 18:21:42 EST 2014


Hi Ben,

> These overrides aren't going to be wrapped, so will only be accessible
> from C++ code. Is that the intention?

Yes, my intention is that for now they'd be used from glue code rather 
than exposed directly. In the future the API could be exposed in the 
wrapped languages if there were a compelling use case for it. Until then 
it's not worth the effort since I doubt VTK wrapping codes would handle 
it correctly.

> Also, please document that callbackData is to be deleted by the callback
> itself
OK. as fas as VTK is concerned callbackData is intended to be a key for 
use by the callback, and VTK does nothing with it beyond passing it to 
the callback. I'll add a note about this to clarify.

> (and I'd say that the fallback to using the array as the
> callbackData shouldn't happen so that the callback doesn't need to
> change whether NULL or something else is given as the context). Maybe
> just pass the array as the first parameter and callbackData as the
> second would work as well.

Works for me, although I'm not sure NULL callbackData is ever valid/usefull.

Thanks for the feedback!
Burlen

On 01/17/2014 02:01 PM, Ben Boeckel wrote:
> On Fri, Jan 17, 2014 at 12:37:56 -0800, Burlen Loring wrote:
>> I'm interested to here peoples thoughts on this change. if there are
>> no objections to the concept/approach, would anyone be willing to
>> review?
>> http://review.source.kitware.com/#/c/14072/2
> These overrides aren't going to be wrapped, so will only be accessible
> from C++ code. Is that the intention? If pure Python or Fortran is to
> use these, the wrapping code will need to be extended to handle these
> (for each language). To be fair, I only know the Python wrapping to any
> real degree though.
>
> It'd actually probably be easier to make a class than to teach the
> wrappers to pair up the callback/callbackData parameters…but then you'd
> need to teach at least Python about the ability to call virtual methods
> from C++ into Python.
>
> Also, please document that callbackData is to be deleted by the callback
> itself (and I'd say that the fallback to using the array as the
> callbackData shouldn't happen so that the callback doesn't need to
> change whether NULL or something else is given as the context). Maybe
> just pass the array as the first parameter and callbackData as the
> second would work as well.
>
> --Ben




More information about the vtk-developers mailing list