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 Bidirectional_iterator < container_traits< Ct >::mode_type, container_traits< Ct >::rank_type >.
Public Member Functions | |
region_iterator () | |
Uninitialized iterator. More... | |
region_iterator (Ct &container, const Predicate &pred, typename container_traits< Ct >::iterator iter) | |
Build a region iterator from a container's iterator type. More... | |
region_iterator (Ct &container, const Predicate &pred, dimension_type dim, typename container_traits< Ct >::mode_type::node_ptr ptr) | |
Build a region iterator from the node and current dimension of a container's element. More... | |
region_iterator< Ct, Predicate > & | operator++ () |
Increments the iterator and returns the incremented value. More... | |
region_iterator< Ct, Predicate > | operator++ (int) |
Increments the iterator but returns the value of the iterator before the increment. More... | |
region_iterator< Ct, Predicate > & | operator-- () |
Decrements the iterator and returns the decremented value. More... | |
region_iterator< 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::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 140 of file spatial_region.hpp.
|
private |
Definition at line 148 of file spatial_region.hpp.
spatial::region_iterator< Ct, Predicate >::region_iterator | ( | ) |
Uninitialized iterator.
Definition at line 152 of file spatial_region.hpp.
spatial::region_iterator< Ct, Predicate >::region_iterator | ( | Ct & | container, |
const Predicate & | pred, | ||
typename container_traits< Ct >::iterator | iter | ||
) |
Build a region iterator from a container's iterator type.
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.
container | The container being iterated. |
pred | A model of the Region Predicate concept. |
iter | An iterator on the type Ct. |
Definition at line 168 of file spatial_region.hpp.
spatial::region_iterator< Ct, Predicate >::region_iterator | ( | Ct & | container, |
const Predicate & | pred, | ||
dimension_type | dim, | ||
typename container_traits< Ct >::mode_type::node_ptr | ptr | ||
) |
Build a region iterator from the node and current dimension of a container's element.
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.
pred | A model of the Region Predicate concept. |
ptr | An iterator on the type Ct. |
dim | The node's dimension for the node pointed to by node. |
container | The container being iterated. |
Definition at line 191 of file spatial_region.hpp.
region_iterator<Ct, Predicate>& spatial::region_iterator< Ct, Predicate >::operator++ | ( | ) |
Increments the iterator and returns the incremented value.
Prefer to use this form in for
loops.
Definition at line 197 of file spatial_region.hpp.
region_iterator<Ct, Predicate> spatial::region_iterator< 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 202 of file spatial_region.hpp.
region_iterator<Ct, Predicate>& spatial::region_iterator< Ct, Predicate >::operator-- | ( | ) |
Decrements the iterator and returns the decremented value.
Prefer to use this form in for
loops.
Definition at line 211 of file spatial_region.hpp.
region_iterator<Ct, Predicate> spatial::region_iterator< 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 216 of file spatial_region.hpp.
Predicate spatial::region_iterator< Ct, Predicate >::predicate | ( | ) | const |
Return the key_comparator used by the iterator.
Definition at line 224 of file spatial_region.hpp.
|
private |
The related data for the iterator.
Definition at line 228 of file spatial_region.hpp.