[geos-devel] WKTReader - ambiguous comments

Mateusz Łoskot mateusz at loskot.net
Thu Mar 30 01:21:06 EST 2006


Hi,

The WKTReader constructor:
WKTReader(const geom::GeometryFactory *gf);
takes geometry factory by const pointer and
as I see it creates internal copy of object pointed by gf pointer:

// WKTReader.inl file

WKTReader::WKTReader(const geom::GeometryFactory *gf)
: geometryFactory(gf)

Here, copy constructor of GeometryFactory is called.

I'd suggest to add appropriate explanation about what exactly WKTReader
constructor does - that it creates a copy of GeometryFactory instance.
Now, the comment is as follows and IMHO it's quite ambiguous, especially
this part "be sure you'll keep the factory alive":

* Note that all Geometry objects created by the
* parser will contain a pointer to the given factory
* so be sure you'll keep the factory alive for the
* whole WKTReader and created Geometry life.


Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the geos-devel mailing list