...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This is self-balancing spatial index capable to store various types of Values and balancing algorithms.
The user must pass a type defining the Parameters which will be used in rtree creation process. This type is used e.g. to specify balancing algorithm with specific parameters like min and max number of elements in node.
Predefined algorithms with compile-time parameters are:
Predefined algorithms with run-time parameters are:
The object of IndexableGetter type translates from Value to Indexable each
time r-tree requires it. This means that this operation is done for each
Value access. Therefore the IndexableGetter should return the Indexable
by a reference type. The Indexable should not be calculated since it could
harm the performance. The default IndexableGetter can translate all types
adapted to Point, Box or Segment concepts (called Indexables). Furthermore,
it can handle
,
std::pair<Indexable, T>
and boost::tuple<Indexable,
...>
when possible.
For example, for Value of type std::tuple<Indexable,
...>
,
the default IndexableGetter translates from std::pair<Box, int>
to std::pair<Box, int>
const&
.
Box const&
The object of EqualTo type compares Values and returns
if they are equal. It's similar
to true
.
The default EqualTo returns the result of std::equal_to<>
for types adapted to some Geometry
concept defined in Boost.Geometry and the result of boost::geometry::equals()
for other types. Components of Pairs and Tuples are compared left-to-right.
operator==
#include <boost/geometry/index/rtree.hpp>
template<
typename Value
,
typename Parameters
,
typename IndexableGetter
=index::indexable
<Value>
,
typename EqualTo
=index::equal_to
<Value>
,
typename Allocator
=boost::container::new_allocator<Value>
>
class rtree
{
// ...
};
Parameter |
Description |
---|---|
|
The type of objects stored in the container. |
|
Compile-time parameters. |
|
The function object extracting Indexable from Value. |
|
The function object comparing objects of type Value. |
|
The allocator used to allocate/deallocate memory, construct/destroy nodes and Values. |
Type |
Description |
---|---|
The type of Value stored in the container. |
|
R-tree parameters type. |
|
The function object extracting Indexable from Value. |
|
The function object comparing objects of type Value. |
|
The type of allocator used by the container. |
|
The Indexable type to which Value is translated. |
|
The Box type used by the R-tree. |
|
Type of reference to Value. |
|
Type of reference to const Value. |
|
Type of pointer to Value. |
|
Type of pointer to const Value. |
|
Type of difference type. |
|
Unsigned integral type used by the container. |
|
Type of const iterator, category ForwardIterator. |
|
Type of const query iterator, category ForwardIterator. |
Function |
Description |
---|---|
The constructor. |
|
The constructor. |
|
The constructor. |
|
The constructor. |
|
The constructor. |
|
The constructor. |
|
The constructor. |
|
The constructor. |
|
|
The constructor. |
|
The constructor. |
The destructor. |
|
The copy constructor. |
|
The copy constructor. |
|
The moving constructor. |
|
The moving constructor. |
Modifier |
Function |
Description |
---|---|---|
The assignment operator. |
||
The moving assignment. |
||
Swaps contents of two rtrees. |
||
Insert a value to the index. |
||
Insert a range of values to the index. |
||
Insert a value created using convertible object or a range of values to the index. |
||
Remove a value from the container. |
||
Remove a range of values from the container. |
||
Remove value corresponding to an object convertible to it or a range of values from the container. |
||
|
Finds values meeting passed predicates e.g. nearest to some Point and/or intersecting some Box. |
|
|
Returns a query iterator pointing at the begin of the query range. |
|
|
Returns a query iterator pointing at the end of the query range. |
|
|
Returns the iterator pointing at the begin of the rtree values range. |
|
|
Returns the iterator pointing at the end of the rtree values range. |
|
|
Returns the number of stored values. |
|
|
Query if the container is empty. |
|
Removes all values stored in the container. |
||
|
Returns the box able to contain all values stored in the container. |
|
|
Count Values or Indexables stored in the container. |
|
|
Returns parameters. |
|
|
Returns function retrieving Indexable from Value. |
|
|
Returns function comparing Values. |
|
|
Returns allocator used by the rtree. |