16 #ifndef SPATIAL_CLOSED_REGION_HPP
17 #define SPATIAL_CLOSED_REGION_HPP
19 #include "spatial_region.hpp"
41 template <
typename Key,
typename Compare>
66 return (Compare::operator()(dim, key,
_lower)
68 : (Compare::operator()(dim,
_upper, key)
103 template <
typename Tp>
107 (
const Tp& container,
115 (container.key_comp(), lower, upper);
118 template<
typename Ct>
121 <Ct, closed_bounds<typename container_traits<Ct>::key_type,
122 typename container_traits<Ct>::key_compare> >
137 template<
typename Ct>
140 <const Ct, closed_bounds<typename container_traits<Ct>::key_type,
141 typename container_traits<Ct>::key_compare> >
161 <
const Ct, closed_bounds<typename container_traits<Ct>::key_type,
166 template<
typename Ct>
169 <Ct, closed_bounds<typename container_traits<Ct>::key_type,
170 typename container_traits<Ct>::key_compare> >
182 <Ct, closed_bounds<typename container_traits<Ct>::key_type,
187 template<
typename Ct>
190 <const Ct, closed_bounds<typename container_traits<Ct>::key_type,
191 typename container_traits<Ct>::key_compare> >
203 <
const Ct, closed_bounds<typename container_traits<Ct>::key_type,
214 template <
typename Ct>
215 inline closed_region_iterator<Ct>
221 template <
typename Ct>
222 inline closed_region_iterator<const Ct>
228 template <
typename Ct>
229 inline closed_region_iterator<const Ct>
237 template <
typename Ct>
238 inline closed_region_iterator<Ct>
246 template <
typename Ct>
247 inline closed_region_iterator<const Ct>
255 template <
typename Ct>
256 inline closed_region_iterator<const Ct>
265 template <
typename Ct>
266 inline closed_region_iterator_pair<Ct>
274 template <
typename Ct>
275 inline closed_region_iterator_pair<const Ct>
283 template <
typename Ct>
284 inline closed_region_iterator_pair<const Ct>
295 #endif // SPATIAL_CLOSED_REGION_HPP
closed_region_iterator_pair< Ct > closed_region_range(Ct &container, const typename container_traits< Ct >::key_type &lower, const typename container_traits< Ct >::key_type &upper)
This type provides both an iterator and a constant iterator to iterate through all elements of a tree...
closed_region_iterator< Ct > closed_region_begin(Ct &container, const typename container_traits< Ct >::key_type &lower, const typename container_traits< Ct >::key_type &upper)
Tp::key_compare key_compare
Comparison functor used to compare two instances of key_type.
closed_region_iterator_pair()
region_iterator< const Ct, Predicate > region_cend(const Ct &container, const Predicate &pred)
This structure defines a pair of mutable region iterator.
Tp::key_type key_type
The type representing the key managed by the container.
closed_region_iterator_pair(const closed_region_iterator_pair< Ct > &other)
Key _lower
The lower bound for the orthogonal region iterator.
closed_bounds(const Compare &compare, const Key &lower, const Key &upper)
Set the lower and upper boundary for the orthogonal region search.
region_iterator< Ct, Predicate > region_begin(Ct &container, const Predicate &pred)
region_iterator_pair< Ct, Predicate > region_range(Ct &container, const Predicate &pred)
Returns a spatial::region_iterator_pair where first points to the first element matching the predicat...
The traits type for all containers in the spatial namespace.
region_iterator< const Ct, Predicate > region_cbegin(const Ct &container, const Predicate &pred)
relative_order
Defines values for relative ordering.
std::size_t dimension_type
Defines the type for the dimension as being a size.
region_iterator< Ct, Predicate > region_end(Ct &container, const Predicate &pred)
closed_region_iterator< const Ct > closed_region_cbegin(const Ct &container, const typename container_traits< Ct >::key_type &lower, const typename container_traits< Ct >::key_type &upper)
closed_region_iterator< const Ct > closed_region_cend(const Ct &container, const typename container_traits< Ct >::key_type &lower, const typename container_traits< Ct >::key_type &upper)
closed_region_iterator< Ct > closed_region_end(Ct &container, const typename container_traits< Ct >::key_type &lower, const typename container_traits< Ct >::key_type &upper)
The main namespace used in the library.
relative_order operator()(dimension_type dim, dimension_type, const Key &key) const
The operator that tells wheather the point is in region or not.
region_iterator_pair< const Ct, Predicate > region_crange(const Ct &container, const Predicate &pred)
This overload works only on constant containers and will return a set of constant iterators...
closed_bounds< typename container_traits< Tp >::key_type, typename container_traits< Tp >::key_compare > make_closed_bounds(const Tp &container, const typename container_traits< Tp >::key_type &lower, const typename container_traits< Tp >::key_type &upper)
A closed_bounds factory that takes in a container, a region defined by lower and upper, and returns a constructed closed_bounds object.
Key _upper
The upper bound for the orthogonal region iterator.
closed_region_iterator_pair< const Ct > closed_region_crange(const Ct &container, const typename container_traits< Ct >::key_type &lower, const typename container_traits< Ct >::key_type &upper)
void check_closed_bounds(const Tp &container, const typename container_traits< Tp >::key_type &lower, const typename container_traits< Tp >::key_type &upper)
Checks if all coordinates of lower are less or equal to these of higher along the same dimensions...
closed_bounds()
The default constructor leaves everything un-initialized.
A model of Region Predicate that checks if a value of type Key is contained within the closed boundar...
closed_region_iterator_pair()