[geos-devel] ABI protection

Frank Warmerdam fwarmerdam at gmail.com
Sat Jun 25 15:54:01 EDT 2005


On 6/25/05, strk at refractions.net <strk at refractions.net> wrote:
> On Sat, Jun 25, 2005 at 10:21:22AM -0500, Curtis Barrett wrote:
> > Adding non-virtual methods will not break compatibility. If the method is virtual, I don't think you can add it without breaking compatibility.
> >
> > One option would be to (for now) make the new method a function external to the Node class and grant it friend status with Node. This way, it can work on the interals of Node without changing Node's face to the world. Depending on what the method does, this may not be practical.
> 
> I think non-virtual option is ok for the 2.1 branch.
> Other thougths ?

Strk,

I don't believe that OGR interacts directly with the Node class.
The OGR bindings are still quite simple - the common operates on 
geos::Geometry.  

If there are not classes derived from Node for which you need
to retain binary compatibility then adding the method at the end
of the class (and hence the end of the vtable) should avoid any
ABI effects.  Otherwise having it non-virtual will avoid ABI changes,
as suggested. 

I think making it not virtual would be preferrable as a "bridge" step 
as opposed to using a friend function. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the geos-devel mailing list