annotate DEPENDENCIES/generic/include/boost/geometry/geometries/concepts/check.hpp @ 46:d572322e2efe

Fix to .cat file check (was susceptible to DOS line-endings) and subrepo update
author Chris Cannam
date Thu, 07 Aug 2014 14:39:38 +0100
parents 2665513ce2d3
children c530137014c0
rev   line source
Chris@16 1 // Boost.Geometry (aka GGL, Generic Geometry Library)
Chris@16 2
Chris@16 3 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
Chris@16 4 // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
Chris@16 5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
Chris@16 6
Chris@16 7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
Chris@16 8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
Chris@16 9
Chris@16 10 // Use, modification and distribution is subject to the Boost Software License,
Chris@16 11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 12 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 13
Chris@16 14
Chris@16 15 #ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CHECK_HPP
Chris@16 16 #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CHECK_HPP
Chris@16 17
Chris@16 18
Chris@16 19 #include <boost/concept_check.hpp>
Chris@16 20 #include <boost/concept/requires.hpp>
Chris@16 21
Chris@16 22 #include <boost/type_traits/is_const.hpp>
Chris@16 23
Chris@16 24 #include <boost/geometry/core/tag.hpp>
Chris@16 25
Chris@16 26 #include <boost/geometry/geometries/concepts/box_concept.hpp>
Chris@16 27 #include <boost/geometry/geometries/concepts/linestring_concept.hpp>
Chris@16 28 #include <boost/geometry/geometries/concepts/point_concept.hpp>
Chris@16 29 #include <boost/geometry/geometries/concepts/polygon_concept.hpp>
Chris@16 30 #include <boost/geometry/geometries/concepts/ring_concept.hpp>
Chris@16 31 #include <boost/geometry/geometries/concepts/segment_concept.hpp>
Chris@16 32
Chris@16 33 #include <boost/geometry/algorithms/not_implemented.hpp>
Chris@16 34
Chris@16 35 #include <boost/variant/variant_fwd.hpp>
Chris@16 36
Chris@16 37 namespace boost { namespace geometry
Chris@16 38 {
Chris@16 39
Chris@16 40
Chris@16 41 #ifndef DOXYGEN_NO_DETAIL
Chris@16 42 namespace detail { namespace concept_check
Chris@16 43 {
Chris@16 44
Chris@16 45 template <typename Concept>
Chris@16 46 class check
Chris@16 47 {
Chris@16 48 BOOST_CONCEPT_ASSERT((Concept ));
Chris@16 49 };
Chris@16 50
Chris@16 51 }} // namespace detail::concept_check
Chris@16 52 #endif // DOXYGEN_NO_DETAIL
Chris@16 53
Chris@16 54
Chris@16 55
Chris@16 56 #ifndef DOXYGEN_NO_DISPATCH
Chris@16 57 namespace dispatch
Chris@16 58 {
Chris@16 59
Chris@16 60 template
Chris@16 61 <
Chris@16 62 typename Geometry,
Chris@16 63 typename GeometryTag = typename geometry::tag<Geometry>::type,
Chris@16 64 bool IsConst = boost::is_const<Geometry>::type::value
Chris@16 65 >
Chris@16 66 struct check : not_implemented<GeometryTag>
Chris@16 67 {};
Chris@16 68
Chris@16 69
Chris@16 70 template <typename Geometry>
Chris@16 71 struct check<Geometry, point_tag, true>
Chris@16 72 : detail::concept_check::check<concept::ConstPoint<Geometry> >
Chris@16 73 {};
Chris@16 74
Chris@16 75
Chris@16 76 template <typename Geometry>
Chris@16 77 struct check<Geometry, point_tag, false>
Chris@16 78 : detail::concept_check::check<concept::Point<Geometry> >
Chris@16 79 {};
Chris@16 80
Chris@16 81
Chris@16 82 template <typename Geometry>
Chris@16 83 struct check<Geometry, linestring_tag, true>
Chris@16 84 : detail::concept_check::check<concept::ConstLinestring<Geometry> >
Chris@16 85 {};
Chris@16 86
Chris@16 87
Chris@16 88 template <typename Geometry>
Chris@16 89 struct check<Geometry, linestring_tag, false>
Chris@16 90 : detail::concept_check::check<concept::Linestring<Geometry> >
Chris@16 91 {};
Chris@16 92
Chris@16 93
Chris@16 94 template <typename Geometry>
Chris@16 95 struct check<Geometry, ring_tag, true>
Chris@16 96 : detail::concept_check::check<concept::ConstRing<Geometry> >
Chris@16 97 {};
Chris@16 98
Chris@16 99
Chris@16 100 template <typename Geometry>
Chris@16 101 struct check<Geometry, ring_tag, false>
Chris@16 102 : detail::concept_check::check<concept::Ring<Geometry> >
Chris@16 103 {};
Chris@16 104
Chris@16 105 template <typename Geometry>
Chris@16 106 struct check<Geometry, polygon_tag, true>
Chris@16 107 : detail::concept_check::check<concept::ConstPolygon<Geometry> >
Chris@16 108 {};
Chris@16 109
Chris@16 110
Chris@16 111 template <typename Geometry>
Chris@16 112 struct check<Geometry, polygon_tag, false>
Chris@16 113 : detail::concept_check::check<concept::Polygon<Geometry> >
Chris@16 114 {};
Chris@16 115
Chris@16 116
Chris@16 117 template <typename Geometry>
Chris@16 118 struct check<Geometry, box_tag, true>
Chris@16 119 : detail::concept_check::check<concept::ConstBox<Geometry> >
Chris@16 120 {};
Chris@16 121
Chris@16 122
Chris@16 123 template <typename Geometry>
Chris@16 124 struct check<Geometry, box_tag, false>
Chris@16 125 : detail::concept_check::check<concept::Box<Geometry> >
Chris@16 126 {};
Chris@16 127
Chris@16 128
Chris@16 129 template <typename Geometry>
Chris@16 130 struct check<Geometry, segment_tag, true>
Chris@16 131 : detail::concept_check::check<concept::ConstSegment<Geometry> >
Chris@16 132 {};
Chris@16 133
Chris@16 134
Chris@16 135 template <typename Geometry>
Chris@16 136 struct check<Geometry, segment_tag, false>
Chris@16 137 : detail::concept_check::check<concept::Segment<Geometry> >
Chris@16 138 {};
Chris@16 139
Chris@16 140
Chris@16 141 } // namespace dispatch
Chris@16 142 #endif
Chris@16 143
Chris@16 144
Chris@16 145
Chris@16 146
Chris@16 147 namespace concept
Chris@16 148 {
Chris@16 149
Chris@16 150
Chris@16 151 #ifndef DOXYGEN_NO_DETAIL
Chris@16 152 namespace detail
Chris@16 153 {
Chris@16 154
Chris@16 155
Chris@16 156 template <typename Geometry>
Chris@16 157 struct checker : dispatch::check<Geometry>
Chris@16 158 {};
Chris@16 159
Chris@16 160 template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
Chris@16 161 struct checker<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
Chris@16 162 {};
Chris@16 163
Chris@16 164 template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
Chris@16 165 struct checker<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const>
Chris@16 166 {};
Chris@16 167
Chris@16 168
Chris@16 169 }
Chris@16 170 #endif // DOXYGEN_NO_DETAIL
Chris@16 171
Chris@16 172
Chris@16 173 /*!
Chris@16 174 \brief Checks, in compile-time, the concept of any geometry
Chris@16 175 \ingroup concepts
Chris@16 176 */
Chris@16 177 template <typename Geometry>
Chris@16 178 inline void check()
Chris@16 179 {
Chris@16 180 detail::checker<Geometry> c;
Chris@16 181 boost::ignore_unused_variable_warning(c);
Chris@16 182 }
Chris@16 183
Chris@16 184
Chris@16 185 /*!
Chris@16 186 \brief Checks, in compile-time, the concept of two geometries, and if they
Chris@16 187 have equal dimensions
Chris@16 188 \ingroup concepts
Chris@16 189 */
Chris@16 190 template <typename Geometry1, typename Geometry2>
Chris@16 191 inline void check_concepts_and_equal_dimensions()
Chris@16 192 {
Chris@16 193 check<Geometry1>();
Chris@16 194 check<Geometry2>();
Chris@16 195 assert_dimension_equal<Geometry1, Geometry2>();
Chris@16 196 }
Chris@16 197
Chris@16 198
Chris@16 199 } // namespace concept
Chris@16 200
Chris@16 201
Chris@16 202 }} // namespace boost::geometry
Chris@16 203
Chris@16 204
Chris@16 205 #endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CHECK_HPP