[geos-devel] SegmentString modeling

strk at refractions.net strk at refractions.net
Thu Feb 16 12:06:31 EST 2006


Need some help from C++ gurus.
One of the new JTS classes expects to modify
the Coordinates associated with a SegmentString.

So far the SegmentString kept a const-pointe
to an externally provided CoordinateSequence.
This means you can't modify a CoordinateSequence
getting it's pointer from the SegmentString,
even if the SegmentString itself is non-const
(it's not the owner of the CoordinateSequence).

Changing the interface to allow SegmentString
to keep non-const pointers to CoordinateSequence
instead, will break all promises of constness
on which existing code relies.

What I'd like to model is a SegmentString
that will either store a const or a non-const
pointer to CoordinateSequence depending on
construction. Is it possible at all w/out 
making it a templated class ?

--strk;




More information about the geos-devel mailing list