[vtk-developers] New way of doing wrapper hints
david.thompson at kitware.com
Mon Jun 6 12:31:31 EDT 2016
>> ... 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?
Some but not a lot. It might happen more if it was easier to wrap.
One place it does occur is InsertNextCell(int npts, vtkIdType* conn). It would provide a hint to the wrapper that would (1) let us avoid constructing a vtkIdList to call a different variant and (2) let us check that the length of the array passed to the Python (or other) interpreter matches the length value passed as the first parameter.
More information about the vtk-developers