X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Fboost%2Fgeometry%2Findex%2Fdetail%2Frtree%2Fvisitors%2Fspatial_query.hpp;h=c94248cfd08aabe15bcf191a215c77903336c0d9;hb=92f5a8d42d07f9929ae4fa7e01342fe8d96808a8;hp=b9cd0ae2c0567a70077b6d03cf55dcd87e14ced6;hpb=a0324939f9d0e1905d5df8f57442f09dc70af83d;p=ceph.git diff --git a/ceph/src/boost/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp b/ceph/src/boost/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp index b9cd0ae2c..c94248cfd 100644 --- a/ceph/src/boost/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp +++ b/ceph/src/boost/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp @@ -4,6 +4,10 @@ // // Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland. // +// This file was modified by Oracle on 2019. +// Modifications copyright (c) 2019 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle +// // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -19,16 +23,19 @@ template ::type { - typedef typename rtree::node::type node; - typedef typename rtree::internal_node::type internal_node; - typedef typename rtree::leaf::type leaf; + typedef typename Options::parameters_type parameters_type; + typedef typename index::detail::strategy_type::type strategy_type; + + typedef typename rtree::node::type node; + typedef typename rtree::internal_node::type internal_node; + typedef typename rtree::leaf::type leaf; typedef typename Allocators::size_type size_type; static const unsigned predicates_len = index::detail::predicates_length::value; - inline spatial_query(Translator const& t, Predicates const& p, OutIter out_it) - : tr(t), pred(p), out_iter(out_it), found_count(0) + inline spatial_query(parameters_type const& par, Translator const& t, Predicates const& p, OutIter out_it) + : tr(t), pred(p), out_iter(out_it), found_count(0), strategy(index::detail::get_strategy(par)) {} inline void operator()(internal_node const& n) @@ -42,8 +49,13 @@ struct spatial_query { // if node meets predicates // 0 - dummy value - if ( index::detail::predicates_check(pred, 0, it->first) ) + if ( index::detail::predicates_check + < + index::detail::bounds_tag, 0, predicates_len + >(pred, 0, it->first, strategy) ) + { rtree::apply_visitor(*this, *it->second); + } } } @@ -57,7 +69,10 @@ struct spatial_query it != elements.end(); ++it) { // if value meets predicates - if ( index::detail::predicates_check(pred, *it, tr(*it)) ) + if ( index::detail::predicates_check + < + index::detail::value_tag, 0, predicates_len + >(pred, *it, tr(*it), strategy) ) { *out_iter = *it; ++out_iter; @@ -73,12 +88,17 @@ struct spatial_query OutIter out_iter; size_type found_count; + + strategy_type strategy; }; template class spatial_query_incremental : public rtree::visitor::type { + typedef typename Options::parameters_type parameters_type; + typedef typename index::detail::strategy_type::type strategy_type; + public: typedef typename rtree::node::type node; typedef typename rtree::internal_node::type internal_node; @@ -99,13 +119,15 @@ public: // , m_pred() , m_values(NULL) , m_current() +// , m_strategy() {} - inline spatial_query_incremental(Translator const& t, Predicates const& p) + inline spatial_query_incremental(parameters_type const& params, Translator const& t, Predicates const& p) : m_translator(::boost::addressof(t)) , m_pred(p) , m_values(NULL) , m_current() + , m_strategy(index::detail::get_strategy(params)) {} inline void operator()(internal_node const& n) @@ -151,8 +173,13 @@ public: { // return if next value is found Value const& v = *m_current; - if ( index::detail::predicates_check(m_pred, v, (*m_translator)(v)) ) + if (index::detail::predicates_check + < + index::detail::value_tag, 0, predicates_len + >(m_pred, v, (*m_translator)(v), m_strategy)) + { return; + } ++m_current; } @@ -180,8 +207,13 @@ public: ++m_internal_stack.back().first; // next node is found, push it to the stack - if ( index::detail::predicates_check(m_pred, 0, it->first) ) + if (index::detail::predicates_check + < + index::detail::bounds_tag, 0, predicates_len + >(m_pred, 0, it->first, m_strategy)) + { rtree::apply_visitor(*this, *(it->second)); + } } } } @@ -205,6 +237,8 @@ private: std::vector< std::pair > m_internal_stack; const leaf_elements * m_values; leaf_iterator m_current; + + strategy_type m_strategy; }; }}} // namespace detail::rtree::visitors