mdds
Classes | Public Types | Public Member Functions | List of all members
mdds::rtree< _Key, _Value, _Trait > Class Template Reference

Classes

class  bulk_loader
 
class  const_iterator
 
class  const_search_results
 
struct  extent_type
 
class  iterator
 
class  iterator_base
 
struct  node_properties
 
struct  point_type
 
class  search_results
 
class  search_results_base
 

Public Types

using key_type = _Key
 
using value_type = _Value
 
using node_type = detail::rtree::node_type
 
using export_tree_type = detail::rtree::export_tree_type
 
using search_type = detail::rtree::search_type
 
using integrity_check_properties = detail::rtree::integrity_check_properties
 

Public Member Functions

 rtree (rtree &&other)
 
 rtree (const rtree &other)
 
rtreeoperator= (const rtree &other)
 
rtreeoperator= (rtree &&other)
 
void insert (const extent_type &extent, value_type &&value)
 
void insert (const extent_type &extent, const value_type &value)
 
void insert (const point_type &position, value_type &&value)
 
void insert (const point_type &position, const value_type &value)
 
const_search_results search (const point_type &pt, search_type st) const
 
search_results search (const point_type &pt, search_type st)
 
const_search_results search (const extent_type &extent, search_type st) const
 
search_results search (const extent_type &extent, search_type st)
 
void erase (const const_iterator &pos)
 
void erase (const iterator &pos)
 
const extent_typeextent () const
 
bool empty () const
 
size_t size () const
 
void swap (rtree &other)
 
void clear ()
 
template<typename _Func >
void walk (_Func func) const
 
void check_integrity (const integrity_check_properties &props) const
 
std::string export_tree (export_tree_type mode) const
 

Member Function Documentation

◆ check_integrity()

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::check_integrity ( const integrity_check_properties props) const

Check the integrity of the entire tree structure.

Parameters
propsspecify how the check is to be performed.
Exceptions
integrity_errorif the integrity check fails.

◆ clear()

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::clear ( )

Empty the entire container.

◆ empty()

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
bool mdds::rtree< _Key, _Value, _Trait >::empty ( ) const

Check whether or not the tree stores any objects.

Returns
true if the tree is empty, otherwise false.

◆ erase() [1/2]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::erase ( const const_iterator pos)

Erase the value object referenced by the iterator passed to this method.

The iterator object will become invalid if the call results in an erasure of a value.

Parameters
positerator that refernces the value object to erase.

◆ erase() [2/2]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::erase ( const iterator pos)

Erase the value object referenced by the iterator passed to this method.

The iterator object will become invalid if the call results in an erasure of a value.

Parameters
positerator that refernces the value object to erase.

◆ export_tree()

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
std::string mdds::rtree< _Key, _Value, _Trait >::export_tree ( export_tree_type  mode) const

Export the structure of a tree in textural format.

Parameters
modespecify the format in which to represent the structure of a tree.
Returns
string representation of the tree structure.

◆ extent()

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
const extent_type& mdds::rtree< _Key, _Value, _Trait >::extent ( ) const

Get the minimum bounding extent of the root node of the tree. The extent returned from this method is the minimum extent that contains the extents of all objects stored in the tree.

Returns
immutable reference to the extent of the root node of the tree.

◆ insert() [1/4]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::insert ( const extent_type extent,
value_type &&  value 
)

Insert a new value associated with a bounding box. The new value object will be moved into the container.

Parameters
extentbounding box associated with the value.
valuevalue being inserted.

◆ insert() [2/4]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::insert ( const extent_type extent,
const value_type &  value 
)

Insert a new value associated with a bounding box. A copy of the new value object will be placed into the container.

Parameters
extentbounding box associated with the value.
valuevalue being inserted.

◆ insert() [3/4]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::insert ( const point_type position,
value_type &&  value 
)

Insert a new value associated with a point. The new value object will be moved into the container.

Parameters
positionpoint associated with the value.
valuevalue being inserted.

◆ insert() [4/4]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::insert ( const point_type position,
const value_type &  value 
)

Insert a new value associated with a point. A copy of the new value object will be placed into the container.

Parameters
positionpoint associated with the value.
valuevalue being inserted.

◆ search() [1/4]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
const_search_results mdds::rtree< _Key, _Value, _Trait >::search ( const point_type pt,
search_type  st 
) const

Search the tree and collect all value objects whose extents either contain the specified point, or exactly match the specified point.

Parameters
ptreference point to use for the search.
stsearch type that determines the satisfying condition of the search with respect to the reference point.
Returns
collection of all value objects that satisfy the specified search condition. This collection is immutable.

◆ search() [2/4]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
search_results mdds::rtree< _Key, _Value, _Trait >::search ( const point_type pt,
search_type  st 
)

Search the tree and collect all value objects whose extents either contain the specified point, or exactly match the specified point.

Parameters
ptreference point to use for the search.
stsearch type that determines the satisfying condition of the search with respect to the reference point.
Returns
collection of all value objects that satisfy the specified search condition. This collection is mutable.

◆ search() [3/4]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
const_search_results mdds::rtree< _Key, _Value, _Trait >::search ( const extent_type extent,
search_type  st 
) const

Search the tree and collect all value objects whose extents either overlaps with the specified extent, or exactly match the specified extent.

Parameters
extentreference extent to use for the search.
stsearch type that determines the satisfying condition of the search with respect to the reference extent.
Returns
collection of all value objects that satisfy the specified search condition. This collection is immutable.

◆ search() [4/4]

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
search_results mdds::rtree< _Key, _Value, _Trait >::search ( const extent_type extent,
search_type  st 
)

Search the tree and collect all value objects whose extents either overlaps with the specified extent, or exactly match the specified extent.

Parameters
extentreference extent to use for the search.
stsearch type that determines the satisfying condition of the search with respect to the reference extent.
Returns
collection of all value objects that satisfy the specified search condition. This collection is mutable.

◆ size()

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
size_t mdds::rtree< _Key, _Value, _Trait >::size ( ) const

Return the number of value nodes currently stored in the tree.

Returns
number of value nodes currently in the tree.

◆ swap()

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
void mdds::rtree< _Key, _Value, _Trait >::swap ( rtree< _Key, _Value, _Trait > &  other)

Swap the content of the tree with another instance.

Parameters
otheranother instance to swap the content with.

◆ walk()

template<typename _Key , typename _Value , typename _Trait = detail::rtree::default_rtree_trait>
template<typename _Func >
void mdds::rtree< _Key, _Value, _Trait >::walk ( _Func  func) const

Walk down the entire tree depth first.

function or function object that gets called at each node in the tree.