[geos-devel] GEOS Swig Patch - New support for Ruby

strk at refractions.net strk at refractions.net
Thu Dec 22 13:19:24 EST 2005


On Thu, Dec 22, 2005 at 10:51:26AM -0700, Charlie Savage wrote:
> 
> >Committed, except from geos_wrap.cxx, which I'd like to be
> >produced at release time but not included in CVS.
> >We can discuss this...
> >
> >  
> Thanks - that's great.  Building the geos_wrap.cxx files at release time 
> would work well.  How should we do this?  Is there a "official" build 
> machine?  I can provide them also, but maybe something a bit more formal 
> would be better?

Builds take place on refractions host, let Paul know what are the
requirements for the wrappers to build. And I think we should have
./configure autodetect whether build is possible and act consequently.

..
> SWIG reads in the header files and generates wrapper code, so the whole 
> C++ api should be exposed.  Using the C API requires manually creating 
> "fake" SWIG classes that look like real classes to Python/Ruby/etc. but 
> in fact are just C code that uses the underlying C api.  Its a fair bit 
> of work because you have to create these "fake" classes using various 
> SWIG directives, and then update them any time the C API changes.  Of 
> course if the C API doesn't change much, that's probably not a big deal.
> 
> So to summarize - the disadvantage is manually creating the "fake" 
> classes, maintaining the fake classses, and not having access to 
> anything in the C++ api that is not exposed in the C API.  The advantage 
> is that the wrappers would work against any GEOS version with a binary 
> compatible C api.

Would a C++ header work ? Norman suggested this, and qgis developers
are arguing against using C style interfaces...
We might provide a geos_c++.h header file with all inline class
definitions. This could be used by both swig and any other C++ clients.

What people think about this ?

--strk;



More information about the geos-devel mailing list