Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
|
This type provides both an iterator and a constant iterator to iterate through all elements of a tree that match an orthogonal region defined by a predicate. More...
#include <spatial_region.hpp>
Inherits Const_bidirectional_iterator < container_traits< Ct >::mode_type, container_traits< Ct >::rank_type >.
Public Member Functions | |
region_iterator () | |
Constructs an empty, uninitialized object. More... | |
region_iterator (const Ct &container, const Predicate &pred, typename container_traits< Ct >::const_iterator iter) | |
Build a region iterator from a container's iterator type. More... | |
region_iterator (const Ct &container, const Predicate &pred, dimension_type dim, typename container_traits< Ct >::mode_type::const_node_ptr ptr) | |
Build a region iterator from the node and current dimension of a container's element. More... | |
region_iterator (const region_iterator< Ct, Predicate > &iter) | |
Convertion of an iterator into a const_iterator is permitted. More... | |
region_iterator< const Ct, Predicate > & | operator++ () |
Increments the iterator and returns the incremented value. More... | |
region_iterator< const Ct, Predicate > | operator++ (int) |
Increments the iterator but returns the value of the iterator before the increment. More... | |
region_iterator< const Ct, Predicate > & | operator-- () |
Decrements the iterator and returns the decremented value. More... | |
region_iterator< const Ct, Predicate > | operator-- (int) |
Decrements the iterator but returns the value of the iterator before the decrement. More... | |
Predicate | predicate () const |
Return the key_comparator used by the iterator. More... | |
Private Types | |
typedef details::Const_bidirectional_iterator< typename container_traits< Ct >::mode_type, typename container_traits< Ct >::rank_type > | Base |
Private Attributes | |
Predicate | _pred |
The related data for the iterator. More... | |
This type provides both an iterator and a constant iterator to iterate through all elements of a tree that match an orthogonal region defined by a predicate.
If no predicate is provided, the orthogonal region search default to a bounds predicate, which matches all points contained within an orthogonal region of space formed by 2 points, inclusive of lower values, but exclusive of upper values.
Ct | The container upon which these iterator relate to. |
Predicate | A model of Region Predicate, defaults to bounds |
Definition at line 246 of file spatial_region.hpp.
|
private |
Definition at line 254 of file spatial_region.hpp.
spatial::region_iterator< const Ct, Predicate >::region_iterator | ( | ) |
Constructs an empty, uninitialized object.
Definition at line 258 of file spatial_region.hpp.
spatial::region_iterator< const Ct, Predicate >::region_iterator | ( | const Ct & | container, |
const Predicate & | pred, | ||
typename container_traits< Ct >::const_iterator | iter | ||
) |
Build a region iterator from a container's iterator type.
container | The container being iterated. |
pred | A model of the Region Predicate concept. |
iter | An iterator on the type Ct. |
This constructor should be used in the general case where the dimension for the node pointed to by iter
is not known. The dimension of the node will be recomputed from the given iterator by iterating through all parents until the header node has been reached. This iteration is bounded by in case the tree is perfectly balanced.
Definition at line 274 of file spatial_region.hpp.
spatial::region_iterator< const Ct, Predicate >::region_iterator | ( | const Ct & | container, |
const Predicate & | pred, | ||
dimension_type | dim, | ||
typename container_traits< Ct >::mode_type::const_node_ptr | ptr | ||
) |
Build a region iterator from the node and current dimension of a container's element.
container | The container being iterated. |
pred | A model of the Region Predicate concept. |
dim | The dimension associated with ptr when checking the invariant in container . |
ptr | A pointer to a node belonging to container . |
This constructor should be used only when the dimension of the node pointed to by iter is known. If in doubt, use the other constructor. This constructor perform slightly faster than the other, since the dimension does not have to be calculated. Note however that the calculation of the dimension in the other iterator takes slightly longer than in general, and so it is not likely to affect the performance of your application in any major way.
Definition at line 298 of file spatial_region.hpp.
spatial::region_iterator< const Ct, Predicate >::region_iterator | ( | const region_iterator< Ct, Predicate > & | iter | ) |
Convertion of an iterator into a const_iterator is permitted.
Definition at line 303 of file spatial_region.hpp.
region_iterator<const Ct, Predicate>& spatial::region_iterator< const Ct, Predicate >::operator++ | ( | ) |
Increments the iterator and returns the incremented value.
Prefer to use this form in for
loops.
Definition at line 308 of file spatial_region.hpp.
region_iterator<const Ct, Predicate> spatial::region_iterator< const Ct, Predicate >::operator++ | ( | int | ) |
Increments the iterator but returns the value of the iterator before the increment.
Prefer to use the other form in for
loops.
Definition at line 313 of file spatial_region.hpp.
region_iterator<const Ct, Predicate>& spatial::region_iterator< const Ct, Predicate >::operator-- | ( | ) |
Decrements the iterator and returns the decremented value.
Prefer to use this form in for
loops.
Definition at line 322 of file spatial_region.hpp.
region_iterator<const Ct, Predicate> spatial::region_iterator< const Ct, Predicate >::operator-- | ( | int | ) |
Decrements the iterator but returns the value of the iterator before the decrement.
Prefer to use the other form in for
loops.
Definition at line 327 of file spatial_region.hpp.
Predicate spatial::region_iterator< const Ct, Predicate >::predicate | ( | ) | const |
Return the key_comparator used by the iterator.
Definition at line 335 of file spatial_region.hpp.
|
private |
The related data for the iterator.
Definition at line 339 of file spatial_region.hpp.