[vtk-developers] New way of doing wrapper hints

David Lonie david.lonie at kitware.com
Mon Jun 6 12:03:08 EDT 2016


+1 to the idea and Brad's suggestion!

On Mon, Jun 6, 2016 at 11:12 AM, David Thompson <david.thompson at kitware.com>
wrote:

> 1. I assume that attributes are allowed prior to function parameters...
> from the spec it was not immediately obvious. For example, what about this
> method:
>
> VTK_SIZEHINT(sz) double* findOrAddEntries(
>     int key, int sz, VTK_SIZEHINT(sz) double* vals);
>
> that both accepts and returns a variable-length array (of length sz, one
> of the other parameters)?
>

Does this sort of pattern occur in VTK a lot? AIUI, the current hints file
only allows fixed-length arrays and is not dependent on other variables to
get the size.

For (fixed-size) array parameters, it seems the parser should be able to
pull the information out of the declaration if the 'type var[sz]' notation
is used instead just 'type *var':

void SetPoint(vtkIdType i, float point[3]);

would let the parser know that 'point' is an array of 3 floats. Not sure if
it does this already?

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160606/3d643906/attachment.html>


More information about the vtk-developers mailing list