Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
spatial::details::ValueCompare< Value, KeyCompare > Struct Template Reference

Value compare functor for container storing pairs of (Key, Mapped) types, such as in spatial::point_multimap, spatial::box_multimap, etc. More...

#include <spatial_value_compare.hpp>

Inherits KeyCompare.

Public Member Functions

 ValueCompare (const KeyCompare &x)
 Comparator being initilized with a value to copy into the interal comparison function. More...
 
 ValueCompare ()
 Unintialized comparator. More...
 
bool operator() (dimension_type dim, const Value &a, const Value &b) const
 Compare 2 values a and b with the comparison operator provided by KeyCompare. More...
 

Detailed Description

template<typename Value, typename KeyCompare>
struct spatial::details::ValueCompare< Value, KeyCompare >

Value compare functor for container storing pairs of (Key, Mapped) types, such as in spatial::point_multimap, spatial::box_multimap, etc.

These container provide a key_compare functor type that is being used for the comparison of the value.

In spatial::point_multimap, spatial::box_multimap and other containers, the value type differs from the key type. Value type is a pair of key type and mapped type. The KeyCompare functor, provided to the container is reused to compare the value by using the first element of each value (which is the key).

Template Parameters
ValueA std::pair of key and value type.
KeyCompareA type that is a model of Generalized Comparison.

Definition at line 38 of file spatial_value_compare.hpp.

Constructor & Destructor Documentation

template<typename Value , typename KeyCompare >
spatial::details::ValueCompare< Value, KeyCompare >::ValueCompare ( const KeyCompare &  x)
explicit

Comparator being initilized with a value to copy into the interal comparison function.

Definition at line 42 of file spatial_value_compare.hpp.

template<typename Value , typename KeyCompare >
spatial::details::ValueCompare< Value, KeyCompare >::ValueCompare ( )

Unintialized comparator.

Definition at line 45 of file spatial_value_compare.hpp.

Member Function Documentation

template<typename Value , typename KeyCompare >
bool spatial::details::ValueCompare< Value, KeyCompare >::operator() ( dimension_type  dim,
const Value &  a,
const Value &  b 
) const

Compare 2 values a and b with the comparison operator provided by KeyCompare.

Parameters
dimThe dimension of comparison.
aThe left value to compare.
bThe right value to compare.
Returns
The returned value is equivalent to KeyCompare()(a, b).

Definition at line 56 of file spatial_value_compare.hpp.


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