]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Boost.Geometry Index |
2 | // | |
3 | // R-tree queries range adaptors | |
4 | // | |
5 | // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. | |
6 | // | |
1e59de90 TL |
7 | // This file was modified by Oracle on 2021. |
8 | // Modifications copyright (c) 2021 Oracle and/or its affiliates. | |
9 | // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle | |
10 | // | |
7c673cae FG |
11 | // Use, modification and distribution is subject to the Boost Software License, |
12 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
13 | // http://www.boost.org/LICENSE_1_0.txt) | |
14 | ||
15 | #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP | |
16 | #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP | |
17 | ||
1e59de90 | 18 | #include <vector> |
7c673cae FG |
19 | |
20 | #include <boost/geometry/index/adaptors/query.hpp> | |
21 | ||
22 | namespace boost { namespace geometry { namespace index { | |
23 | ||
1e59de90 | 24 | // Forward declaration |
7c673cae FG |
25 | template <typename Value, typename Options, typename IndexableGetter, typename EqualTo, typename Allocator> |
26 | class rtree; | |
27 | ||
28 | namespace adaptors { namespace detail { | |
29 | ||
30 | template <typename Value, typename Options, typename IndexableGetter, typename EqualTo, typename Allocator> | |
31 | class query_range< index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator> > | |
32 | { | |
33 | public: | |
34 | typedef std::vector<Value> result_type; | |
35 | typedef typename result_type::iterator iterator; | |
36 | typedef typename result_type::const_iterator const_iterator; | |
37 | ||
38 | template <typename Predicates> inline | |
39 | query_range(index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator> const& rtree, | |
40 | Predicates const& pred) | |
41 | { | |
42 | rtree.query(pred, std::back_inserter(m_result)); | |
43 | } | |
44 | ||
45 | inline iterator begin() { return m_result.begin(); } | |
46 | inline iterator end() { return m_result.end(); } | |
47 | inline const_iterator begin() const { return m_result.begin(); } | |
48 | inline const_iterator end() const { return m_result.end(); } | |
49 | ||
50 | private: | |
51 | result_type m_result; | |
52 | }; | |
53 | ||
54 | }} // namespace adaptors::detail | |
55 | ||
56 | }}} // namespace boost::geometry::index | |
57 | ||
58 | #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP |