Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
|
Generalized comparison concept defines the model for a functor used to perform a strict comparison between two values of a spatial container, over the same or a different dimension.
The functor shall return a boolean value equal true if the first value is strictly lower than the second value over that dimension.
All models of Generalized Comparison shall also model Trivial Comparison and publicly provide the following interface:
Signature/Typedef | Description | |
Legend | T | A model of Generalized Comparison and Trivial Comparison. |
Legend | V | The key used in a spatial container. |
Require | bool T::operator()(spatial::dimension_type x, const V& a, const V&b) const | Returns true if a < b over dimension d . (inherited from Trivial Comparison.) |
Require | bool T::operator()(spatial::dimension_type x, const V& a, spatial::dimension_type y, const V&b) const | Returns true if a(x) < b(y) where a(x) is the value of a over dimension x and b(y) is the value of b over dimension y . |
When comparing boxes during tree traversal for overlap or enclose regions, the library often need to compare the lower bound of a box against the higher bound of a box over a particular axis. Since lower bounds and higher bounds are stored on different dimensions in the library, the functor need to be able to perform comparison on different dimension.
As you can guess, models of this concept are required for comparison functors in spatial::box_multiset, spatial::idle_box_multiset, and other box containers.