mdds
Classes | Public Types | Public Member Functions | List of all members
mdds::rtree< KeyT, ValueT, Traits > 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 = KeyT
 
using value_type = ValueT
 
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 FuncT >
void walk (FuncT 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 KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::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 KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::clear ( )

Empty the entire container.

◆ empty()

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
bool mdds::rtree< KeyT, ValueT, Traits >::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 KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::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 KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::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 KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
std::string mdds::rtree< KeyT, ValueT, Traits >::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 KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
const extent_type & mdds::rtree< KeyT, ValueT, Traits >::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 KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::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() [2/4]

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::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() [3/4]

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::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.

◆ insert() [4/4]

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::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.

◆ search() [1/4]

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
search_results mdds::rtree< KeyT, ValueT, Traits >::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.

◆ search() [2/4]

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
const_search_results mdds::rtree< KeyT, ValueT, Traits >::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() [3/4]

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
search_results mdds::rtree< KeyT, ValueT, Traits >::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() [4/4]

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
const_search_results mdds::rtree< KeyT, ValueT, Traits >::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.

◆ size()

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
size_t mdds::rtree< KeyT, ValueT, Traits >::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 KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
void mdds::rtree< KeyT, ValueT, Traits >::swap ( rtree< KeyT, ValueT, Traits > &  other)

Swap the content of the tree with another instance.

Parameters
otheranother instance to swap the content with.

◆ walk()

template<typename KeyT , typename ValueT , typename Traits = detail::rtree::default_rtree_traits>
template<typename FuncT >
void mdds::rtree< KeyT, ValueT, Traits >::walk ( FuncT  func) const

Walk down the entire tree depth first.

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