mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-10 23:42:12 +00:00
rtree: allocator_traits used in ctor and operator= (e.g. propagate_XXX or select_XXX),
index::swap() added, query_range operator| generator moved to index::detail, docs updated. [SVN r83019]
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
[[[link group__rtree__functions_1gaec0b88a9d8b408753e3069134f1598c7 `size(rtree<...> const &)`]][Get the number of values stored in the index. ]]
|
||||
[[[link group__rtree__functions_1ga459e3d404fec7cbd66794714cbdd129e `empty(rtree<...> const &)`]][Query if there are no values stored in the index. ]]
|
||||
[[[link group__rtree__functions_1gadb11fdb8e75ba7652286ec6750b49c4f `bounds(rtree<...> const &)`]][Get the box containing all stored values or an invalid box if the index has no values. ]]
|
||||
[[[link group__rtree__functions_1ga043d21dc24c57fcabc5ee85093eb8b15 `swap(rtree<...> &, rtree<...> &)`]][Exchanges the contents of the container with those of other. ]]
|
||||
]
|
||||
|
||||
[#group__rtree__functions_1gac0ac9ed0e01f7494a5a3059e75d3c5cc]
|
||||
@@ -346,5 +347,27 @@ It calls [^`rtree::envelope()`].[heading Synopsis]
|
||||
The box containing all stored values or an invalid box.
|
||||
[endsect]
|
||||
|
||||
[#group__rtree__functions_1ga043d21dc24c57fcabc5ee85093eb8b15]
|
||||
[section swap(rtree<...> &, rtree<...> &)]
|
||||
Exchanges the contents of the container with those of other.
|
||||
|
||||
[heading Description]
|
||||
It calls [^[link classboost_1_1geometry_1_1index_1_1rtree_1aad0285d25f96341a8dd6cc22feb3bd73 rtree::swap()]].[heading Synopsis]
|
||||
[pre
|
||||
`template<``typename Value``,`
|
||||
`typename Options``,`
|
||||
`typename Translator``,`
|
||||
`typename Allocator``>`
|
||||
`void boost::geometry::index::swap``(``rtree< Value, Options, Translator, Allocator > &` `l``,` `rtree< Value, Options, Translator, Allocator > &` `r``)`
|
||||
]
|
||||
|
||||
[heading Parameter(s)]
|
||||
[table
|
||||
[[Type][Name][Description]]
|
||||
[[`rtree< Value, Options, Translator, Allocator > &`][ `l` ][The first rtree. ]]
|
||||
[[`rtree< Value, Options, Translator, Allocator > &`][ `r` ][The second rtree. ]]
|
||||
]
|
||||
[endsect]
|
||||
|
||||
[endsect]
|
||||
|
||||
|
||||
@@ -214,7 +214,8 @@
|
||||
<span class="phrase"><a name="geometry_index.r_tree.introduction.dependencies"></a></span><a class="link" href="introduction.html#geometry_index.r_tree.introduction.dependencies">Dependencies</a>
|
||||
</h5>
|
||||
<p>
|
||||
R-tree depends on <span class="bold"><strong>Boost.Move</strong></span>, <span class="bold"><strong>Boost.Container</strong></span>, <span class="bold"><strong>Boost.Tuple</strong></span>.
|
||||
R-tree depends on <span class="bold"><strong>Boost.Move</strong></span>, <span class="bold"><strong>Boost.Container</strong></span>, <span class="bold"><strong>Boost.Tuple</strong></span>,
|
||||
<span class="bold"><strong>Boost.Utility</strong></span>, <span class="bold"><strong>Boost.MPL</strong></span>.
|
||||
</p>
|
||||
<h5>
|
||||
<a name="geometry_index.r_tree.introduction.h2"></a>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<a name="geometry_index.r_tree.reference.boost_geometry_index_rtree"></a><a name="classboost_1_1geometry_1_1index_1_1rtree"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.boost_geometry_index_rtree" title="boost::geometry::index::rtree">boost::geometry::index::rtree</a>
|
||||
</h4></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id931478"></a><a class="indexterm" name="id931483"></a><a class="indexterm" name="id931488"></a><a class="indexterm" name="id931493"></a>
|
||||
<a class="indexterm" name="id889982"></a><a class="indexterm" name="id889986"></a><a class="indexterm" name="id889991"></a><a class="indexterm" name="id889996"></a>
|
||||
The R-tree spatial index.
|
||||
</p>
|
||||
<h6>
|
||||
@@ -3268,6 +3268,19 @@ The R-tree spatial index.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<a class="link" href="reference.html#group__rtree__functions_1ga043d21dc24c57fcabc5ee85093eb8b15"><code class="computeroutput"><span class="identifier">swap</span><span class="special">(</span><span class="identifier">rtree</span><span class="special"><...></span>
|
||||
<span class="special">&,</span> <span class="identifier">rtree</span><span class="special"><...></span> <span class="special">&)</span></code></a>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Exchanges the contents of the container with those of other.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
<div class="section">
|
||||
@@ -4492,6 +4505,106 @@ The R-tree spatial index.
|
||||
The box containing all stored values or an invalid box.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h5 class="title">
|
||||
<a name="geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________"></a><a name="group__rtree__functions_1ga043d21dc24c57fcabc5ee85093eb8b15"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________" title="swap(rtree<...> &, rtree<...> &)">swap(rtree<...>
|
||||
&, rtree<...> &)</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
Exchanges the contents of the container with those of other.
|
||||
</p>
|
||||
<h6>
|
||||
<a name="geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.h0"></a>
|
||||
<span class="phrase"><a name="geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.description"></a></span><a class="link" href="reference.html#geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.description">Description</a>
|
||||
</h6>
|
||||
<p>
|
||||
It calls <code class="literal"><a class="link" href="reference.html#classboost_1_1geometry_1_1index_1_1rtree_1aad0285d25f96341a8dd6cc22feb3bd73">rtree::swap()</a></code>.
|
||||
</p>
|
||||
<h6>
|
||||
<a name="geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.h1"></a>
|
||||
<span class="phrase"><a name="geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.synopsis"></a></span><a class="link" href="reference.html#geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.synopsis">Synopsis</a>
|
||||
</h6>
|
||||
<pre class="programlisting"><code class="computeroutput"><span class="keyword">template</span><span class="special"><</span></code><code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">Value</span></code><code class="computeroutput"><span class="special">,</span></code>
|
||||
<code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">Options</span></code><code class="computeroutput"><span class="special">,</span></code>
|
||||
<code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">Translator</span></code><code class="computeroutput"><span class="special">,</span></code>
|
||||
<code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">Allocator</span></code><code class="computeroutput"><span class="special">></span></code>
|
||||
<code class="computeroutput"><span class="keyword">void</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">swap</span></code><code class="computeroutput"><span class="special">(</span></code><code class="computeroutput"><span class="identifier">rtree</span><span class="special"><</span> <span class="identifier">Value</span><span class="special">,</span> <span class="identifier">Options</span><span class="special">,</span> <span class="identifier">Translator</span><span class="special">,</span> <span class="identifier">Allocator</span> <span class="special">></span> <span class="special">&</span></code> <code class="computeroutput"><span class="identifier">l</span></code><code class="computeroutput"><span class="special">,</span></code> <code class="computeroutput"><span class="identifier">rtree</span><span class="special"><</span> <span class="identifier">Value</span><span class="special">,</span> <span class="identifier">Options</span><span class="special">,</span> <span class="identifier">Translator</span><span class="special">,</span> <span class="identifier">Allocator</span> <span class="special">></span> <span class="special">&</span></code> <code class="computeroutput"><span class="identifier">r</span></code><code class="computeroutput"><span class="special">)</span></code>
|
||||
</pre>
|
||||
<h6>
|
||||
<a name="geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.h2"></a>
|
||||
<span class="phrase"><a name="geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.parameter_s_"></a></span><a class="link" href="reference.html#geometry_index.r_tree.reference.group__rtree__functions.swap_rtree_________rtree________.parameter_s_">Parameter(s)</a>
|
||||
</h6>
|
||||
<div class="informaltable"><table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>
|
||||
<p>
|
||||
Type
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
Name
|
||||
</p>
|
||||
</th>
|
||||
<th>
|
||||
<p>
|
||||
Description
|
||||
</p>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">rtree</span><span class="special"><</span>
|
||||
<span class="identifier">Value</span><span class="special">,</span>
|
||||
<span class="identifier">Options</span><span class="special">,</span>
|
||||
<span class="identifier">Translator</span><span class="special">,</span>
|
||||
<span class="identifier">Allocator</span> <span class="special">></span>
|
||||
<span class="special">&</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">l</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The first rtree.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">rtree</span><span class="special"><</span>
|
||||
<span class="identifier">Value</span><span class="special">,</span>
|
||||
<span class="identifier">Options</span><span class="special">,</span>
|
||||
<span class="identifier">Translator</span><span class="special">,</span>
|
||||
<span class="identifier">Allocator</span> <span class="special">></span>
|
||||
<span class="special">&</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">r</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The second rtree.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
@@ -4503,7 +4616,7 @@ The R-tree spatial index.
|
||||
<a name="geometry_index.r_tree.reference.parameters.boost_geometry_index_linear"></a><a name="structboost_1_1geometry_1_1index_1_1linear"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.parameters.boost_geometry_index_linear" title="boost::geometry::index::linear">boost::geometry::index::linear</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id960605"></a><a class="indexterm" name="id960610"></a><a class="indexterm" name="id960615"></a><a class="indexterm" name="id960620"></a>
|
||||
<a class="indexterm" name="id919561"></a><a class="indexterm" name="id919566"></a><a class="indexterm" name="id919571"></a><a class="indexterm" name="id919576"></a>
|
||||
Linear r-tree creation algorithm parameters.
|
||||
</p>
|
||||
<h6>
|
||||
@@ -4578,7 +4691,7 @@ Linear r-tree creation algorithm parameters.
|
||||
<a name="geometry_index.r_tree.reference.parameters.boost_geometry_index_quadratic"></a><a name="structboost_1_1geometry_1_1index_1_1quadratic"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.parameters.boost_geometry_index_quadratic" title="boost::geometry::index::quadratic">boost::geometry::index::quadratic</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id960914"></a><a class="indexterm" name="id960918"></a><a class="indexterm" name="id960923"></a><a class="indexterm" name="id960928"></a>
|
||||
<a class="indexterm" name="id919870"></a><a class="indexterm" name="id919874"></a><a class="indexterm" name="id919879"></a><a class="indexterm" name="id919884"></a>
|
||||
Quadratic r-tree creation algorithm parameters.
|
||||
</p>
|
||||
<h6>
|
||||
@@ -4653,7 +4766,7 @@ Quadratic r-tree creation algorithm parameters.
|
||||
<a name="geometry_index.r_tree.reference.parameters.boost_geometry_index_rstar"></a><a name="structboost_1_1geometry_1_1index_1_1rstar"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.parameters.boost_geometry_index_rstar" title="boost::geometry::index::rstar">boost::geometry::index::rstar</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id961222"></a><a class="indexterm" name="id961227"></a><a class="indexterm" name="id961232"></a><a class="indexterm" name="id961236"></a>
|
||||
<a class="indexterm" name="id920178"></a><a class="indexterm" name="id920183"></a><a class="indexterm" name="id920188"></a><a class="indexterm" name="id920192"></a>
|
||||
R*-tree creation algorithm parameters.
|
||||
</p>
|
||||
<h6>
|
||||
@@ -4757,7 +4870,7 @@ R*-tree creation algorithm parameters.
|
||||
<a name="geometry_index.r_tree.reference.parameters.boost_geometry_index_runtime_linear"></a><a name="classboost_1_1geometry_1_1index_1_1runtime_1_1linear"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.parameters.boost_geometry_index_runtime_linear" title="boost::geometry::index::runtime::linear">boost::geometry::index::runtime::linear</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id961656"></a><a class="indexterm" name="id961661"></a><a class="indexterm" name="id961666"></a><a class="indexterm" name="id961671"></a><a class="indexterm" name="id961676"></a>
|
||||
<a class="indexterm" name="id920612"></a><a class="indexterm" name="id920617"></a><a class="indexterm" name="id920622"></a><a class="indexterm" name="id920627"></a><a class="indexterm" name="id920632"></a>
|
||||
Linear r-tree creation algorithm parameters.
|
||||
</p>
|
||||
<h6>
|
||||
@@ -4893,7 +5006,7 @@ Linear r-tree creation algorithm parameters.
|
||||
<a name="geometry_index.r_tree.reference.parameters.boost_geometry_index_runtime_quadratic"></a><a name="classboost_1_1geometry_1_1index_1_1runtime_1_1quadratic"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.parameters.boost_geometry_index_runtime_quadratic" title="boost::geometry::index::runtime::quadratic">boost::geometry::index::runtime::quadratic</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id962134"></a><a class="indexterm" name="id962139"></a><a class="indexterm" name="id962144"></a><a class="indexterm" name="id962148"></a><a class="indexterm" name="id962153"></a>
|
||||
<a class="indexterm" name="id921090"></a><a class="indexterm" name="id921305"></a><a class="indexterm" name="id921310"></a><a class="indexterm" name="id921314"></a><a class="indexterm" name="id921319"></a>
|
||||
Quadratic r-tree creation algorithm parameters.
|
||||
</p>
|
||||
<h6>
|
||||
@@ -5029,7 +5142,7 @@ Quadratic r-tree creation algorithm parameters.
|
||||
<a name="geometry_index.r_tree.reference.parameters.boost_geometry_index_runtime_rstar"></a><a name="classboost_1_1geometry_1_1index_1_1runtime_1_1rstar"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.parameters.boost_geometry_index_runtime_rstar" title="boost::geometry::index::runtime::rstar">boost::geometry::index::runtime::rstar</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id962612"></a><a class="indexterm" name="id962616"></a><a class="indexterm" name="id962621"></a><a class="indexterm" name="id962626"></a><a class="indexterm" name="id962631"></a>
|
||||
<a class="indexterm" name="id921778"></a><a class="indexterm" name="id921782"></a><a class="indexterm" name="id921787"></a><a class="indexterm" name="id921792"></a><a class="indexterm" name="id921797"></a>
|
||||
R*-tree creation algorithm parameters.
|
||||
</p>
|
||||
<h6>
|
||||
@@ -6609,7 +6722,7 @@ R*-tree creation algorithm parameters.
|
||||
<a name="geometry_index.r_tree.reference.translators.boost_geometry_index_translator_def"></a><a name="structboost_1_1geometry_1_1index_1_1translator_1_1def"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.translators.boost_geometry_index_translator_def" title="boost::geometry::index::translator::def">boost::geometry::index::translator::def</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id971279"></a><a class="indexterm" name="id971284"></a><a class="indexterm" name="id971288"></a><a class="indexterm" name="id971293"></a><a class="indexterm" name="id971298"></a>
|
||||
<a class="indexterm" name="id930098"></a><a class="indexterm" name="id930103"></a><a class="indexterm" name="id930108"></a><a class="indexterm" name="id930113"></a><a class="indexterm" name="id930118"></a>
|
||||
The default translator.
|
||||
</p>
|
||||
<h6>
|
||||
@@ -6679,7 +6792,7 @@ The default translator.
|
||||
<a name="geometry_index.r_tree.reference.translators.boost_geometry_index_translator_index"></a><a name="classboost_1_1geometry_1_1index_1_1translator_1_1index"></a><a class="link" href="reference.html#geometry_index.r_tree.reference.translators.boost_geometry_index_translator_index" title="boost::geometry::index::translator::index">boost::geometry::index::translator::index</a>
|
||||
</h5></div></div></div>
|
||||
<p>
|
||||
<a class="indexterm" name="id971562"></a><a class="indexterm" name="id971567"></a><a class="indexterm" name="id971572"></a><a class="indexterm" name="id971576"></a><a class="indexterm" name="id971581"></a>
|
||||
<a class="indexterm" name="id930382"></a><a class="indexterm" name="id930386"></a><a class="indexterm" name="id930391"></a><a class="indexterm" name="id930396"></a><a class="indexterm" name="id930401"></a>
|
||||
The index translator.
|
||||
</p>
|
||||
<h6>
|
||||
|
||||
@@ -51,7 +51,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: February 17, 2013 at 14:52:29 GMT</small></p></td>
|
||||
<td align="left"><p><small>Last revised: February 19, 2013 at 19:29:30 GMT</small></p></td>
|
||||
<td align="right"><div class="copyright-footer"></div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
@@ -57,7 +57,7 @@ Key features of this implementation of the __rtree__ are:
|
||||
|
||||
[heading Dependencies]
|
||||
|
||||
R-tree depends on *Boost.Move*, *Boost.Container*, *Boost.Tuple*.
|
||||
R-tree depends on *Boost.Move*, *Boost.Container*, *Boost.Tuple*, *Boost.Utility*, *Boost.MPL*.
|
||||
|
||||
[heading Contributors]
|
||||
|
||||
|
||||
@@ -56,6 +56,15 @@ struct query
|
||||
Predicates const& predicates;
|
||||
};
|
||||
|
||||
template<typename Index, typename Predicates>
|
||||
index::adaptors::detail::query_range<Index>
|
||||
operator|(
|
||||
Index const& si,
|
||||
index::adaptors::detail::query<Predicates> const& f)
|
||||
{
|
||||
return index::adaptors::detail::query_range<Index>(si, f.predicates);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/*!
|
||||
@@ -74,15 +83,6 @@ queried(Predicates const& pred)
|
||||
|
||||
} // namespace adaptors
|
||||
|
||||
template<typename Index, typename Predicates>
|
||||
index::adaptors::detail::query_range<Index>
|
||||
operator|(
|
||||
Index const& si,
|
||||
index::adaptors::detail::query<Predicates> const& f)
|
||||
{
|
||||
return index::adaptors::detail::query_range<Index>(si, f.predicates);
|
||||
}
|
||||
|
||||
}}} // namespace boost::geometry::index
|
||||
|
||||
#endif // BOOST_GEOMETRY_INDEX_ADAPTORS_QUERY_HPP
|
||||
|
||||
@@ -133,6 +133,7 @@ private:
|
||||
typedef typename detail::rtree::leaf<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type leaf;
|
||||
|
||||
typedef typename allocators_type::node_pointer node_pointer;
|
||||
typedef ::boost::container::allocator_traits<Allocator> allocator_traits_type;
|
||||
|
||||
public:
|
||||
|
||||
@@ -256,9 +257,10 @@ public:
|
||||
\li When memory allocation for Node fails.
|
||||
*/
|
||||
inline rtree(rtree const& src)
|
||||
: m_members(src.m_members.translator(), src.m_members.parameters(), src.m_members.allocators())
|
||||
: m_members(src.m_members.translator(),
|
||||
src.m_members.parameters(),
|
||||
allocator_traits_type::select_on_container_copy_construction(src.get_allocator()))
|
||||
{
|
||||
//TODO use Boost.Container allocator_traits_type::select_on_container_copy_construction()
|
||||
this->raw_copy(src, *this, false);
|
||||
}
|
||||
|
||||
@@ -350,7 +352,12 @@ public:
|
||||
if ( this == &src )
|
||||
return *this;
|
||||
|
||||
//TODO use Boost.Container allocator_traits_type::propagate_on_container_move_assignment
|
||||
typedef boost::mpl::bool_<
|
||||
allocator_traits_type::propagate_on_container_copy_assignment::value
|
||||
> propagate;
|
||||
if ( propagate::value && !(m_members.allocators() == src.m_members.allocators()) )
|
||||
this->raw_destroy(*this);
|
||||
assign_cond(m_members.allocators(), src.m_members.allocators(), propagate());
|
||||
|
||||
// It uses m_allocators
|
||||
this->raw_copy(src, *this, true);
|
||||
@@ -376,21 +383,25 @@ public:
|
||||
if ( this == &src )
|
||||
return *this;
|
||||
|
||||
//TODO use Boost.Container allocator_traits_type::propagate_on_container_move_assignment
|
||||
|
||||
if ( m_members.allocators() == src.m_members.allocators() )
|
||||
{
|
||||
m_members.translator() = src.m_members.translator();
|
||||
m_members.parameters() = src.m_members.parameters();
|
||||
|
||||
this->raw_destroy(*this);
|
||||
|
||||
m_members.translator() = src.m_members.translator();
|
||||
m_members.parameters() = src.m_members.parameters();
|
||||
boost::swap(m_members.values_count, src.m_members.values_count);
|
||||
boost::swap(m_members.leafs_level, src.m_members.leafs_level);
|
||||
boost::swap(m_members.root, src.m_members.root);
|
||||
|
||||
typedef boost::mpl::bool_<
|
||||
allocator_traits_type::propagate_on_container_move_assignment::value
|
||||
> propagate;
|
||||
rtree::move_cond(m_members.allocators(), src.m_members.allocators(), propagate());
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO - shouldn't here propagate_on_container_copy_assignment be checked like in operator=(const&)?
|
||||
|
||||
// It uses m_allocators
|
||||
this->raw_copy(src, *this, true);
|
||||
}
|
||||
@@ -947,12 +958,12 @@ private:
|
||||
|
||||
\param src The source R-tree.
|
||||
\param dst The destination R-tree.
|
||||
\param copy_all_internals If true, translator and parameters will also be copied.
|
||||
\param copy_tr_and_params If true, translator and parameters will also be copied.
|
||||
|
||||
\par Exception-safety
|
||||
strong
|
||||
*/
|
||||
inline void raw_copy(rtree const& src, rtree & dst, bool copy_all_internals) const
|
||||
inline void raw_copy(rtree const& src, rtree & dst, bool copy_tr_and_params) const
|
||||
{
|
||||
detail::rtree::visitors::copy<value_type, options_type, translator_type, box_type, allocators_type>
|
||||
copy_v(dst.m_members.allocators());
|
||||
@@ -960,7 +971,7 @@ private:
|
||||
if ( src.m_members.root )
|
||||
detail::rtree::apply_visitor(copy_v, *src.m_members.root); // MAY THROW (V, E: alloc, copy, N: alloc)
|
||||
|
||||
if ( copy_all_internals )
|
||||
if ( copy_tr_and_params )
|
||||
{
|
||||
dst.m_members.translator() = src.m_members.translator(); // SHOULDN'T THROW
|
||||
dst.m_members.parameters() = src.m_members.parameters();
|
||||
@@ -1049,6 +1060,18 @@ private:
|
||||
return result.finish();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static inline void assign_cond(T &, T const&, boost::mpl::bool_<false> const&) {}
|
||||
|
||||
template<class T>
|
||||
static inline void assign_cond(T & l, T const& r, boost::mpl::bool_<true> const&) { l = r; }
|
||||
|
||||
template<class T>
|
||||
inline void move_cond(T &, T &, boost::mpl::bool_<false> const&) {}
|
||||
|
||||
template<class T>
|
||||
inline void move_cond(T & l, T & r, boost::mpl::bool_<true> const&) { l = ::boost::move(r); }
|
||||
|
||||
struct members_holder
|
||||
: public translator_type
|
||||
, public Parameters
|
||||
@@ -1359,6 +1382,22 @@ bounds(rtree<Value, Options, Translator, Allocator> const& tree)
|
||||
return tree.bounds();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Exchanges the contents of the container with those of other.
|
||||
|
||||
It calls \c rtree::swap().
|
||||
|
||||
\ingroup rtree_functions
|
||||
|
||||
\param l The first rtree.
|
||||
\param r The second rtree.
|
||||
*/
|
||||
template <typename Value, typename Options, typename Translator, typename Allocator>
|
||||
inline void swap(rtree<Value, Options, Translator, Allocator> & l, rtree<Value, Options, Translator, Allocator> & r)
|
||||
{
|
||||
return l.swap(r);
|
||||
}
|
||||
|
||||
}}} // namespace boost::geometry::index
|
||||
|
||||
#include <boost/geometry/index/detail/config_end.hpp>
|
||||
|
||||
Reference in New Issue
Block a user