Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81561 - in sandbox-branches/geometry/index_dev: boost/geometry/extensions/index/translator doc/html doc/html/geometry_index doc/html/geometry_index/r_tree doc/rtree test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2012-11-26 12:36:22


Author: awulkiew
Date: 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
New Revision: 81561
URL: http://svn.boost.org/trac/boost/changeset/81561

Log:
Implemented default translator for boost::tuple.
Added tests and docs.
Text files modified:
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/translator/def.hpp | 63 ++++++++++++++++++++++++++++++++++++++++
   sandbox-branches/geometry/index_dev/doc/html/geometry_index/introduction.html | 2
   sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree.html | 2
   sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/creation_and_modification.html | 23 +++++++------
   sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/exception_safety.html | 12 +++---
   sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/introduction.html | 16 +++++-----
   sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/nearest_neighbours_queries.html | 2
   sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/rtree_quickstart.html | 4 +-
   sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/spatial_queries.html | 2
   sandbox-branches/geometry/index_dev/doc/html/index.html | 2
   sandbox-branches/geometry/index_dev/doc/rtree/creation.qbk | 9 +++--
   sandbox-branches/geometry/index_dev/test/rtree/test_rtree.hpp | 50 +++++++++++++++++++++++++++++++
   12 files changed, 151 insertions(+), 36 deletions(-)

Modified: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/translator/def.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/translator/def.hpp (original)
+++ sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/translator/def.hpp 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -176,6 +176,69 @@
     }
 };
 
+namespace detail
+{
+
+template <typename Tuple, size_t I, size_t N>
+struct compare_tuples
+{
+ inline static bool apply(Tuple const& t1, Tuple const& t2)
+ {
+ typedef typename boost::tuples::element<I, Tuple>::type T;
+ return dispatch::equals<
+ T,
+ typename geometry::traits::tag<T>::type
+ >::apply(boost::get<I>(t1), boost::get<I>(t2))
+ &&
+ compare_tuples<Tuple, I+1, N>::apply(t1, t2);
+ }
+};
+
+template <typename Tuple, size_t I>
+struct compare_tuples<Tuple, I, I>
+{
+ inline static bool apply(Tuple const&, Tuple const&)
+ {
+ return true;
+ }
+};
+
+} // namespace detail
+
+/*!
+The default translator. This specialization translates from boost::tuple<Indexable, ...>.
+
+\tparam Indexable The Indexable type.
+\tparam Second The second type.
+*/
+template <typename Indexable, typename T1, typename T2, typename T3, typename T4,
+ typename T5, typename T6, typename T7, typename T8, typename T9>
+struct def< boost::tuple<Indexable, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
+{
+ typedef boost::tuple<Indexable, T1, T2, T3, T4, T5, T6, T7, T8, T9> value_type;
+
+ BOOST_MPL_ASSERT_MSG(
+ (!detail::indexable_not_found_error<
+ typename traits::indexable_type<Indexable>::type
+ >::value),
+ NOT_VALID_INDEXABLE_TYPE,
+ (Indexable)
+ );
+
+ typedef Indexable const& result_type;
+
+ result_type operator()(value_type const& value) const
+ {
+ return boost::get<0>(value);
+ }
+
+ bool equals(value_type const& v1, value_type const& v2) const
+ {
+ return detail::compare_tuples<value_type, 0, boost::tuples::length<value_type>::value>
+ ::apply(v1, v2);
+ }
+};
+
 }}}} // namespace boost::geometry::index::translator
 
 #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_TRANSLATOR_DEF_HPP

Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/introduction.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/introduction.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/introduction.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 <title>Introduction</title>
 <link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="prev" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">

Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 <title>R-tree</title>
 <link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="prev" href="introduction.html" title="Introduction">

Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/creation_and_modification.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/creation_and_modification.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/creation_and_modification.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 <title>Creation and modification</title>
 <link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="up" href="../r_tree.html" title="R-tree">
 <link rel="prev" href="rtree_quickstart.html" title="Quick Start">
@@ -53,7 +53,7 @@
         </p>
 <pre class="programlisting"><span class="identifier">rtree</span><span class="special">&lt;</span><span class="identifier">Value</span><span class="special">,</span> <span class="identifier">Parameters</span><span class="special">,</span> <span class="identifier">Translator</span> <span class="special">=</span> <span class="identifier">translator</span><span class="special">::</span><span class="identifier">def</span><span class="special">&lt;</span><span class="identifier">Value</span><span class="special">&gt;,</span> <span class="identifier">Allocator</span><span class="special">&gt;</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">Value</span><span class="special">&gt;</span> <span class="special">&gt;</span>
 </pre>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
 <li class="listitem">
               <code class="computeroutput">Value</code> - type of object which will be stored in the container,
             </li>
@@ -83,13 +83,11 @@
           that the R-tree can handle. Those objects are called <code class="computeroutput">Indexable</code>s
           in this documentation. Each type adapted to <code class="computeroutput">Point</code>
           or <code class="computeroutput">Box</code>
- concept is an <code class="computeroutput">Indexable</code>. Default <code class="computeroutput">Translator</code>
- <code class="computeroutput"><span class="identifier">index</span><span class="special">::</span><span class="identifier">translator</span><span class="special">::</span><span class="identifier">def</span><span class="special">&lt;</span>Value<span class="special">&gt;</span></code> is able to handle <code class="computeroutput">Point</code>,
- <code class="computeroutput">Box</code>
- or <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;...&gt;</span></code>
- <code class="computeroutput">Value</code>s.
+ concept is an <code class="computeroutput">Indexable</code>. <code class="computeroutput">Value</code>s types which can
+ be handled by the default <code class="computeroutput">Translator</code> - <code class="computeroutput"><span class="identifier">index</span><span class="special">::</span><span class="identifier">translator</span><span class="special">::</span><span class="identifier">def</span><span class="special">&lt;</span>Value<span class="special">&gt;</span></code>
+ are defined as follows:
         </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
 <li class="listitem">
               <code class="computeroutput">Indexable <span class="special">=</span> Point
               <span class="special">|</span> Box</code>
@@ -97,7 +95,9 @@
 <li class="listitem">
               <code class="computeroutput">Value <span class="special">=</span> <span class="identifier">Indexable</span>
               <span class="special">|</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span>Indexable<span class="special">,</span>
- <span class="identifier">T</span><span class="special">&gt;</span></code>
+ <span class="identifier">T</span><span class="special">&gt;</span>
+ <span class="special">|</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span>Indexable<span class="special">,</span>
+ <span class="special">...&gt;</span></code>
             </li>
 </ul></div>
 <p>
@@ -106,13 +106,14 @@
 <pre class="programlisting"><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">point</span><span class="special">&lt;...&gt;</span>
 <span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">point_xy</span><span class="special">&lt;...&gt;</span>
 <span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">box</span><span class="special">&lt;...&gt;</span>
-<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">box</span><span class="special">&lt;...&gt;,</span> <span class="identifier">size_t</span><span class="special">&gt;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">box</span><span class="special">&lt;...&gt;,</span> <span class="keyword">unsigned</span><span class="special">&gt;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">point</span><span class="special">&lt;...&gt;,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">&gt;</span>
 </pre>
 <p>
           A <code class="computeroutput">Translator</code> is a type which knows how to handle <code class="computeroutput">Value</code>s.
           It has two purposes:
         </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
 <li class="listitem">
               it translates <code class="computeroutput">Value</code> to a more suitable <code class="computeroutput">Indexable</code>
               type which is needed by most of operations,

Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/exception_safety.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/exception_safety.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/exception_safety.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 <title>Exception safety</title>
 <link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="up" href="../r_tree.html" title="R-tree">
 <link rel="prev" href="nearest_neighbours_queries.html" title="Nearest neighbours queries">
@@ -28,7 +28,7 @@
 <p>
         In order to be exception-safe the R-tree requires:
       </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
 <li class="listitem">
             Exception-safe copy constructor of the <code class="computeroutput">Value</code>.
           </li>
@@ -155,7 +155,7 @@
 <td>
                 <p>
                   <span class="emphasis"><em>nothrow</em></span> or <span class="bold"><strong>strong</strong></span>
- <sup>[<a name="geometry_index.r_tree.exception_safety.f0" href="#ftn.geometry_index.r_tree.exception_safety.f0" class="footnote">a</a>]</sup>
+ [a]</sup></a>
                 </p>
               </td>
 </tr>
@@ -332,7 +332,7 @@
 <td>
                 <p>
                   <span class="emphasis"><em>nothrow</em></span> or <span class="bold"><strong>strong</strong></span>
- <sup>[<a name="geometry_index.r_tree.exception_safety.f1" href="#ftn.geometry_index.r_tree.exception_safety.f1" class="footnote">b</a>]</sup>
+ [b]</sup></a>
                 </p>
               </td>
 </tr>
@@ -374,10 +374,10 @@
 </tr>
 </tbody>
 <tbody class="footnotes"><tr><td colspan="2">
-<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.exception_safety.f0" href="#geometry_index.r_tree.exception_safety.f0" class="para">a</a>] </sup>
+<div id="ftn.geometry_index.r_tree.exception_safety.f0" class="footnote"><p>[a]
                     <span class="emphasis"><em>nothrow</em></span> - if allocators are equal, <span class="bold"><strong>strong</strong></span> - otherwise
                   </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.exception_safety.f1" href="#geometry_index.r_tree.exception_safety.f1" class="para">b</a>] </sup>
+<div id="ftn.geometry_index.r_tree.exception_safety.f1" class="footnote"><p>[b]
                     <span class="emphasis"><em>nothrow</em></span> - if <code class="computeroutput"><span class="identifier">CoordinateType</span></code>
                     has nonthrowing copy constructor, <span class="bold"><strong>strong</strong></span>
                     - otherwise

Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/introduction.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/introduction.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/introduction.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 <title>Introduction</title>
 <link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="up" href="../r_tree.html" title="R-tree">
 <link rel="prev" href="../r_tree.html" title="R-tree">
@@ -28,7 +28,7 @@
 </h3></div></div></div>
 <p>
         R-tree is a tree data structure used for spatial searching. It was proposed
- by Antonin Guttman in 1984 <sup>[<a name="geometry_index.r_tree.introduction.f0" href="#ftn.geometry_index.r_tree.introduction.f0" class="footnote">1</a>]</sup> as an expansion of B-tree for multi-dimensional data. It may
+ by Antonin Guttman in 1984 [1]</sup></a> as an expansion of B-tree for multi-dimensional data. It may
         be used to store points or volumetric data in order to perform a spatial
         query later. This query may return objects that are inside some area or are
         close to some point in space.
@@ -51,7 +51,7 @@
       </p>
 <p>
         The R-tree is a self-balanced data structure. The key part of balancing algorithm
- is node splitting algorithm <sup>[<a name="geometry_index.r_tree.introduction.f1" href="#ftn.geometry_index.r_tree.introduction.f1" class="footnote">2</a>]</sup> <sup>[<a name="geometry_index.r_tree.introduction.f2" href="#ftn.geometry_index.r_tree.introduction.f2" class="footnote">3</a>]</sup>. Each algorithm produces different splits so the internal structure
+ is node splitting algorithm [2]</sup></a> [3]</sup></a>. Each algorithm produces different splits so the internal structure
         of a tree may be different for each one of them. In general more complex
         algorithms analyses elements better and produces less overlapping nodes.
         In the searching process less nodes must be traversed in order to find desired
@@ -180,7 +180,7 @@
 <p>
         Key features of this implementation of the R-tree are:
       </p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
 <li class="listitem">
             three different creation algorithms - linear, quadratic or rstar,
           </li>
@@ -197,16 +197,16 @@
           </li>
 </ul></div>
 <div class="footnotes">
-<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.introduction.f0" href="#geometry_index.r_tree.introduction.f0" class="para">1</a>] </sup>
+<br><hr style="width:100; align:left;">
+<div id="ftn.geometry_index.r_tree.introduction.f0" class="footnote"><p>[1]
           Guttman, A. (1984). <span class="emphasis"><em>R-Trees: A Dynamic Index Structure for Spatial
           Searching</em></span>
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.introduction.f1" href="#geometry_index.r_tree.introduction.f1" class="para">2</a>] </sup>
+<div id="ftn.geometry_index.r_tree.introduction.f1" class="footnote"><p>[2]
           Greene, D. (1989). <span class="emphasis"><em>An implementation and performance analysis
           of spatial data access methods</em></span>
         </p></div>
-<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.introduction.f2" href="#geometry_index.r_tree.introduction.f2" class="para">3</a>] </sup>
+<div id="ftn.geometry_index.r_tree.introduction.f2" class="footnote"><p>[3]
           Beckmann, N.; Kriegel, H. P.; Schneider, R.; Seeger, B. (1990). <span class="emphasis"><em>The
           R*-tree: an efficient and robust access method for points and rectangles</em></span>
         </p></div>

Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/nearest_neighbours_queries.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/nearest_neighbours_queries.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/nearest_neighbours_queries.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 <title>Nearest neighbours queries</title>
 <link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="up" href="../r_tree.html" title="R-tree">
 <link rel="prev" href="spatial_queries.html" title="Spatial queries">

Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/rtree_quickstart.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/rtree_quickstart.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/rtree_quickstart.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 <title>Quick Start</title>
 <link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="up" href="../r_tree.html" title="R-tree">
 <link rel="prev" href="introduction.html" title="Introduction">
@@ -150,7 +150,7 @@
       </p>
 <h4>
 <a name="geometry_index.r_tree.rtree_quickstart.h0"></a>
- <span><a name="geometry_index.r_tree.rtree_quickstart.more"></a></span><a class="link" href="rtree_quickstart.html#geometry_index.r_tree.rtree_quickstart.more">More</a>
+ <span class="phrase"><a name="geometry_index.r_tree.rtree_quickstart.more"></a></span><a class="link" href="rtree_quickstart.html#geometry_index.r_tree.rtree_quickstart.more">More</a>
       </h4>
 <p>
         More information about the R-tree implementation, other algorithms and queries

Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/spatial_queries.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/spatial_queries.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/spatial_queries.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 <title>Spatial queries</title>
 <link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
 <link rel="up" href="../r_tree.html" title="R-tree">
 <link rel="prev" href="creation_and_modification.html" title="Creation and modification">

Modified: sandbox-branches/geometry/index_dev/doc/html/index.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/index.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/index.html 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -56,7 +56,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: November 26, 2012 at 16:32:21 GMT</small></p></td>
+<td align="left"><p><small>Last revised: November 26, 2012 at 17:31:48 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox-branches/geometry/index_dev/doc/rtree/creation.qbk
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/rtree/creation.qbk (original)
+++ sandbox-branches/geometry/index_dev/doc/rtree/creation.qbk 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -29,18 +29,19 @@
 __rtree__ may store `__value__`s of any type as long the `__translator__` knows how to interpret those `__value__`s
 and extract an object that the __rtree__ can handle. Those objects are called
 `__indexable__`s in this documentation. Each type adapted to `__point__` or `__box__` concept is an `__indexable__`.
-Default `__translator__` `index::translator::def<__value__>`
-is able to handle `__point__`, `__box__` or `std::pair<...>` `__value__`s.
+`__value__`s types which can be handled by the default `__translator__` - `index::translator::def<__value__>`
+are defined as follows:
 
 * `__indexable__ = __point__ | __box__`
-* `__value__ = Indexable | std::pair<__indexable__, T>`
+* `__value__ = Indexable | std::pair<__indexable__, T> | boost::tuple<__indexable__, ...>`
 
 Examples of default `__value__` types:
 
  geometry::model::point<...>
  geometry::model::point_xy<...>
  geometry::model::box<...>
- std::pair<geometry::model::box<...>, size_t>
+ std::pair<geometry::model::box<...>, unsigned>
+ boost::tuple<geometry::model::point<...>, int, float>
 
 A `__translator__` is a type which knows how to handle `__value__`s. It has two purposes:
 

Modified: sandbox-branches/geometry/index_dev/test/rtree/test_rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/test/rtree/test_rtree.hpp (original)
+++ sandbox-branches/geometry/index_dev/test/rtree/test_rtree.hpp 2012-11-26 12:36:20 EST (Mon, 26 Nov 2012)
@@ -98,6 +98,29 @@
 };
 
 template <typename T, typename C>
+struct generate_value< boost::tuple<bg::model::point<T, 2, C>, int, int> >
+{
+ typedef bg::model::point<T, 2, C> P;
+ typedef boost::tuple<P, int, int> R;
+ static R apply(int x, int y)
+ {
+ return boost::make_tuple(P(x, y), x + y * 100, 0);
+ }
+};
+
+template <typename T, typename C>
+struct generate_value< boost::tuple<bg::model::box< bg::model::point<T, 2, C> >, int, int> >
+{
+ typedef bg::model::point<T, 2, C> P;
+ typedef bg::model::box<P> B;
+ typedef boost::tuple<B, int, int> R;
+ static R apply(int x, int y)
+ {
+ return boost::make_tuple(B(P(x, y), P(x + 2, y + 3)), x + y * 100, 0);
+ }
+};
+
+template <typename T, typename C>
 struct generate_value< bg::model::point<T, 3, C> >
 {
     typedef bg::model::point<T, 3, C> P;
@@ -141,6 +164,29 @@
     }
 };
 
+template <typename T, typename C>
+struct generate_value< boost::tuple<bg::model::point<T, 3, C>, int, int> >
+{
+ typedef bg::model::point<T, 3, C> P;
+ typedef boost::tuple<P, int, int> R;
+ static R apply(int x, int y, int z)
+ {
+ return boost::make_tuple(P(x, y, z), x + y * 100 + z * 10000, 0);
+ }
+};
+
+template <typename T, typename C>
+struct generate_value< boost::tuple<bg::model::box< bg::model::point<T, 3, C> >, int, int> >
+{
+ typedef bg::model::point<T, 3, C> P;
+ typedef bg::model::box<P> B;
+ typedef boost::tuple<B, int, int> R;
+ static R apply(int x, int y, int z)
+ {
+ return boost::make_tuple(B(P(x, y, z), P(x + 2, y + 3, z + 4)), x + y * 100 + z * 10000, 0);
+ }
+};
+
 template <size_t Dimension>
 struct generate_input
 {};
@@ -818,11 +864,15 @@
     typedef bg::model::box<Point> Box;
     typedef std::pair<Box, int> PairB;
     typedef std::pair<Point, int> PairP;
+ typedef boost::tuple<Point, int, int> TupleP;
+ typedef boost::tuple<Box, int, int> TupleB;
 
     test_rtree_by_value<Point, Parameters>(parameters);
     test_rtree_by_value<Box, Parameters>(parameters);
     test_rtree_by_value<PairB, Parameters>(parameters);
     test_rtree_by_value<PairP, Parameters>(parameters);
+ test_rtree_by_value<TupleP, Parameters>(parameters);
+ test_rtree_by_value<TupleB, Parameters>(parameters);
 }
 
 #endif


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