1 | // Boost.Geometry (aka GGL, Generic Geometry Library) |
2 | |
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. |
6 | |
7 | // This file was modified by Oracle on 2015. |
8 | // Modifications copyright (c) 2015 Oracle and/or its affiliates. |
9 | |
10 | // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle |
11 | |
12 | // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library |
13 | // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. |
14 | |
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) |
18 | |
19 | #ifndef BOOST_GEOMETRY_CORE_EXCEPTION_HPP |
20 | #define BOOST_GEOMETRY_CORE_EXCEPTION_HPP |
21 | |
22 | #include <exception> |
23 | |
24 | namespace boost { namespace geometry |
25 | { |
26 | |
27 | /*! |
28 | \brief Base exception class for Boost.Geometry algorithms |
29 | \ingroup core |
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. |
32 | */ |
33 | class exception : public std::exception |
34 | { |
35 | public: |
36 | virtual char const* what() const throw() |
37 | { |
38 | return "Boost.Geometry exception" ; |
39 | } |
40 | }; |
41 | |
42 | /*! |
43 | \brief Invalid Input Exception |
44 | \ingroup core |
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. |
48 | */ |
49 | class invalid_input_exception : public geometry::exception |
50 | { |
51 | public: |
52 | |
53 | inline invalid_input_exception() {} |
54 | |
55 | virtual char const* what() const throw() |
56 | { |
57 | return "Boost.Geometry Invalid-Input exception" ; |
58 | } |
59 | }; |
60 | |
61 | /*! |
62 | \brief Empty Input Exception |
63 | \ingroup core |
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. |
67 | \qbk{ |
68 | [heading See also] |
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] |
72 | } |
73 | */ |
74 | class empty_input_exception : public geometry::invalid_input_exception |
75 | { |
76 | public: |
77 | |
78 | inline empty_input_exception() {} |
79 | |
80 | virtual char const* what() const throw() |
81 | { |
82 | return "Boost.Geometry Empty-Input exception" ; |
83 | } |
84 | }; |
85 | |
86 | |
87 | }} // namespace boost::geometry |
88 | |
89 | #endif // BOOST_GEOMETRY_CORE_EXCEPTION_HPP |
90 | |