|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81355 - in sandbox-branches/geometry/index_dev: boost/geometry/extensions/index/rtree boost/geometry/extensions/index/rtree/visitors test
From: adam.wulkiewicz_at_[hidden]
Date: 2012-11-15 06:23:37
Author: awulkiew
Date: 2012-11-15 06:23:36 EST (Thu, 15 Nov 2012)
New Revision: 81355
URL: http://svn.boost.org/trac/boost/changeset/81355
Log:
A cosmetic change in raw_destroy().
Some of the rtree member types and methods made private unless BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE is defined.
Text files modified:
sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/rtree.hpp | 77 ++++++++++++++++++++++++---------------
sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp | 7 ++-
sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp | 7 ++-
sandbox-branches/geometry/index_dev/test/geometry_index_test_common.hpp | 1
4 files changed, 57 insertions(+), 35 deletions(-)
Modified: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/rtree.hpp (original)
+++ sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/rtree.hpp 2012-11-15 06:23:36 EST (Thu, 15 Nov 2012)
@@ -80,21 +80,26 @@
public:
typedef Value value_type;
+ typedef Parameters parameters_type;
typedef Translator translator_type;
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+
typedef typename translator::indexable_type<Translator>::type indexable_type;
typedef typename index::default_box_type<indexable_type>::type box_type;
+#if !defined(BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE)
+private:
+#endif
typedef typename detail::rtree::options_type<Parameters>::type options_type;
typedef typename options_type::node_tag node_tag;
-
- typedef Allocator allocator_type;
typedef detail::rtree::allocators<allocator_type, value_type, typename options_type::parameters_type, box_type, node_tag> allocators_type;
- typedef typename allocators_type::size_type size_type;
typedef typename detail::rtree::node<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type node;
typedef typename detail::rtree::internal_node<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type internal_node;
typedef typename detail::rtree::leaf<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type leaf;
+public:
/*!
The constructor.
@@ -517,6 +522,30 @@
}
/*!
+ Returns parameters.
+
+ \note Exception-safety: nothrow.
+
+ \return The parameters object.
+ */
+ inline parameters_type const& parameters() const
+ {
+ return m_parameters;
+ }
+
+ /*!
+ Returns the translator object.
+
+ \note Exception-safety: nothrow.
+
+ \return The translator object.
+ */
+ inline translator_type const& translator() const
+ {
+ return m_translator;
+ }
+
+ /*!
Returns allocator used by the rtree.
\note Exception-safety: nothrow if allocator copy can't throw.
@@ -528,10 +557,13 @@
return m_allocators.allocator;
}
+#if !defined(BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE)
+private:
+#endif
/*!
Apply a visitor to the nodes structure in order to perform some operator.
This function is not a part of the 'official' interface. However it makes
- possible to e.g. draw the tree structure.
+ possible e.g. to pass a visitor drawing the tree structure.
\note Exception-safety: the same as visitor.
@@ -544,19 +576,6 @@
}
/*!
- Returns the translator object.
- This function is not a part of the 'official' interface.
-
- \note Exception-safety: nothrow.
-
- \return The translator object.
- */
- inline translator_type const& translator() const
- {
- return m_translator;
- }
-
- /*!
Returns the number of stored objects. Same as size()
This function is not a part of the 'official' interface.
@@ -663,20 +682,20 @@
*/
inline void raw_destroy(rtree & t, bool destroy_root = true)
{
- if ( !t.m_root )
- return;
-
- if ( destroy_root )
+ if ( t.m_root )
{
- detail::rtree::visitors::destroy<value_type, options_type, translator_type, box_type, allocators_type> del_v(t.m_root, t.m_allocators);
- detail::rtree::apply_visitor(del_v, *t.m_root);
- }
- else
- {
- detail::rtree::clear_node<value_type, options_type, translator_type, box_type, allocators_type>::apply(*t.m_root, t.m_allocators);
- }
+ if ( destroy_root )
+ {
+ detail::rtree::visitors::destroy<value_type, options_type, translator_type, box_type, allocators_type> del_v(t.m_root, t.m_allocators);
+ detail::rtree::apply_visitor(del_v, *t.m_root);
+ }
+ else
+ {
+ detail::rtree::clear_node<value_type, options_type, translator_type, box_type, allocators_type>::apply(*t.m_root, t.m_allocators);
+ }
- t.m_root = 0;
+ t.m_root = 0;
+ }
t.m_values_count = 0;
t.m_leafs_level = 0;
}
Modified: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp (original)
+++ sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp 2012-11-15 06:23:36 EST (Thu, 15 Nov 2012)
@@ -117,11 +117,12 @@
}}} // namespace detail::rtree::visitors
-template <typename Value, typename Options, typename Translator, typename Allocator>
-bool are_boxes_ok(rtree<Value, Options, Translator, Allocator> const& tree,
+template <typename Value, typename Parameters, typename Translator, typename Allocator>
+bool are_boxes_ok(rtree<Value, Parameters, Translator, Allocator> const& tree,
bool exact_match = true)
{
- typedef rtree<Value, Options, Translator, Allocator> rt;
+ typedef rtree<Value, Parameters, Translator, Allocator> rt;
+
detail::rtree::visitors::are_boxes_ok<
typename rt::value_type,
typename rt::options_type,
Modified: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp (original)
+++ sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp 2012-11-15 06:23:36 EST (Thu, 15 Nov 2012)
@@ -88,10 +88,11 @@
}}} // namespace detail::rtree::visitors
-template <typename Value, typename Options, typename Translator, typename Allocator>
-bool are_levels_ok(rtree<Value, Options, Translator, Allocator> const& tree)
+template <typename Value, typename Parameters, typename Translator, typename Allocator>
+bool are_levels_ok(rtree<Value, Parameters, Translator, Allocator> const& tree)
{
- typedef rtree<Value, Options, Translator, Allocator> rt;
+ typedef rtree<Value, Parameters, Translator, Allocator> rt;
+
detail::rtree::visitors::are_levels_ok<
typename rt::value_type,
typename rt::options_type,
Modified: sandbox-branches/geometry/index_dev/test/geometry_index_test_common.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/test/geometry_index_test_common.hpp (original)
+++ sandbox-branches/geometry/index_dev/test/geometry_index_test_common.hpp 2012-11-15 06:23:36 EST (Thu, 15 Nov 2012)
@@ -11,6 +11,7 @@
#define GEOMETRY_TEST_GEOMETRY_INDEX_TEST_COMMON_HPP
#include <boost/geometry.hpp>
+#define BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE
#include <boost/geometry/extensions/index/rtree/rtree.hpp>
#include <geometry_test_common.hpp>
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