I realize this goes directly against what you said in the other thread....<br><br>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).<br>
<br>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.<br><br>This is just my opinion, though. Let's see who else chimes in.<br>
<br><br>(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.<br>
<br>See inline wrapping hints examples in this file: <a href="http://public.kitware.com/gitweb?p=mummy.git;a=blob;f=Examples/Vehicles/base/InlineWrapperHints.h;h=23c93103e9da0018b483bd98fc0700471d960dd3;hb=6c99e0759992793678f079c3498a4bd856d8d3dd">http://public.kitware.com/gitweb?p=mummy.git;a=blob;f=Examples/Vehicles/base/InlineWrapperHints.h;h=23c93103e9da0018b483bd98fc0700471d960dd3;hb=6c99e0759992793678f079c3498a4bd856d8d3dd</a> <br>
<br>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 compilers.)<br>
<br><br>David C.<br><br><br><div class="gmail_quote">On Wed, Apr 27, 2011 at 4:15 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
As a follow up to the recent discussion on wrapping factory methods,<br>
I'd like to put forth a proposal for adding wrapping hints to VTK:<br>
Hints could be placed inside the method descriptions, as html-style<br>
comments:<br>
<br>
// Description:<br>
// Return a new object instance.<br>
// <!--- hint newref='true' --><br>
vtkObjectBase *NewInstance();<br>
<br>
Size hints could replace the hints file currently used by the wrappers.<br>
I'm also keen to provide size hints for operator[] methods, since<br>
these operators cannot be properly wrapped in python until there<br>
is a hint to tell python what method to call to get the index range.<br>
<br>
 - David<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div><br>