1 // Boost.Geometry 2 3 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. 4 5 // Use, modification and distribution is subject to the Boost Software License, 6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt) 8 9 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERIOR_ITERATOR_HPP 10 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERIOR_ITERATOR_HPP 11 12 #include <boost/range/iterator.hpp> 13 #include <boost/range/value_type.hpp> 14 15 #include <boost/geometry/core/interior_type.hpp> 16 17 namespace boost { namespace geometry 18 { 19 20 #ifndef DOXYGEN_NO_DETAIL 21 namespace detail 22 { 23 24 /*! 25 \brief Structure defining the type of interior rings iterator 26 \note If the Geometry is const, const iterator is defined. 27 \tparam Geometry \tparam_geometry 28 */ 29 template <typename Geometry> 30 struct interior_iterator 31 { 32 typedef typename boost::range_iterator 33 < 34 typename geometry::interior_type<Geometry>::type 35 >::type type; 36 }; 37 38 template <typename BaseT, typename T> 39 struct copy_const 40 { 41 typedef T type; 42 }; 43 44 template <typename BaseT, typename T> 45 struct copy_const<BaseT const, T> 46 { 47 typedef T const type; 48 }; 49 50 template <typename Geometry> 51 struct interior_ring_iterator 52 { 53 typedef typename boost::range_iterator 54 < 55 typename copy_const 56 < 57 typename geometry::interior_type<Geometry>::type, 58 typename boost::range_value 59 < 60 typename geometry::interior_type<Geometry>::type 61 >::type 62 >::type 63 >::type type; 64 }; 65 66 } // namespace detail 67 #endif // DOXYGEN_NO_DETAIL 68 69 }} // namespace boost::geometry 70 71 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERIOR_ITERATOR_HPP 72