1 // Boost.Geometry Index
3 // R-tree queries range adaptors
5 // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP
12 #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP
15 #include <boost/static_assert.hpp>
17 #include <boost/geometry/index/adaptors/query.hpp>
19 namespace boost { namespace geometry { namespace index {
21 template <typename Value, typename Options, typename IndexableGetter, typename EqualTo, typename Allocator>
24 namespace adaptors { namespace detail {
26 template <typename Value, typename Options, typename IndexableGetter, typename EqualTo, typename Allocator>
27 class query_range< index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator> >
30 typedef std::vector<Value> result_type;
31 typedef typename result_type::iterator iterator;
32 typedef typename result_type::const_iterator const_iterator;
34 template <typename Predicates> inline
35 query_range(index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator> const& rtree,
36 Predicates const& pred)
38 rtree.query(pred, std::back_inserter(m_result));
41 inline iterator begin() { return m_result.begin(); }
42 inline iterator end() { return m_result.end(); }
43 inline const_iterator begin() const { return m_result.begin(); }
44 inline const_iterator end() const { return m_result.end(); }
50 }} // namespace adaptors::detail
52 }}} // namespace boost::geometry::index
54 #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP