1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
7 // This file was modified by Oracle on 2015, 2017.
8 // Modifications copyright (c) 2015-2017 Oracle and/or its affiliates.
10 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
12 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
13 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
15 // Use, modification and distribution is subject to the Boost Software License,
16 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
19 #ifndef BOOST_GEOMETRY_CORE_EXCEPTION_HPP
20 #define BOOST_GEOMETRY_CORE_EXCEPTION_HPP
24 namespace boost { namespace geometry
28 \brief Base exception class for Boost.Geometry algorithms
30 \details This class is never thrown. All exceptions thrown in Boost.Geometry
31 are derived from exception, so it might be convenient to catch it.
33 class exception : public std::exception
36 virtual char const* what() const throw()
38 return "Boost.Geometry exception";
43 \brief Invalid Input Exception
45 \details The invalid_input_exception is thrown if an invalid attribute
46 is passed into a function, e.g. a DE-9IM mask string code containing
47 invalid characters passed into a de9im::mask constructor.
49 class invalid_input_exception : public geometry::exception
53 inline invalid_input_exception() {}
55 virtual char const* what() const throw()
57 return "Boost.Geometry Invalid-Input exception";
62 \brief Empty Input Exception
64 \details The empty_input_exception is thrown if free functions, e.g. distance,
65 are called with empty geometries, e.g. a linestring
66 without points, a polygon without points, an empty multi-geometry.
69 \* [link geometry.reference.algorithms.area the area function]
70 \* [link geometry.reference.algorithms.distance the distance function]
71 \* [link geometry.reference.algorithms.length the length function]
74 class empty_input_exception : public geometry::invalid_input_exception
78 inline empty_input_exception() {}
80 virtual char const* what() const throw()
82 return "Boost.Geometry Empty-Input exception";
87 \brief Invalid Output Exception
89 \details The invalid_output_exception is thrown if valid output cannot be
90 generated by a function even if arguments are valid, e.g. union of
91 geographic polygons covering more than half of the area of the globe.
93 class invalid_output_exception : public geometry::exception
97 inline invalid_output_exception() {}
99 virtual char const* what() const throw()
101 return "Boost.Geometry Invalid-Output exception";
106 }} // namespace boost::geometry
108 #endif // BOOST_GEOMETRY_CORE_EXCEPTION_HPP