std::vector< std::pair<distance_type, Value> > m_neighbors;
};
-template <
- typename Value,
- typename Options,
- typename Translator,
- typename Box,
- typename Allocators,
+template
+<
+ typename MembersHolder,
typename Predicates,
unsigned DistancePredicateIndex,
typename OutIter
>
class distance_query
- : public rtree::visitor<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag, true>::type
+ : public MembersHolder::visitor_const
{
public:
- typedef typename Options::parameters_type parameters_type;
+ typedef typename MembersHolder::value_type value_type;
+ typedef typename MembersHolder::box_type box_type;
+ typedef typename MembersHolder::parameters_type parameters_type;
+ typedef typename MembersHolder::translator_type translator_type;
+ typedef typename MembersHolder::allocators_type allocators_type;
+
typedef typename index::detail::strategy_type<parameters_type>::type strategy_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 typename MembersHolder::node node;
+ typedef typename MembersHolder::internal_node internal_node;
+ typedef typename MembersHolder::leaf leaf;
typedef index::detail::predicates_element<DistancePredicateIndex, Predicates> nearest_predicate_access;
typedef typename nearest_predicate_access::type nearest_predicate_type;
- typedef typename indexable_type<Translator>::type indexable_type;
+ typedef typename indexable_type<translator_type>::type indexable_type;
typedef index::detail::calculate_distance<nearest_predicate_type, indexable_type, strategy_type, value_tag> calculate_value_distance;
- typedef index::detail::calculate_distance<nearest_predicate_type, Box, strategy_type, bounds_tag> calculate_node_distance;
+ typedef index::detail::calculate_distance<nearest_predicate_type, box_type, strategy_type, bounds_tag> calculate_node_distance;
typedef typename calculate_value_distance::result_type value_distance_type;
typedef typename calculate_node_distance::result_type node_distance_type;
static const unsigned predicates_len = index::detail::predicates_length<Predicates>::value;
- inline distance_query(parameters_type const& parameters, Translator const& translator, Predicates const& pred, OutIter out_it)
+ inline distance_query(parameters_type const& parameters, translator_type const& translator, Predicates const& pred, OutIter out_it)
: m_parameters(parameters), m_translator(translator)
, m_pred(pred)
, m_result(nearest_predicate_access::get(m_pred).count, out_it)
// array of active nodes
typedef typename index::detail::rtree::container_from_elements_type<
elements_type,
- std::pair<node_distance_type, typename Allocators::node_pointer>
+ std::pair<node_distance_type, typename allocators_type::node_pointer>
>::type active_branch_list_type;
active_branch_list_type active_branch_list;
private:
static inline bool abl_less(
- std::pair<node_distance_type, typename Allocators::node_pointer> const& p1,
- std::pair<node_distance_type, typename Allocators::node_pointer> const& p2)
+ std::pair<node_distance_type, typename allocators_type::node_pointer> const& p1,
+ std::pair<node_distance_type, typename allocators_type::node_pointer> const& p2)
{
return p1.first < p2.first;
}
//static inline bool abl_greater(
- // std::pair<node_distance_type, typename Allocators::node_pointer> const& p1,
- // std::pair<node_distance_type, typename Allocators::node_pointer> const& p2)
+ // std::pair<node_distance_type, typename allocators_type::node_pointer> const& p1,
+ // std::pair<node_distance_type, typename allocators_type::node_pointer> const& p2)
//{
// return p1.first > p2.first;
//}
}
parameters_type const& m_parameters;
- Translator const& m_translator;
+ translator_type const& m_translator;
Predicates m_pred;
- distance_query_result<Value, Translator, value_distance_type, OutIter> m_result;
+ distance_query_result<value_type, translator_type, value_distance_type, OutIter> m_result;
strategy_type m_strategy;
};
template <
- typename Value,
- typename Options,
- typename Translator,
- typename Box,
- typename Allocators,
+ typename MembersHolder,
typename Predicates,
unsigned DistancePredicateIndex
>
class distance_query_incremental
- : public rtree::visitor<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag, true>::type
+ : public MembersHolder::visitor_const
{
public:
- typedef typename Options::parameters_type parameters_type;
+ typedef typename MembersHolder::value_type value_type;
+ typedef typename MembersHolder::box_type box_type;
+ typedef typename MembersHolder::parameters_type parameters_type;
+ typedef typename MembersHolder::translator_type translator_type;
+ typedef typename MembersHolder::allocators_type allocators_type;
+
typedef typename index::detail::strategy_type<parameters_type>::type strategy_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 typename MembersHolder::node node;
+ typedef typename MembersHolder::internal_node internal_node;
+ typedef typename MembersHolder::leaf leaf;
typedef index::detail::predicates_element<DistancePredicateIndex, Predicates> nearest_predicate_access;
typedef typename nearest_predicate_access::type nearest_predicate_type;
- typedef typename indexable_type<Translator>::type indexable_type;
+ typedef typename indexable_type<translator_type>::type indexable_type;
typedef index::detail::calculate_distance<nearest_predicate_type, indexable_type, strategy_type, value_tag> calculate_value_distance;
- typedef index::detail::calculate_distance<nearest_predicate_type, Box, strategy_type, bounds_tag> calculate_node_distance;
+ typedef index::detail::calculate_distance<nearest_predicate_type, box_type, strategy_type, bounds_tag> calculate_node_distance;
typedef typename calculate_value_distance::result_type value_distance_type;
typedef typename calculate_node_distance::result_type node_distance_type;
- typedef typename Allocators::size_type size_type;
- typedef typename Allocators::const_reference const_reference;
- typedef typename Allocators::node_pointer node_pointer;
+ typedef typename allocators_type::size_type size_type;
+ typedef typename allocators_type::const_reference const_reference;
+ typedef typename allocators_type::node_pointer node_pointer;
static const unsigned predicates_len = index::detail::predicates_length<Predicates>::value;
// , m_strategy_type()
{}
- inline distance_query_incremental(parameters_type const& params, Translator const& translator, Predicates const& pred)
+ inline distance_query_incremental(parameters_type const& params, translator_type const& translator, Predicates const& pred)
: m_translator(::boost::addressof(translator))
, m_pred(pred)
, current_neighbor((std::numeric_limits<size_type>::max)())
}
private:
- static inline bool abl_less(std::pair<node_distance_type, typename Allocators::node_pointer> const& p1,
- std::pair<node_distance_type, typename Allocators::node_pointer> const& p2)
+ static inline bool abl_less(std::pair<node_distance_type, node_pointer> const& p1,
+ std::pair<node_distance_type, node_pointer> const& p2)
{
return p1.first < p2.first;
}
- static inline bool neighbors_less(std::pair<value_distance_type, const Value *> const& p1,
- std::pair<value_distance_type, const Value *> const& p2)
+ static inline bool neighbors_less(std::pair<value_distance_type, const value_type *> const& p1,
+ std::pair<value_distance_type, const value_type *> const& p2)
{
return p1.first < p2.first;
}
return nearest_predicate_access::get(m_pred);
}
- const Translator * m_translator;
+ const translator_type * m_translator;
Predicates m_pred;
internal_stack_type internal_stack;
- std::vector< std::pair<value_distance_type, const Value *> > neighbors;
+ std::vector< std::pair<value_distance_type, const value_type *> > neighbors;
size_type current_neighbor;
node_distance_type next_closest_node_distance;