summaryrefslogtreecommitdiff
path: root/boost/geometry/index/detail/rtree/visitors/count.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/index/detail/rtree/visitors/count.hpp')
-rw-r--r--boost/geometry/index/detail/rtree/visitors/count.hpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/boost/geometry/index/detail/rtree/visitors/count.hpp b/boost/geometry/index/detail/rtree/visitors/count.hpp
index 7efd5b7028..2cdbd8c0ed 100644
--- a/boost/geometry/index/detail/rtree/visitors/count.hpp
+++ b/boost/geometry/index/detail/rtree/visitors/count.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)
@@ -23,10 +27,10 @@ struct count_helper
{
return i;
}
- template <typename Translator>
- static inline bool equals(Indexable const& i, Value const& v, Translator const& tr)
+ template <typename Translator, typename Strategy>
+ static inline bool equals(Indexable const& i, Value const& v, Translator const& tr, Strategy const& s)
{
- return geometry::equals(i, tr(v));
+ return index::detail::equals<Indexable>::apply(i, tr(v), s);
}
};
@@ -38,10 +42,10 @@ struct count_helper<Value, Value>
{
return tr(v);
}
- template <typename Translator>
- static inline bool equals(Value const& v1, Value const& v2, Translator const& tr)
+ template <typename Translator, typename Strategy>
+ static inline bool equals(Value const& v1, Value const& v2, Translator const& tr, Strategy const& s)
{
- return tr.equals(v1, v2);
+ return tr.equals(v1, v2, s);
}
};
@@ -49,14 +53,16 @@ template <typename ValueOrIndexable, typename Value, typename Options, typename
struct count
: public rtree::visitor<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag, true>::type
{
- typedef typename rtree::node<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type node;
- typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type internal_node;
- typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;
+ typedef typename Options::parameters_type parameters_type;
+
+ typedef typename rtree::node<Value, parameters_type, Box, Allocators, typename Options::node_tag>::type node;
+ typedef typename rtree::internal_node<Value, parameters_type, Box, Allocators, typename Options::node_tag>::type internal_node;
+ typedef typename rtree::leaf<Value, parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;
typedef count_helper<ValueOrIndexable, Value> count_help;
- inline count(ValueOrIndexable const& vori, Translator const& t)
- : value_or_indexable(vori), tr(t), found_count(0)
+ inline count(ValueOrIndexable const& vori, parameters_type const& parameters, Translator const& t)
+ : value_or_indexable(vori), m_parameters(parameters), tr(t), found_count(0)
{}
inline void operator()(internal_node const& n)
@@ -68,10 +74,9 @@ struct count
for (typename elements_type::const_iterator it = elements.begin();
it != elements.end(); ++it)
{
- if ( geometry::covered_by(
- return_ref_or_bounds(
- count_help::indexable(value_or_indexable, tr)),
- it->first) )
+ if ( index::detail::covered_by_bounds(count_help::indexable(value_or_indexable, tr),
+ it->first,
+ index::detail::get_strategy(m_parameters)) )
{
rtree::apply_visitor(*this, *it->second);
}
@@ -88,7 +93,8 @@ struct count
it != elements.end(); ++it)
{
// if value meets predicates
- if ( count_help::equals(value_or_indexable, *it, tr) )
+ if ( count_help::equals(value_or_indexable, *it, tr,
+ index::detail::get_strategy(m_parameters)) )
{
++found_count;
}
@@ -96,6 +102,7 @@ struct count
}
ValueOrIndexable const& value_or_indexable;
+ parameters_type const& m_parameters;
Translator const& tr;
typename Allocators::size_type found_count;
};