diff --git a/include/boost/geometry/extensions/index/rtree/rtree.hpp b/include/boost/geometry/extensions/index/rtree/rtree.hpp index d216cdade..91015566b 100644 --- a/include/boost/geometry/extensions/index/rtree/rtree.hpp +++ b/include/boost/geometry/extensions/index/rtree/rtree.hpp @@ -80,21 +80,26 @@ class rtree 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::type indexable_type; typedef typename index::default_box_type::type box_type; +#if !defined(BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE) +private: +#endif typedef typename detail::rtree::options_type::type options_type; typedef typename options_type::node_tag node_tag; - - typedef Allocator allocator_type; typedef detail::rtree::allocators allocators_type; - typedef typename allocators_type::size_type size_type; typedef typename detail::rtree::node::type node; typedef typename detail::rtree::internal_node::type internal_node; typedef typename detail::rtree::leaf::type leaf; +public: /*! The constructor. @@ -516,6 +521,30 @@ public: return children_box_v.result; } + /*! + 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. @@ -528,10 +557,13 @@ public: 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. @@ -543,19 +575,6 @@ public: detail::rtree::apply_visitor(visitor, *m_root); } - /*! - 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 @@ private: */ 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 del_v(t.m_root, t.m_allocators); - detail::rtree::apply_visitor(del_v, *t.m_root); - } - else - { - detail::rtree::clear_node::apply(*t.m_root, t.m_allocators); - } + if ( destroy_root ) + { + detail::rtree::visitors::destroy del_v(t.m_root, t.m_allocators); + detail::rtree::apply_visitor(del_v, *t.m_root); + } + else + { + detail::rtree::clear_node::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; } diff --git a/include/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp b/include/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp index 77fdb782a..9f8ac5dcc 100644 --- a/include/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp +++ b/include/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp @@ -117,11 +117,12 @@ private: }}} // namespace detail::rtree::visitors -template -bool are_boxes_ok(rtree const& tree, +template +bool are_boxes_ok(rtree const& tree, bool exact_match = true) { - typedef rtree rt; + typedef rtree rt; + detail::rtree::visitors::are_boxes_ok< typename rt::value_type, typename rt::options_type, diff --git a/include/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp b/include/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp index eabbfaf02..e7999adc5 100644 --- a/include/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp +++ b/include/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp @@ -88,10 +88,11 @@ private: }}} // namespace detail::rtree::visitors -template -bool are_levels_ok(rtree const& tree) +template +bool are_levels_ok(rtree const& tree) { - typedef rtree rt; + typedef rtree rt; + detail::rtree::visitors::are_levels_ok< typename rt::value_type, typename rt::options_type, diff --git a/test/geometry_index_test_common.hpp b/test/geometry_index_test_common.hpp index 0f21bdc20..35e623d86 100644 --- a/test/geometry_index_test_common.hpp +++ b/test/geometry_index_test_common.hpp @@ -11,6 +11,7 @@ #define GEOMETRY_TEST_GEOMETRY_INDEX_TEST_COMMON_HPP #include +#define BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE #include #include