[geos-devel] WKB parser port

strk at refractions.net strk at refractions.net
Wed Apr 20 06:14:32 EDT 2005


In the process of porting the WKB parser from JTS
to GEOS I encoutered one of the situation which in
the past have led to poor-performing code.

JTS WKBReader object uses an ByteOrderDataInStream
object to read a byte, an int, a long and a double.
The ByteOrderDataInStream object can be initialized
with an InStream object to set it's input source.
WKBReader object can also accept an InStream object
to initialize its internal ByteOrderDataInStream.

Now, for JTS InStream is an INTERFACE. 
This has been in the past ported to a virtual base
class.

My understanding of it is that it is intended to
be used to abstract reading from a memory buffer
and reading from a stream. Currently only reading
from a memory buffer is implemented using the
derived class ByteArrayInStream.

Is this a good candidate for templating ?
Shouldn't we use standard C++ templates for this ?
Would InStream really be an istream ?

Comments welcome.

--strk;



More information about the geos-devel mailing list