[vtk-developers] Hinting proposal

David Cole david.cole at kitware.com
Wed Apr 27 16:31:38 EDT 2011

I realize this goes directly against what you said in the other thread....

But I strongly prefer inline hints to use actual code attributes if
possible. For example, this particular hint would be an attribute on the
return type of the method. You could also envision parameter hinting (as in,
this parameter is a pointer, but it's really an array of N elements).

Parsing stuff out of comments seems like it would be more error prone
compared to having an actual C++ compiler-readable attribute attached to a
C++ entity.

This is just my opinion, though. Let's see who else chimes in.

(We do this in other mummy-wrapped projects with inline wrapping hints. Of
course, since VTK code has none of that markup, mummy also reads the VTK
hints file. It would be good to add such markup to VTK in any event,
regardless of what path we choose after this discussion.

See inline wrapping hints examples in this file:

In the example file, the "iwhCounted" hint is used to indicate a return type
is "already ref counted" when it returns... As you can see, they add
attributes when compiled with gcc-xml, but are no-op macros for other

David C.

On Wed, Apr 27, 2011 at 4:15 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> As a follow up to the recent discussion on wrapping factory methods,
> I'd like to put forth a proposal for adding wrapping hints to VTK:
> Hints could be placed inside the method descriptions, as html-style
> comments:
> // Description:
> // Return a new object instance.
> // <!--- hint newref='true' -->
> vtkObjectBase *NewInstance();
> Size hints could replace the hints file currently used by the wrappers.
> I'm also keen to provide size hints for operator[] methods, since
> these operators cannot be properly wrapped in python until there
> is a hint to tell python what method to call to get the index range.
>  - David
> _______________________________________________
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110427/deef05d0/attachment.html>

More information about the vtk-developers mailing list