C++ Binding Generator

Abdulhaq alynch4047 at gmail.com
Mon Feb 17 00:49:07 PST 2014


> I have a SWIG version of D-VTK but it is a little flaky and 
> soooo slow to generate. I've just started work developing D 
> wrapper for VTK based on their Java wrapper but it's very early 
> stages (started yesterday in fact).
>
> If you've got a VTK wrapping that generates D code I'd love to 
> check it out.
>

The smidgen binding generator is (I believe) sufficiently feature 
rich to wrap all of VTK, but I've only wrapped a half dozen 
classes as proof of concept for now (I've been focussing on Qt5). 
My plan on the VTK side has been to use the automated binding 
generator in VTK to produce the *.sip (similar to *.h) files that 
smidgen needs.

VTK is quite a large library so I would expect the wrapper to be 
a bit slow to generate, however it shouldn't be flaky when 
running. I would suspect that you've got a glitch in object 
ownership somewhere? My plan has been that the automatic VTK 
binding generator for e.g. python knows about object ownership, 
and so I can tap in to that to generate the correct smidgen 
annotations that are needed for that aspect of the binding. I've 
also found that you can get problems when wrapped methods return 
instances typed as base classes that need casting to more 
specific types.

I'm wondering if we can pool our efforts somehow? Because I need 
to finish the last parts of smidgen (e.g. enums with specific 
values and subtleties with C++ multiple inheritance)and the Qt5 
wrapping side of it I couldn't divert much from my current 
trajectory, but if you get a chance then have a look at what 
smidgen is doing and see if you think you'd get any benefit using 
it (and you'd have my efforts working to extend smidgen for you 
if needed). As soon as I've uploaded the current smidgen-vtk I'll 
notify here.

Another way we might be able to cooperate is getting a full 
understanding of the current built-in VTK binding generator 
technology.

Is your SWIG wrapping online somewhere? - I'd like to take a look.






More information about the Digitalmars-d mailing list