Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:31

0001 // Boost.Geometry Index
0002 //
0003 // R-tree queries range adaptors
0004 //
0005 // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
0006 //
0007 // This file was modified by Oracle on 2021.
0008 // Modifications copyright (c) 2021 Oracle and/or its affiliates.
0009 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0010 //
0011 // Use, modification and distribution is subject to the Boost Software License,
0012 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0013 // http://www.boost.org/LICENSE_1_0.txt)
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 // Forward declaration
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 }} // namespace adaptors::detail
0055 
0056 }}} // namespace boost::geometry::index
0057 
0058 #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ADAPTORS_HPP