]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/index/detail/rtree/pack_create.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / geometry / index / detail / rtree / pack_create.hpp
index 2d3903a7b495ba3166553df7b913b08044ac3523..f8565bfb3ef04b306076db02909dc4bee8962f0e 100644 (file)
@@ -4,6 +4,10 @@
 //
 // Copyright (c) 2011-2017 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)
@@ -11,6 +15,8 @@
 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_PACK_CREATE_HPP
 #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_PACK_CREATE_HPP
 
+#include <boost/core/ignore_unused.hpp>
+
 #include <boost/geometry/algorithms/expand.hpp>
 #include <boost/geometry/index/detail/algorithms/bounds.hpp>
 #include <boost/geometry/index/detail/algorithms/nth_element.hpp>
@@ -135,6 +141,7 @@ class pack
     typedef typename geometry::coordinate_type<point_type>::type coordinate_type;
     typedef typename detail::default_content_result<Box>::type content_type;
     typedef typename Options::parameters_type parameters_type;
+    typedef typename detail::strategy_type<parameters_type>::type strategy_type;
     static const std::size_t dimension = geometry::dimension<point_type>::value;
 
     typedef typename rtree::container_from_elements_type<
@@ -163,7 +170,7 @@ public:
         values_count = static_cast<size_type>(diff);
         entries.reserve(values_count);
         
-        expandable_box<Box> hint_box;
+        expandable_box<Box, strategy_type> hint_box(detail::get_strategy(parameters));
         for ( ; first != last ; ++first )
         {
             // NOTE: support for iterators not returning true references adapted
@@ -192,19 +199,19 @@ public:
     }
 
 private:
-    template <typename BoxType>
+    template <typename BoxType, typename Strategy>
     class expandable_box
     {
     public:
-        expandable_box()
-            : m_initialized(false)
+        explicit expandable_box(Strategy const& strategy)
+            : m_strategy(strategy), m_initialized(false)
         {}
 
         template <typename Indexable>
-        explicit expandable_box(Indexable const& indexable)
-            : m_initialized(true)
+        explicit expandable_box(Indexable const& indexable, Strategy const& strategy)
+            : m_strategy(strategy), m_initialized(true)
         {
-            detail::bounds(indexable, m_box);
+            detail::bounds(indexable, m_box, m_strategy);
         }
 
         template <typename Indexable>
@@ -215,12 +222,12 @@ private:
                 // it's guaranteed that the Box will be initialized
                 // only for Points, Boxes and Segments but that's ok
                 // since only those Geometries can be stored
-                detail::bounds(indexable, m_box);
+                detail::bounds(indexable, m_box, m_strategy);
                 m_initialized = true;
             }
             else
             {
-                geometry::expand(m_box, indexable);
+                detail::expand(m_box, indexable, m_strategy);
             }
         }
 
@@ -236,8 +243,9 @@ private:
         }
 
     private:
-        bool m_initialized;
         BoxType m_box;
+        Strategy m_strategy;
+        bool m_initialized;
     };
 
     struct subtree_elements_counts
@@ -271,7 +279,8 @@ private:
 
             // calculate values box and copy values
             //   initialize the box explicitly to avoid GCC-4.4 uninitialized variable warnings with O2
-            expandable_box<Box> elements_box(translator(*(first->second)));
+            expandable_box<Box, strategy_type> elements_box(translator(*(first->second)),
+                                                            detail::get_strategy(parameters));
             rtree::elements(l).push_back(*(first->second));                                                 // MAY THROW (A?,C)
             for ( ++first ; first != last ; ++first )
             {
@@ -317,7 +326,7 @@ private:
         std::size_t nodes_count = calculate_nodes_count(values_count, subtree_counts);
         rtree::elements(in).reserve(nodes_count);                                                           // MAY THROW (A)
         // calculate values box and copy values
-        expandable_box<Box> elements_box;
+        expandable_box<Box, strategy_type> elements_box(detail::get_strategy(parameters));
         
         per_level_packets(first, last, hint_box, values_count, subtree_counts, next_subtree_counts,
                           rtree::elements(in), elements_box,
@@ -383,7 +392,7 @@ private:
     inline static
     subtree_elements_counts calculate_subtree_elements_counts(std::size_t elements_count, parameters_type const& parameters, size_type & leafs_level)
     {
-        boost::ignore_unused_variable_warning(parameters);
+        boost::ignore_unused(parameters);
 
         subtree_elements_counts res(1, 1);
         leafs_level = 0;