Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator > Class Template Reference

The R-tree spatial index. More...

#include <rtree.hpp>

Public Types

typedef Value value_type
 The type of Value stored in the container. More...
 
typedef Parameters parameters_type
 R-tree parameters type. More...
 
typedef IndexableGetter indexable_getter
 The function object extracting Indexable from Value. More...
 
typedef EqualTo value_equal
 The function object comparing objects of type Value. More...
 
typedef Allocator allocator_type
 The type of allocator used by the container. More...
 
typedef
index::detail::indexable_type
< detail::translator
< IndexableGetter, EqualTo >
>::type 
indexable_type
 The Indexable type to which Value is translated. More...
 
typedef geometry::model::box
< geometry::model::point
< typename coordinate_type
< indexable_type >::type,
dimension< indexable_type >
::value, typename
coordinate_system
< indexable_type >::type > > 
bounds_type
 The Box type used by the R-tree. More...
 
typedef allocators_type::reference reference
 Type of reference to Value. More...
 
typedef
allocators_type::const_reference 
const_reference
 Type of reference to const Value. More...
 
typedef allocators_type::pointer pointer
 Type of pointer to Value. More...
 
typedef
allocators_type::const_pointer 
const_pointer
 Type of pointer to const Value. More...
 
typedef
allocators_type::difference_type 
difference_type
 Type of difference type. More...
 
typedef allocators_type::size_type size_type
 Unsigned integral type used by the container. More...
 
typedef
index::detail::rtree::iterators::query_iterator
< value_type, allocators_type > 
const_query_iterator
 Type of const query iterator. More...
 

Public Member Functions

 rtree (parameters_type const &parameters=parameters_type(), indexable_getter const &getter=indexable_getter(), value_equal const &equal=value_equal())
 The constructor. More...
 
 rtree (parameters_type const &parameters, indexable_getter const &getter, value_equal const &equal, allocator_type const &allocator)
 The constructor. More...
 
template<typename Iterator >
 rtree (Iterator first, Iterator last, parameters_type const &parameters=parameters_type(), indexable_getter const &getter=indexable_getter(), value_equal const &equal=value_equal(), allocator_type const &allocator=allocator_type())
 The constructor. More...
 
template<typename Range >
 rtree (Range const &rng, parameters_type const &parameters=parameters_type(), indexable_getter const &getter=indexable_getter(), value_equal const &equal=value_equal(), allocator_type const &allocator=allocator_type())
 The constructor. More...
 
 ~rtree ()
 The destructor. More...
 
 rtree (rtree const &src)
 The copy constructor. More...
 
 rtree (rtree const &src, allocator_type const &allocator)
 The copy constructor. More...
 
 rtree (BOOST_RV_REF(rtree) src)
 The moving constructor. More...
 
 rtree (BOOST_RV_REF(rtree) src, allocator_type const &allocator)
 The moving constructor. More...
 
rtreeoperator= (BOOST_COPY_ASSIGN_REF(rtree) src)
 The assignment operator. More...
 
rtreeoperator= (BOOST_RV_REF(rtree) src)
 The moving assignment. More...
 
void swap (rtree &other)
 Swaps contents of two rtrees. More...
 
void insert (value_type const &value)
 Insert a value to the index. More...
 
template<typename Iterator >
void insert (Iterator first, Iterator last)
 Insert a range of values to the index. More...
 
template<typename ConvertibleOrRange >
void insert (ConvertibleOrRange const &conv_or_rng)
 Insert a value created using convertible object or a range of values to the index. More...
 
size_type remove (value_type const &value)
 Remove a value from the container. More...
 
template<typename Iterator >
size_type remove (Iterator first, Iterator last)
 Remove a range of values from the container. More...
 
template<typename ConvertibleOrRange >
size_type remove (ConvertibleOrRange const &conv_or_rng)
 Remove value corresponding to an object convertible to it or a range of values from the container. More...
 
template<typename Predicates , typename OutIter >
size_type query (Predicates const &predicates, OutIter out_it) const
 Finds values meeting passed predicates e.g. More...
 
template<typename Predicates >
const_query_iterator qbegin (Predicates const &predicates) const
 Returns the query iterator pointing at the begin of the query range. More...
 
const_query_iterator qend () const
 Returns the query iterator pointing at the end of the query range. More...
 
size_type size () const
 Returns the number of stored values. More...
 
bool empty () const
 Query if the container is empty. More...
 
void clear ()
 Removes all values stored in the container. More...
 
bounds_type bounds () const
 Returns the box able to contain all values stored in the container. More...
 
template<typename ValueOrIndexable >
size_type count (ValueOrIndexable const &vori) const
 Count Values or Indexables stored in the container. More...
 
parameters_type parameters () const
 Returns parameters. More...
 
indexable_getter indexable_get () const
 Returns function retrieving Indexable from Value. More...
 
value_equal value_eq () const
 Returns function comparing Values. More...
 
allocator_type get_allocator () const
 Returns allocator used by the rtree. More...
 

Friends

class detail::rtree::utilities::view< rtree >
 

Detailed Description

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
class boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >

The R-tree spatial index.

This is self-balancing spatial index capable to store various types of Values and balancing algorithms.

Parameters
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:
IndexableGetter
The object of IndexableGetter type translates from Value to Indexable each time r-tree requires it. Which means that this operation is done for each Value access. Therefore the IndexableGetter should return the Indexable by const reference instead of a value. Default one can translate all types adapted to Point, Box or Segment concepts (called Indexables). It also handles std::pair<Indexable, T> and boost::tuple<Indexable, ...>. For example, if std::pair<Box, int> is stored in the container, the default IndexableGetter translates from std::pair<Box, int> const& to Box const&.
EqualTo
The object of EqualTo type compares Values and returns true if they're equal. It's similar to std::equal_to<>. The default EqualTo returns the result of boost::geometry::equals() for types adapted to some Geometry concept defined in Boost.Geometry and the result of operator= for other types. Components of Pairs and Tuples are compared left-to-right.
Template Parameters
ValueThe type of objects stored in the container.
ParametersCompile-time parameters.
IndexableGetterThe function object extracting Indexable from Value.
EqualToThe function object comparing objects of type Value.
AllocatorThe allocator used to allocate/deallocate memory, construct/destroy nodes and Values.

Member Typedef Documentation

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef Allocator boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::allocator_type

The type of allocator used by the container.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef geometry::model::box< geometry::model::point< typename coordinate_type<indexable_type>::type, dimension<indexable_type>::value, typename coordinate_system<indexable_type>::type > > boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::bounds_type

The Box type used by the R-tree.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef allocators_type::const_pointer boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::const_pointer

Type of pointer to const Value.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef index::detail::rtree::iterators::query_iterator<value_type, allocators_type> boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::const_query_iterator

Type of const query iterator.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef allocators_type::const_reference boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::const_reference

Type of reference to const Value.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef allocators_type::difference_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::difference_type

Type of difference type.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef IndexableGetter boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::indexable_getter

The function object extracting Indexable from Value.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef index::detail::indexable_type< detail::translator<IndexableGetter, EqualTo> >::type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::indexable_type

The Indexable type to which Value is translated.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef Parameters boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::parameters_type

R-tree parameters type.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef allocators_type::pointer boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::pointer

Type of pointer to Value.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef allocators_type::reference boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::reference

Type of reference to Value.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef allocators_type::size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::size_type

Unsigned integral type used by the container.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef EqualTo boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::value_equal

The function object comparing objects of type Value.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
typedef Value boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::value_type

The type of Value stored in the container.

Constructor & Destructor Documentation

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree ( parameters_type const &  parameters = parameters_type(),
indexable_getter const &  getter = indexable_getter(),
value_equal const &  equal = value_equal() 
)
inlineexplicit

The constructor.

Parameters
parametersThe parameters object.
getterThe function object extracting Indexable from Value.
equalThe function object comparing Values.
Throws
If allocator default constructor throws.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree ( parameters_type const &  parameters,
indexable_getter const &  getter,
value_equal const &  equal,
allocator_type const &  allocator 
)
inline

The constructor.

Parameters
parametersThe parameters object.
getterThe function object extracting Indexable from Value.
equalThe function object comparing Values.
allocatorThe allocator object.
Throws
If allocator copy constructor throws.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename Iterator >
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree ( Iterator  first,
Iterator  last,
parameters_type const &  parameters = parameters_type(),
indexable_getter const &  getter = indexable_getter(),
value_equal const &  equal = value_equal(),
allocator_type const &  allocator = allocator_type() 
)
inline

The constructor.

The tree is created using packing algorithm.

Parameters
firstThe beginning of the range of Values.
lastThe end of the range of Values.
parametersThe parameters object.
getterThe function object extracting Indexable from Value.
equalThe function object comparing Values.
allocatorThe allocator object.
Throws
  • If allocator copy constructor throws.
  • If Value copy constructor or copy assignment throws.
  • If allocation throws or returns invalid value.

References boost::polygon::ll().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename Range >
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree ( Range const &  rng,
parameters_type const &  parameters = parameters_type(),
indexable_getter const &  getter = indexable_getter(),
value_equal const &  equal = value_equal(),
allocator_type const &  allocator = allocator_type() 
)
inlineexplicit

The constructor.

The tree is created using packing algorithm.

Parameters
rngThe range of Values.
parametersThe parameters object.
getterThe function object extracting Indexable from Value.
equalThe function object comparing Values.
allocatorThe allocator object.
Throws
  • If allocator copy constructor throws.
  • If Value copy constructor or copy assignment throws.
  • If allocation throws or returns invalid value.

References boost::asio::begin, boost::end, and boost::polygon::ll().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::~rtree ( )
inline

The destructor.

Throws
Nothing.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree ( rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator > const &  src)
inline

The copy constructor.

It uses parameters, translator and allocator from the source tree.

Parameters
srcThe rtree which content will be copied.
Throws
  • If allocator copy constructor throws.
  • If Value copy constructor throws.
  • If allocation throws or returns invalid value.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree ( rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator > const &  src,
allocator_type const &  allocator 
)
inline

The copy constructor.

It uses Parameters and translator from the source tree.

Parameters
srcThe rtree which content will be copied.
allocatorThe allocator which will be used.
Throws
  • If allocator copy constructor throws.
  • If Value copy constructor throws.
  • If allocation throws or returns invalid value.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree ( BOOST_RV_REF(rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >)  src)
inline

The moving constructor.

It uses parameters, translator and allocator from the source tree.

Parameters
srcThe rtree which content will be moved.
Throws
Nothing.

References boost::swap.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree ( BOOST_RV_REF(rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >)  src,
allocator_type const &  allocator 
)
inline

The moving constructor.

It uses parameters and translator from the source tree.

Parameters
srcThe rtree which content will be moved.
allocatorThe allocator.
Throws
  • If allocator copy constructor throws.
  • If Value copy constructor throws (only if allocators aren't equal).
  • If allocation throws or returns invalid value (only if allocators aren't equal).

References boost::swap.

Member Function Documentation

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
bounds_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::bounds ( ) const
inline

Returns the box able to contain all values stored in the container.

Returns the box able to contain all values stored in the container. If the container is empty the result of geometry::assign_inverse() is returned.

Returns
The box able to contain all values stored in the container or an invalid box if there are no values in the container.
Throws
Nothing.

References boost::geometry::assign_inverse().

Referenced by boost::geometry::index::bounds(), and boost::geometry::index::empty().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::clear ( )
inline

Removes all values stored in the container.

Throws
Nothing.

Referenced by boost::geometry::index::clear().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename ValueOrIndexable >
size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::count ( ValueOrIndexable const &  vori) const
inline

Count Values or Indexables stored in the container.

For indexable_type it returns the number of values which indexables equals the parameter. For value_type it returns the number of values which equals the parameter.

Parameters
voriThe value or indexable which will be counted.
Returns
The number of values found.
Throws
Nothing.

References BOOST_MPL_ASSERT_MSG, boost::spirit::x3::int_, and boost::program_options::value().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
bool boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::empty ( ) const
inline

Query if the container is empty.

Returns
true if the container is empty.
Throws
Nothing.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
allocator_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::get_allocator ( ) const
inline

Returns allocator used by the rtree.

Returns
The allocator.
Throws
If allocator copy constructor throws.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
indexable_getter boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::indexable_get ( ) const
inline

Returns function retrieving Indexable from Value.

Returns
The indexable_getter object.
Throws
Nothing.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::insert ( value_type const &  value)
inline

Insert a value to the index.

Parameters
valueThe value which will be stored in the container.
Throws
  • If Value copy constructor or copy assignment throws.
  • If allocation throws or returns invalid value.
Warning
This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

Referenced by boost::geometry::index::insert().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename Iterator >
void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::insert ( Iterator  first,
Iterator  last 
)
inline

Insert a range of values to the index.

Parameters
firstThe beginning of the range of values.
lastThe end of the range of values.
Throws
  • If Value copy constructor or copy assignment throws.
  • If allocation throws or returns invalid value.
Warning
This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

References boost::xpressive::first, and boost::last.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename ConvertibleOrRange >
void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::insert ( ConvertibleOrRange const &  conv_or_rng)
inline

Insert a value created using convertible object or a range of values to the index.

Parameters
conv_or_rngAn object of type convertible to value_type or a range of values.
Throws
  • If Value copy constructor or copy assignment throws.
  • If allocation throws or returns invalid value.
Warning
This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

References boost::spirit::x3::bool_, and boost::program_options::value().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
rtree& boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::operator= ( BOOST_COPY_ASSIGN_REF(rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >)  src)
inline

The assignment operator.

It uses parameters and translator from the source tree.

Parameters
srcThe rtree which content will be copied.
Throws
  • If Value copy constructor throws.
  • If allocation throws.
  • If allocation throws or returns invalid value.

References boost::spirit::x3::bool_, and boost::program_options::value().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
rtree& boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::operator= ( BOOST_RV_REF(rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >)  src)
inline

The moving assignment.

It uses parameters and translator from the source tree.

Parameters
srcThe rtree which content will be moved.
Throws
Only if allocators aren't equal.
  • If Value copy constructor throws.
  • If allocation throws or returns invalid value.

References boost::spirit::x3::bool_, boost::swap, and boost::program_options::value().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
parameters_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::parameters ( ) const
inline

Returns parameters.

Returns
The parameters object.
Throws
Nothing.
template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename Predicates >
const_query_iterator boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::qbegin ( Predicates const &  predicates) const
inline

Returns the query iterator pointing at the begin of the query range.

This method returns the iterator which may be used to perform iterative queries. For the information about the predicates which may be passed to this method see query().

Example
for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ;
      it != tree.qend() ; ++it )
{
    // do something with value
    if ( has_enough_nearest_values() )
        break;
}
Throws
If predicates copy throws. If allocation throws.
Parameters
predicatesPredicates.
Returns
The iterator pointing at the begin of the query range.

Referenced by boost::geometry::index::qbegin().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
const_query_iterator boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::qend ( ) const
inline

Returns the query iterator pointing at the end of the query range.

This method returns the iterator which may be used to check if the query has ended.

Example
for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ;
      it != tree.qend() ; ++it )
{
    // do something with value
    if ( has_enough_nearest_values() )
        break;
}
Throws
Nothing
Returns
The iterator pointing at the end of the query range.

Referenced by boost::geometry::index::qend().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename Predicates , typename OutIter >
size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::query ( Predicates const &  predicates,
OutIter  out_it 
) const
inline

Finds values meeting passed predicates e.g.

nearest to some Point and/or intersecting some Box.

This query function performs spatial and k-nearest neighbor searches. It allows to pass a set of predicates. Values will be returned only if all predicates are met.

Spatial predicates

Spatial predicates may be generated by one of the functions listed below:

It is possible to negate spatial predicates:

Satisfies predicate

This is a special kind of predicate which allows to pass a user-defined function or function object which checks if Value should be returned by the query. It's generated by:

Nearest predicate

If the nearest predicate is passed a k-nearest neighbor search will be performed. This query will result in returning k values to the output iterator. Only one nearest predicate may be passed to the query. It may be generated by:

Connecting predicates

Predicates may be passed together connected with operator&&().

Example
// return elements intersecting box
tree.query(bgi::intersects(box), std::back_inserter(result));
// return elements intersecting poly but not within box
tree.query(bgi::intersects(poly) && !bgi::within(box), std::back_inserter(result));
// return elements overlapping box and meeting my_fun unary predicate
tree.query(bgi::overlaps(box) && bgi::satisfies(my_fun), std::back_inserter(result));
// return 5 elements nearest to pt and elements are intersecting box
tree.query(bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result));
Throws
If Value copy constructor or copy assignment throws. If predicates copy throws.
Warning
Only one nearest() perdicate may be passed to the query. Passing more of them results in compile-time error.
Parameters
predicatesPredicates.
out_itThe output iterator, e.g. generated by std::back_inserter().
Returns
The number of values found.

References BOOST_MPL_ASSERT_MSG, and boost::program_options::value().

Referenced by boost::geometry::index::query().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::remove ( value_type const &  value)
inline

Remove a value from the container.

In contrast to the std::set or std::map erase() method this method removes only one value from the container.

Parameters
valueThe value which will be removed from the container.
Returns
1 if the value was removed, 0 otherwise.
Throws
  • If Value copy constructor or copy assignment throws.
  • If allocation throws or returns invalid value.
Warning
This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

References boost::program_options::value().

Referenced by boost::geometry::index::remove().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename Iterator >
size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::remove ( Iterator  first,
Iterator  last 
)
inline

Remove a range of values from the container.

In contrast to the std::set or std::map erase() method it doesn't take iterators pointing to values stored in this container. It removes values equal to these passed as a range. Furthermore this method removes only one value for each one passed in the range, not all equal values.

Parameters
firstThe beginning of the range of values.
lastThe end of the range of values.
Returns
The number of removed values.
Throws
  • If Value copy constructor or copy assignment throws.
  • If allocation throws or returns invalid value.
Warning
This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

References boost::xpressive::first, and boost::last.

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
template<typename ConvertibleOrRange >
size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::remove ( ConvertibleOrRange const &  conv_or_rng)
inline

Remove value corresponding to an object convertible to it or a range of values from the container.

In contrast to the std::set or std::map erase() method it removes values equal to these passed as a range. Furthermore, this method removes only one value for each one passed in the range, not all equal values.

Parameters
conv_or_rngThe object of type convertible to value_type or a range of values.
Returns
The number of removed values.
Throws
  • If Value copy constructor or copy assignment throws.
  • If allocation throws or returns invalid value.
Warning
This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

References boost::spirit::x3::bool_, and boost::program_options::value().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::size ( ) const
inline

Returns the number of stored values.

Returns
The number of stored values.
Throws
Nothing.

Referenced by boost::geometry::index::size().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::swap ( rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator > &  other)
inline

Swaps contents of two rtrees.

Parameters, translator and allocators are swapped as well.

Parameters
otherThe rtree which content will be swapped with this rtree content.
Throws
If allocators swap throws.

References boost::spirit::x3::bool_, boost::swap, and boost::program_options::value().

Referenced by boost::geometry::index::swap().

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
value_equal boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::value_eq ( ) const
inline

Returns function comparing Values.

Returns
The value_equal function.
Throws
Nothing.

Friends And Related Function Documentation

template<typename Value, typename Parameters, typename IndexableGetter = index::indexable<Value>, typename EqualTo = index::equal_to<Value>, typename Allocator = std::allocator<Value>>
friend class detail::rtree::utilities::view< rtree >
friend

The documentation for this class was generated from the following file: