Chris@16: // Boost.Geometry Index Chris@16: // Chris@16: // R-tree queries range adaptors Chris@16: // Chris@16: // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. Chris@16: // Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP Chris@16: #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { namespace geometry { namespace index { Chris@16: Chris@16: template Chris@16: class rtree; Chris@16: Chris@16: namespace adaptors { namespace detail { Chris@16: Chris@16: template Chris@16: class query_range< index::rtree > Chris@16: { Chris@16: public: Chris@16: typedef std::vector result_type; Chris@16: typedef typename result_type::iterator iterator; Chris@16: typedef typename result_type::const_iterator const_iterator; Chris@16: Chris@16: template inline Chris@16: query_range(index::rtree const& rtree, Chris@16: Predicates const& pred) Chris@16: { Chris@16: rtree.query(pred, std::back_inserter(m_result)); Chris@16: } Chris@16: Chris@16: inline iterator begin() { return m_result.begin(); } Chris@16: inline iterator end() { return m_result.end(); } Chris@16: inline const_iterator begin() const { return m_result.begin(); } Chris@16: inline const_iterator end() const { return m_result.end(); } Chris@16: Chris@16: private: Chris@16: result_type m_result; Chris@16: }; Chris@16: Chris@16: }} // namespace adaptors::detail Chris@16: Chris@16: }}} // namespace boost::geometry::index Chris@16: Chris@16: #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP