Skip to content

Add attribute parsing for wrapper hints

David Gobbi requested to merge dgobbi/vtk:wrapper-attribute-hints into master

C++ attributes provide a powerful mechanism for adding wrapper hints to the VTK header files. This change adds a new attribute [[vtk::newinstance]] that can be used to mark methods that return new object instances and expect the caller to take ownership:

[[vtk::newinstance]] vtkObjectBase* NewInstance();

This is done with a macro VTK_NEWINSTANCE for compatibility. Other attributes such as [[vtk::sizehint(3)]] can eventually be added to handle other wrapper hints.

Merge request reports