[cable] CableSwig: Python wrappers don't wrap public member data

Brad King brad.king at kitware.com
Wed Sep 10 18:43:49 EDT 2003


Hi Steven,

> CableSwig doesn't wrap public data members? To be succinct, that stinks.

The project is open source.  You are free to implement the feature and
contribute it.

> I have a specific need to wrap many C structures in Python, and
> hand-coding the SWIG interfaces is an onerous task.

If they are C structures, then plain-old SWIG will have no problem
wrapping them, and CableSwig will definately not be able to do it more
efficiently.

> I don't mean to sound ungrateful for the time and energy you and the ITK
> developers expend in making these tools publicly available, but this
> (mis)feature, and any other variations from standard SWIG behavior are
> things that that the ITK developers should have documented and made
> clear. I might have saved all the time I spent just trying to get
> CableSwig to build if I had known this in advance.
>
> I think that the question of whether to wrap public data members ought
> to be a matter of the policy of a particular project. CableSwig should
> remain neutral on the matter, and offer the feature as an option.

I agree, but there was simply no time or money on the ITK contract to
implement features we didn't need.  If you would like to contract us to do
the work, we'll be happy to add the feature.

> Is there any quick way to hack CableSwig to re-enable wrapping public
> data members?

I don't think so, but you can look in CableSwig/Executables/CableSwig.cxx
to find the code that translates Cable's representation to SWIG's.  If you
can find a hack, go ahead and use it.  Be warned that there is no
documentation for this, though, for the same reason the feature isn't
there in the first place.

-Brad






More information about the cable mailing list