File indexing completed on 2025-11-04 09:46:42
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP
0016 #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP
0017 
0018 #include <vector>
0019 
0020 #include <boost/geometry/index/adaptors/query.hpp>
0021 
0022 namespace boost { namespace geometry { namespace index {
0023 
0024 
0025 template <typename Value, typename Options, typename IndexableGetter, typename EqualTo, typename Allocator>
0026 class rtree;
0027 
0028 namespace adaptors { namespace detail {
0029 
0030 template <typename Value, typename Options, typename IndexableGetter, typename EqualTo, typename Allocator>
0031 class query_range< index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator> >
0032 {
0033 public:
0034     typedef std::vector<Value> result_type;
0035     typedef typename result_type::iterator iterator;
0036     typedef typename result_type::const_iterator const_iterator;
0037 
0038     template <typename Predicates> inline
0039     query_range(index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator> const& rtree,
0040                 Predicates const& pred)
0041     {
0042         rtree.query(pred, std::back_inserter(m_result));
0043     }
0044 
0045     inline iterator begin() { return m_result.begin(); }
0046     inline iterator end() { return m_result.end(); }
0047     inline const_iterator begin() const { return m_result.begin(); }
0048     inline const_iterator end() const { return m_result.end(); }
0049 
0050 private:
0051     result_type m_result;
0052 };
0053 
0054 }} 
0055 
0056 }}} 
0057 
0058 #endif