• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

boostorg / geometry / 24470

13 May 2025 08:17PM UTC coverage: 94.253% (-0.03%) from 94.286%
24470

push

circleci

barendgehrels
fix: consider clusters in turn_in_piece_visitor

39085 of 41468 relevant lines covered (94.25%)

1274129.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

13.33
include/boost/geometry/core/exception.hpp
1
// Boost.Geometry (aka GGL, Generic Geometry Library)
2

3
// Copyright (c) 2007-2025 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, 2017.
8
// Modifications copyright (c) 2015-2017 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
#include <string>
24

25
namespace boost { namespace geometry
26
{
27

28
/*!
29
\brief Base exception class for Boost.Geometry algorithms
30
\ingroup core
31
\details This class is never thrown. All exceptions thrown in Boost.Geometry
32
    are derived from exception, so it might be convenient to catch it.
33
*/
34
class exception : public std::exception
35
{
36
public:
37
    char const* what() const noexcept override
×
38
    {
39
        return "Boost.Geometry exception";
×
40
    }
41
};
42

43
/*!
44
\brief Invalid Input Exception
45
\ingroup core
46
\details The invalid_input_exception is thrown if an invalid attribute
47
         is passed into a function, e.g. a DE-9IM mask string code containing
48
         invalid characters passed into a de9im::mask constructor.
49
 */
50
class invalid_input_exception : public geometry::exception
51
{
52
public:
53

54
    inline invalid_input_exception() {}
529✔
55

56
    char const* what() const noexcept override
×
57
    {
58
        return "Boost.Geometry Invalid-Input exception";
×
59
    }
60
};
61

62
/*!
63
\brief Empty Input Exception
64
\ingroup core
65
\details The empty_input_exception is thrown if free functions, e.g. distance,
66
    are called with empty geometries, e.g. a linestring
67
    without points, a polygon without points, an empty multi-geometry.
68
\qbk{
69
[heading See also]
70
\* [link geometry.reference.algorithms.area the area function]
71
\* [link geometry.reference.algorithms.distance the distance function]
72
\* [link geometry.reference.algorithms.length the length function]
73
}
74
 */
75
class empty_input_exception : public geometry::invalid_input_exception
76
{
77
public:
78

79
    inline empty_input_exception() {}
525✔
80

81
    virtual char const* what() const noexcept
×
82
    {
83
        return "Boost.Geometry Empty-Input exception";
×
84
    }
85
};
86

87
/*!
88
\brief Invalid Output Exception
89
\ingroup core
90
\details The invalid_output_exception is thrown if valid output cannot be
91
         generated by a function even if arguments are valid, e.g. union of
92
         geographic polygons covering more than half of the area of the globe.
93
 */
94
class invalid_output_exception : public geometry::exception
95
{
96
public:
97

98
    inline invalid_output_exception() {}
×
99

100
    char const* what() const noexcept override
×
101
    {
102
        return "Boost.Geometry Invalid-Output exception";
×
103
    }
104
};
105

106
/*!
107
\brief Logic Exception
108
\ingroup core
109
\details Defines a type of object to be thrown as exception.
110
    It reports errors that are a consequence of faulty logic within the program
111
    such as violating logical preconditions or class invariants and may be preventable.
112
 */
113
class logic_exception : public geometry::exception
114
{
115
public:
116
    inline logic_exception(char const* description)
×
117
        : m_description(description) {}
×
118

119
    char const* what() const noexcept override
×
120
    {
121
        return m_description.c_str();
×
122
    }
123

124
private:
125
    std::string m_description;
126
};
127

128

129
}} // namespace boost::geometry
130

131
#endif // BOOST_GEOMETRY_CORE_EXCEPTION_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc