//
// 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)
{
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);
}
};
{
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);
}
};
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)
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);
}
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;
}
}
ValueOrIndexable const& value_or_indexable;
+ parameters_type const& m_parameters;
Translator const& tr;
typename Allocators::size_type found_count;
};