GEOS  3.8.0dev
TopologyException.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2001-2002 Vivid Solutions Inc.
7  * Copyright (C) 2006 Refractions Research Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************/
15 
16 #ifndef GEOS_UTIL_TOPOLOGYEXCEPTION_H
17 #define GEOS_UTIL_TOPOLOGYEXCEPTION_H
18 
19 #include <geos/export.h>
20 #include <geos/util/GEOSException.h>
21 #include <geos/geom/Coordinate.h> // to be removed when .inl is available
22 
23 #include <cassert>
24 
25 namespace geos {
26 namespace util { // geos.util
27 
35 class GEOS_DLL TopologyException: public GEOSException {
36 public:
38  :
39  GEOSException("TopologyException", "")
40  {}
41 
42  TopologyException(const std::string& msg)
43  :
44  GEOSException("TopologyException", msg)
45  {}
46 
47  TopologyException(const std::string& msg, const geom::Coordinate& newPt)
48  :
49  GEOSException("TopologyException", msg + " at " + newPt.toString()),
50  pt(newPt)
51  {}
52 
53  ~TopologyException() throw() override {}
55  getCoordinate()
56  {
57  return pt;
58  }
59 private:
61 };
62 
63 } // namespace geos::util
64 } // namespace geos
65 
66 
67 #endif // GEOS_UTIL_TOPOLOGYEXCEPTION_H
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
std::string toString() const
Returns a string of the form (x,y,z) .
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
Base class for all GEOS exceptions.
Definition: GEOSException.h:38
Indicates an invalid or inconsistent topological situation encountered during processing.
Definition: TopologyException.h:35