[geos-devel] Explicit exceptions in GEOS

Martin Davis mbdavis at VividSolutions.com
Thu Nov 14 19:40:07 EST 2002


Currently in the code there are all kinds of exceptions thrown which are simply strings.  We should replace these with an explicit exception class hierarchy.  As far as I know C++ doesn't provide any exception hierarchy by default, so we'll have to pretty much build our own.

I suggest at least the following:

GEOSException 
	ArrayIndexOutOfBoundsException
	TopologyException

We can add others as needed.

The signature should look like:  

GEOSException(char *msg);  // copies string
char *getMsg()

... maybe other stuff.  I have an existing Exception base class I can contribute - it's attached.
 <<exception.h>> 


Martin Davis, Senior Technical Specialist
Vivid Solutions Inc.
Suite #1A-2328 Government Street   Victoria, B.C.   V8T 5G5
Phone: (250) 385 6040    Fax: (250) 385 6046
EMail: mbdavis at vividsolutions.com  Web: www.vividsolutions.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: exception.h
Type: application/octet-stream
Size: 2193 bytes
Desc: exception.h
Url : http://lists.osgeo.org/pipermail/geos-devel/attachments/20021114/915fd244/exception.obj


More information about the geos-devel mailing list