/src/geos/include/geos/util/TopologyException.h
Line | Count | Source |
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 | | #pragma once |
17 | | |
18 | | #include <geos/export.h> |
19 | | #include <geos/util/GEOSException.h> |
20 | | #include <geos/geom/Coordinate.h> // to be removed when .inl is available |
21 | | |
22 | | #include <cassert> |
23 | | |
24 | | namespace geos { |
25 | | namespace util { // geos.util |
26 | | |
27 | | /** |
28 | | * \class TopologyException util.h geos.h |
29 | | * |
30 | | * \brief |
31 | | * Indicates an invalid or inconsistent topological situation encountered |
32 | | * during processing |
33 | | */ |
34 | | class GEOS_DLL TopologyException: public GEOSException { |
35 | | public: |
36 | | TopologyException() |
37 | | : |
38 | 0 | GEOSException("TopologyException", "") |
39 | 0 | {} |
40 | | |
41 | | TopologyException(const std::string& msg) |
42 | | : |
43 | 83.8k | GEOSException("TopologyException", msg) |
44 | 83.8k | {} |
45 | | |
46 | | TopologyException(const std::string& msg, const geom::Coordinate& newPt) |
47 | | : |
48 | 29.6k | GEOSException("TopologyException", msg + " at " + newPt.toString()), |
49 | 29.6k | pt(newPt) |
50 | 29.6k | {} |
51 | | |
52 | 0 | ~TopologyException() noexcept override {} |
53 | | geom::Coordinate& |
54 | | getCoordinate() |
55 | 0 | { |
56 | 0 | return pt; |
57 | 0 | } |
58 | | private: |
59 | | geom::Coordinate pt; |
60 | | }; |
61 | | |
62 | | } // namespace geos::util |
63 | | } // namespace geos |
64 | | |