Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
spatial::open_bounds< Key, Compare > Class Template Reference

A model of Region Predicate that checks if a value of type Key is contained within the open boundaries defined by lower and upper. More...

#include <spatial_open_region.hpp>

Inherits Compare.

Public Member Functions

 open_bounds ()
 The default constructor leaves everything un-initialized. More...
 
 open_bounds (const Compare &compare, const Key &lower, const Key &upper)
 Set the lower and upper boundary for the orthogonal range search in the region. More...
 
relative_order operator() (dimension_type dim, dimension_type, const Key &key) const
 The operator that returns wheather the point is in region or not. More...
 

Private Attributes

Key _lower
 The lower bound for the orthogonal region iterator. More...
 
Key _upper
 The upper bound for the orthogonal region iterator. More...
 

Detailed Description

template<typename Key, typename Compare>
class spatial::open_bounds< Key, Compare >

A model of Region Predicate that checks if a value of type Key is contained within the open boundaries defined by lower and upper.

To be very specific, given a dimension $d$ we define that $x$ is contained in the open boundaries $(lower, upper)$ if:

\[lower_d < x_d < upper_d\]

Simply stated, open_bounds used in a region_iterator will match all keys that are strictly within the region defined by lower and upper.

Template Parameters
KeyThe type used during the comparison.
CompareThe comparison functor using to compare 2 objects of type Key along the same dimension.
Concept:
This object is a model of Region Predicate

Definition at line 41 of file spatial_open_region.hpp.

Constructor & Destructor Documentation

template<typename Key , typename Compare >
spatial::open_bounds< Key, Compare >::open_bounds ( )

The default constructor leaves everything un-initialized.

Definition at line 48 of file spatial_open_region.hpp.

template<typename Key , typename Compare >
spatial::open_bounds< Key, Compare >::open_bounds ( const Compare &  compare,
const Key &  lower,
const Key &  upper 
)

Set the lower and upper boundary for the orthogonal range search in the region.

See also
make_open_bounds

The constructor does not check that elements of lower are lesser than elements of upper along any dimension. Therefore you must be careful of the order in which these values are inserted.

Parameters
compareThe comparison functor, for initialization.
lowerThe value of the lower bound.
upperThe value of the upper bound.

Definition at line 64 of file spatial_open_region.hpp.

Member Function Documentation

template<typename Key , typename Compare >
relative_order spatial::open_bounds< Key, Compare >::operator() ( dimension_type  dim,
dimension_type  ,
const Key &  key 
) const

The operator that returns wheather the point is in region or not.

Parameters
dimThe dimension of comparison, that should always be less than the rank of the type Key.
keyThe value to compare to the interval defined by _lower and _upper.
Returns
spatial::below to indicate that key is lesser or equal to _lower; spatial::above to indicate that key is great or equal to _upper; spatial::matching to indicate that key is strictly within _lower and _upper.

Definition at line 82 of file spatial_open_region.hpp.

Member Data Documentation

template<typename Key , typename Compare >
Key spatial::open_bounds< Key, Compare >::_lower
private

The lower bound for the orthogonal region iterator.

Definition at line 95 of file spatial_open_region.hpp.

template<typename Key , typename Compare >
Key spatial::open_bounds< Key, Compare >::_upper
private

The upper bound for the orthogonal region iterator.

Definition at line 100 of file spatial_open_region.hpp.


The documentation for this class was generated from the following file: