Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83255 - in sandbox-branches/geometry/index: boost/geometry/index boost/geometry/index/detail/rtree/visitors test test/rtree/generated
From: adam.wulkiewicz_at_[hidden]
Date: 2013-03-02 18:51:14


Author: awulkiew
Date: 2013-03-02 18:51:13 EST (Sat, 02 Mar 2013)
New Revision: 83255
URL: http://svn.boost.org/trac/boost/changeset/83255

Log:
rtree: added indexable_getter and value_equal. Macro enabling debug interface renamed.
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/are_boxes_ok.hpp | 4 +-
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/are_levels_ok.hpp | 4 +-
   sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp | 44 +++++++++++++++++++++++++++++++++------
   sandbox-branches/geometry/index/boost/geometry/index/translator.hpp | 3 ++
   sandbox-branches/geometry/index/test/geometry_index_test_common.hpp | 2
   sandbox-branches/geometry/index/test/rtree/generated/rtree_b2f_rstar.cpp | 4 +++
   6 files changed, 49 insertions(+), 12 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/are_boxes_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/are_boxes_ok.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/are_boxes_ok.hpp 2013-03-02 18:51:13 EST (Sat, 02 Mar 2013)
@@ -116,8 +116,8 @@
 
 } // namespace visitors
 
-#ifndef BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE
-#error "To use are_boxes_ok BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE should be defined before including the rtree"
+#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_DEBUG_INTERFACE
+#error "To use are_boxes_ok BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_DEBUG_INTERFACE should be defined before including the rtree"
 #endif
 
 template <typename Value, typename Parameters, typename IndexableGetter, typename EqualTo, typename Allocator>

Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/are_levels_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/are_levels_ok.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/are_levels_ok.hpp 2013-03-02 18:51:13 EST (Sat, 02 Mar 2013)
@@ -87,8 +87,8 @@
 
 } // namespace visitors
 
-#ifndef BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE
-#error "To use are_levels_ok() BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE should be defined before including the rtree"
+#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_DEBUG_INTERFACE
+#error "To use are_levels_ok() BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_DEBUG_INTERFACE should be defined before including the rtree"
 #endif
 
 template <typename Value, typename Parameters, typename IndexableGetter, typename EqualTo, typename Allocator>

Modified: sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp 2013-03-02 18:51:13 EST (Sat, 02 Mar 2013)
@@ -116,17 +116,21 @@
     /*! \brief Unsigned integral type used by the container. */
     typedef typename allocator_type::size_type size_type;
 
- // temporarily public - don't use it
- typedef detail::translator::translator<IndexableGetter, EqualTo> translator_type;
+ typedef IndexableGetter indexable_getter;
+ typedef EqualTo value_equal;
 
     /*! \brief The Indexable type to which Value is translated. */
- typedef typename index::detail::translator::indexable_type<translator_type>::type indexable_type;
+ typedef typename index::detail::translator::indexable_type<
+ detail::translator::translator<IndexableGetter, EqualTo>
+ >::type indexable_type;
     /*! \brief The Box type used by the R-tree. */
     typedef typename index::detail::default_box_type<indexable_type>::type bounds_type;
 
-#if !defined(BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE)
+#if !defined(BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_DEBUG_INTERFACE)
 private:
 #endif
+ typedef detail::translator::translator<IndexableGetter, EqualTo> translator_type;
+
     typedef bounds_type box_type;
     typedef typename detail::rtree::options_type<Parameters>::type options_type;
     typedef typename options_type::node_tag node_tag;
@@ -776,12 +780,38 @@
     \par Throws
     Nothing.
     */
- inline parameters_type const& parameters() const
+ inline parameters_type parameters() const
     {
         return m_members.parameters();
     }
 
     /*!
+ \brief Returns function retrieving Indexable from Value.
+
+ \return The indexable_getter object.
+
+ \par Throws
+ Nothing.
+ */
+ indexable_getter indexable_get() const
+ {
+ return m_members.translator().indexable_get();
+ }
+
+ /*!
+ \brief Returns function comparing Values
+
+ \return The value_equal function.
+
+ \par Throws
+ Nothing.
+ */
+ value_equal value_eq() const
+ {
+ return m_members.translator().value_eq();
+ }
+
+ /*!
     \brief Returns allocator used by the rtree.
 
     \return The allocator.
@@ -794,7 +824,7 @@
         return m_members.allocators().allocator();
     }
 
-#if !defined(BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE)
+#if !defined(BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_DEBUG_INTERFACE)
 private:
 #endif
     /*!
@@ -805,7 +835,7 @@
     \par Throws
     Nothing.
     */
- inline translator_type const& translator() const
+ inline translator_type translator() const
     {
         return m_members.translator();
     }

Modified: sandbox-branches/geometry/index/boost/geometry/index/translator.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/translator.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/translator.hpp 2013-03-02 18:51:13 EST (Sat, 02 Mar 2013)
@@ -249,6 +249,9 @@
     {
         return EqualTo::operator()(v1, v2);
     }
+
+ IndexableGetter const& indexable_get() const { return *this; }
+ EqualTo const& value_eq() const { return *this; }
 };
 
 template <typename Translator>

Modified: sandbox-branches/geometry/index/test/geometry_index_test_common.hpp
==============================================================================
--- sandbox-branches/geometry/index/test/geometry_index_test_common.hpp (original)
+++ sandbox-branches/geometry/index/test/geometry_index_test_common.hpp 2013-03-02 18:51:13 EST (Sat, 02 Mar 2013)
@@ -11,7 +11,7 @@
 #define GEOMETRY_TEST_GEOMETRY_INDEX_TEST_COMMON_HPP
 
 #include <boost/geometry.hpp>
-#define BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE
+#define BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_DEBUG_INTERFACE
 #include <boost/geometry/index/rtree.hpp>
 
 #include <geometry_test_common.hpp>

Modified: sandbox-branches/geometry/index/test/rtree/generated/rtree_b2f_rstar.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/generated/rtree_b2f_rstar.cpp (original)
+++ sandbox-branches/geometry/index/test/rtree/generated/rtree_b2f_rstar.cpp 2013-03-02 18:51:13 EST (Sat, 02 Mar 2013)
@@ -12,6 +12,10 @@
 #include <boost/geometry/geometries/point.hpp>
 #include <boost/geometry/geometries/box.hpp>
 
+#include <set>
+
+bool cmp(int a, int b) { return a < b; }
+
 int test_main(int, char* [])
 {
     typedef bg::model::point<float, 2, bg::cs::cartesian> Point;


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