[geos-devel] Swig Update and questions

strk at refractions.net strk at refractions.net
Sat Jun 24 20:17:19 EDT 2006


On Sat, Jun 24, 2006 at 06:02:02PM -0600, Charlie Savage wrote:
> >We surely want them distributed. We also want to distribute the generated
> >wrapper (for those not having unstable swig installed).
> >Would be nice if make maintainer-clean would get rid of the latter
> >and next make would recreate it.
> >(haven't tested your new makefiles yet)
> 
> Okay, so I need to add in a hook for make maintainer-clean then and to 
> have make check to see if the generated wrapper exists or not and create 
> if needed (I think the makefiles already do that actually).
> 
> Anything I need to do for getting the files into the distribution?

Any file you list in an Automake variable should be
distributed by default. Others can be forced in distribution
adding to the EXTRA_DIST variable.
Run 'make dist', extract resuting package and see yourself.
Also, try building the produced package.

> >A rule of thumb for the C API is:
> >Every Geometry caller should take care of is returned
> >as a non-const object.
> >For these specific case the caller must delete them.
> 
> Okay, so the caller needs to delete the results of methods like 
> Intersection.  Assumedly the same goes for using the C++ api - i.e, 
> geom->intersects(someOtherGeom)?

Yes. The C++ API is likely to change in the future to return
by std::auto_ptr in these cases.

> While on the subject, I've taken a look at what would be involved with 
> having the SWIG wrappers use the C api.  Its doable - basically I would 
> have SWIG create "fake classes" which look like classes to Ruby/Python 
> but underneath use the C API.  This is how the GDAL swig bindings are 
> implemented, so its ok.  It is a bit silly (duplicate definitions), but 
> it works.

It's not silly if it makes the SWIG bindings easier to maintain.

--strk;




More information about the geos-devel mailing list