Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
spatial::details::Neighbor_data< Ct, Metric > Struct Template Reference

Extra information needed by the iterator to perform its work. More...

#include <spatial_neighbor.hpp>

Inherits key_compare< Ct >.

Public Member Functions

 Neighbor_data ()
 Build an unintialized neighbor data object. More...
 
 Neighbor_data (const typename container_traits< Ct >::key_compare &container, const Metric &metric, const typename container_traits< Ct >::key_type &key, typename Metric::distance_type distance)
 Builds required neighbor data from the given container, metric and dimension. More...
 

Public Attributes

Compress< Metric, typename container_traits< Ct >::key_type > _target
 The target of the iteration; element of the container are iterate from the closest to the element furthest away from the target. More...
 
Metric::distance_type _distance
 The last valid computed value of the distance. More...
 

Detailed Description

template<typename Ct, typename Metric>
struct spatial::details::Neighbor_data< Ct, Metric >

Extra information needed by the iterator to perform its work.

This information is copied to each iterator from a given container.

Although it may be possible to modify this information directly from it's members, it may be unwise to do so, as it could invalidate the iterator and cause the program to behave unexpectedly. If any of this information needs to be modified, it is probably recommended to create a new iterator altogether.

Template Parameters
CtThe container to which these iterator relate to.
MetricThe type of Metric applied to the iterator.
DistanceTypeThe type used to store the distance value.

Definition at line 42 of file spatial_neighbor.hpp.

Constructor & Destructor Documentation

template<typename Ct, typename Metric>
spatial::details::Neighbor_data< Ct, Metric >::Neighbor_data ( )

Build an unintialized neighbor data object.

Definition at line 45 of file spatial_neighbor.hpp.

template<typename Ct, typename Metric>
spatial::details::Neighbor_data< Ct, Metric >::Neighbor_data ( const typename container_traits< Ct >::key_compare &  container,
const Metric &  metric,
const typename container_traits< Ct >::key_type &  key,
typename Metric::distance_type  distance 
)

Builds required neighbor data from the given container, metric and dimension.

Parameters
containerThe container being iterated.
metricThe metric to apply during iteration
keyThe key representing the iteration target.
distanceCached distance value from the last iterator's distance computation.

Definition at line 58 of file spatial_neighbor.hpp.

Member Data Documentation

template<typename Ct, typename Metric>
Metric::distance_type spatial::details::Neighbor_data< Ct, Metric >::_distance

The last valid computed value of the distance.

The value stored is only valid if the iterator is not past-the-end.

Definition at line 75 of file spatial_neighbor.hpp.

template<typename Ct, typename Metric>
Compress<Metric, typename container_traits<Ct>::key_type> spatial::details::Neighbor_data< Ct, Metric >::_target

The target of the iteration; element of the container are iterate from the closest to the element furthest away from the target.

Definition at line 69 of file spatial_neighbor.hpp.


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