%feature and sub-classes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

%feature and sub-classes

Charlie Savage
Is there a way to apply a %feature to a class and all its sub-classes?

I am using SWIG to wrap the geos (geos.refractions.net) library, which
makes use of vectors like this:

std::vector<geos::Geometry*>

There are number of subclasses of Geometry, including Point, Polygon, etc.

Anyway, for this to work in Ruby, I have to track the object that can be
put into the vector so that I can implement a mark function (for more
details, see the Ruby chapter in the SWIG manual).  I can of course do this:

%trackobjects Geometry;
%trackobjects Point;
etc...

But it would be more clever if I could just say track all Geometry
objects or their descendants.

Thanks,

Charlie

smime.p7s (3K) Download Attachment