|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72600 - sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar
From: adam.wulkiewicz_at_[hidden]
Date: 2011-06-14 18:53:56
Author: awulkiew
Date: 2011-06-14 18:53:56 EDT (Tue, 14 Jun 2011)
New Revision: 72600
URL: http://svn.boost.org/trac/boost/changeset/72600
Log:
r* insert corrected to handle boost::variant nodes
Text files modified:
sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/insert.hpp 2011-06-14 18:53:56 EDT (Tue, 14 Jun 2011)
@@ -107,7 +107,7 @@
};
template <size_t InsertIndex, typename Element, typename Value, typename Options, typename Box>
-struct level_insert_result_type
+struct level_insert_elements_type
{
typedef typename rtree::elements_type<
typename rtree::internal_node<Value, Box, typename Options::node_tag>::type
@@ -115,7 +115,7 @@
};
template <typename Value, typename Options, typename Box>
-struct level_insert_result_type<0, Value, Value, Options, Box>
+struct level_insert_elements_type<0, Value, Value, Options, Box>
{
typedef typename rtree::elements_type<
typename rtree::leaf<Value, Box, typename Options::node_tag>::type
@@ -131,7 +131,7 @@
typedef typename base::internal_node internal_node;
typedef typename base::leaf leaf;
- typedef typename level_insert_result_type<InsertIndex, Element, Value, Options, Box>::type result_type;
+ typedef typename level_insert_elements_type<InsertIndex, Element, Value, Options, Box>::type elements_type;
inline level_insert_base(node* & root,
size_t & leafs_level,
@@ -167,7 +167,7 @@
else
{
// it's really the root node
- assert(&rtree::get<Node>(n) == base::m_root_node);
+ assert(&n == rtree::get<Node>(base::m_root_node));
base::split(n);
}
}
@@ -195,7 +195,7 @@
}
size_t result_relative_level;
- result_type result_elements;
+ elements_type result_elements;
};
template <size_t InsertIndex, typename Element, typename Value, typename Options, typename Translator, typename Box>
@@ -207,8 +207,6 @@
typedef typename base::internal_node internal_node;
typedef typename base::leaf leaf;
- typedef typename base::result_type result_type;
-
inline level_insert(node* & root,
size_t & leafs_level,
Element const& element,
@@ -276,8 +274,6 @@
typedef typename base::internal_node internal_node;
typedef typename base::leaf leaf;
- typedef typename base::result_type result_type;
-
inline level_insert(node* & root,
size_t & leafs_level,
Value const& v,
@@ -327,8 +323,6 @@
typedef typename base::internal_node internal_node;
typedef typename base::leaf leaf;
- typedef typename base::result_type result_type;
-
inline level_insert(node* & root,
size_t & leafs_level,
Value const& v,
@@ -393,12 +387,13 @@
inline void operator()(internal_node & n)
{
- typedef typename elements_type<internal_node>::type elements_type;
-
+ // current node should be the root
+ assert(&n == rtree::get<internal_node>(m_root));
+
detail::rstar::level_insert<0, Element, Value, Options, Translator, Box> lins_v(
m_root, m_leafs_level, m_element, m_min_elements, m_max_elements, m_tr, m_relative_level);
- rtree::apply_visitor(lins_v, n);
+ rtree::apply_visitor(lins_v, *m_root);
if ( !lins_v.result_elements.empty() )
{
@@ -408,10 +403,13 @@
inline void operator()(leaf & n)
{
+ // current node should be the root
+ assert(&n == rtree::get<leaf>(m_root));
+
detail::rstar::level_insert<0, Element, Value, Options, Translator, Box> lins_v(
m_root, m_leafs_level, m_element, m_min_elements, m_max_elements, m_tr, m_relative_level);
- rtree::apply_visitor(lins_v, n);
+ rtree::apply_visitor(lins_v, *m_root);
// we're in the root, so root should be split and there should be no elements to reinsert
assert(lins_v.result_elements.empty());
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk