]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/index/detail/rtree/visitors/distance_query.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / geometry / index / detail / rtree / visitors / distance_query.hpp
index 20a954dc4e9c2a510e4dd110ff78f5a5bb1d6d08..edf47f90bdf3281de800349e7e4bfedbe9533ff0 100644 (file)
@@ -93,39 +93,41 @@ private:
     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)
@@ -139,7 +141,7 @@ public:
         // 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;
@@ -261,15 +263,15 @@ public:
 
 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;
     //}
@@ -286,46 +288,47 @@ private:
     }
 
     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;
 
@@ -362,7 +365,7 @@ public:
 //        , 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)())
@@ -552,14 +555,14 @@ public:
     }
 
 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;
     }
@@ -597,12 +600,12 @@ private:
         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;