[geos-devel] Re:Explicit exceptions in GEOS

Yury A. Bychkov ybychkov at direct.ca
Fri Nov 15 01:12:49 EST 2002


I agree with that completely, but haven't got to that stage in porting yet. Some
exceptions (e.g. ParseException) are already there; your hierarchy and base
class look good for others.

Yury

----- Original Message -----
From: "Martin Davis" <mbdavis at VividSolutions.com>
To: "Geos-Devel (E-mail)" <geos-devel at geos.refractions.net>
Sent: Thursday, November 14, 2002 4:40 PM
Subject: [geos-devel] Explicit exceptions in GEOS


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







More information about the geos-devel mailing list