INET Framework for OMNeT++/OMNEST
|
Template for an interpolateable const iterator for any container which maps from a key to a value. More...
#include <Interpolation.h>
Public Types | |
typedef _Interpolator | interpolator_type |
typedef interpolator_type::container_type | container_type |
typedef interpolator_type::key_type | key_type |
typedef interpolator_type::key_cref_type | key_cref_type |
typedef interpolator_type::mapped_type | mapped_type |
typedef interpolator_type::mapped_cref_type | mapped_cref_type |
typedef interpolator_type::pair_type | pair_type |
typedef interpolator_type::iterator | iterator |
typedef interpolator_type::const_iterator | const_iterator |
typedef interpolator_type::comparator_type | comparator_type |
typedef _IteratorType | used_iterator |
typedef interpolator_type::interpolated | interpolated |
typedef for the returned Interpolated value of this class. More... | |
Public Member Functions | |
ConstInterpolateableIterator (const used_iterator &first, const used_iterator &last, const interpolator_type &intpl) | |
Initializes the iterator with the passed Iterators as boundaries. More... | |
virtual | ~ConstInterpolateableIterator () |
bool | operator== (const ConstInterpolateableIterator &other) |
void | jumpTo (key_cref_type pos) |
Moves the iterator to the passed position. More... | |
void | jumpToBegin () |
Moves the iterator to the first element. More... | |
void | iterateTo (key_cref_type pos) |
forward iterates the iterator to the passed position. More... | |
void | next () |
Iterates to the next entry in the underlying data structure. More... | |
key_type | getNextPosition () |
bool | inRange () const |
Returns true if the current position of the iterator is between the position of the first and the last entry of the data structure. More... | |
bool | hasNext () const |
Returns true if the a call of "next()" would increase to the position of an a valid entry of the data structure. More... | |
interpolated | getValue () const |
Returns the interpolated value at the current position of the Iterator. More... | |
interpolated | getNextValue () const |
key_cref_type | getPosition () const |
Returns the current position of the iterator. More... | |
const interpolator_type & | getInterpolator () const |
Protected Attributes | |
used_iterator | first |
used_iterator | last |
used_iterator | right |
key_type | position |
const interpolator_type & | interpolate |
Template for an interpolateable const iterator for any container which maps from a key to a value.
This doesn't necessarily has to be a map, but also can be a sorted list of pairs.
The ConstInterpolateableIterator provides an iterator which as able to iterate in arbitrary steps over a iterateable number of pairs of "Key" and "Value". To determine the Value for a Key which does not exist in within the iterateable number of pairs it Interpolates between the nearby existing pairs. The actual Interpolation is determined by the passed Interpolator-template parameter.
An example use would be to be able to iterate over a std::map<double, double> in arbitrary steps (even at positions for which no Key exist inside the map) and be able to return an interpolated Value.
NOTE: The ConstInterpolateableIterator will become invalid if the underlying data structure is changed!
Template parameters: Pair - the type of the pair used as values in the container. Default is std::map<Key, V>::value_type (which is of type std::pair<Key, V>. The Pair type has to provide the two public members "first" and "second". Key - The type of the "first" member of the Pair type V - the type of the "second" member of the Pair type Iterator - the type of the iterator of the container (should be a const iterator). Default is std::map<Key, V>::const_iterator Interpolator - The Interpolation operator to use, this has to be a class which overwrites the ()-operator with the following parameters: Interpolated operator()(const Iterator& first, const Iterator& last, const Key& pos) Interpolated operator()(const Iterator& first, const Iterator& last, const Key& pos, Iterator upperBound) See the NextSmaller template for an example of an Interpolator. Default is NextSmaller<Key, V, Pair, Iterator>.
typedef interpolator_type::comparator_type inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::comparator_type |
typedef interpolator_type::const_iterator inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::const_iterator |
typedef interpolator_type::container_type inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::container_type |
typedef interpolator_type::interpolated inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::interpolated |
typedef for the returned Interpolated value of this class.
typedef _Interpolator inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::interpolator_type |
typedef interpolator_type::iterator inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::iterator |
typedef interpolator_type::key_cref_type inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::key_cref_type |
typedef interpolator_type::key_type inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::key_type |
typedef interpolator_type::mapped_cref_type inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::mapped_cref_type |
typedef interpolator_type::mapped_type inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::mapped_type |
typedef interpolator_type::pair_type inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::pair_type |
typedef _IteratorType inet::physicallayer::ConstInterpolateableIterator< _Interpolator, _IteratorType >::used_iterator |
|
inline |
Initializes the iterator with the passed Iterators as boundaries.
|
inlinevirtual |
|
inline |
|
inline |
Referenced by inet::physicallayer::TimeMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::TimeMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::TimeMappingIterator< Interpolator >::updateNextPos(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::updateNextPos(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
|
inline |
Referenced by inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
|
inline |
Returns the current position of the iterator.
Referenced by inet::physicallayer::FrequencyMappingIterator< Interpolator >::FrequencyMappingIterator(), inet::physicallayer::MultiDimMappingIterator< Linear >::iterateTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpTo(), inet::physicallayer::TimeMappingIterator< Interpolator >::jumpToBegin(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpToBegin(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpToBegin(), inet::physicallayer::MultiDimMappingIterator< Linear >::MultiDimMappingIterator(), inet::physicallayer::TimeMappingIterator< Interpolator >::next(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::next(), inet::physicallayer::MultiDimMappingIterator< Linear >::next(), and inet::physicallayer::TimeMappingIterator< Interpolator >::TimeMappingIterator().
|
inline |
Returns the interpolated value at the current position of the Iterator.
See definition of Interpolated on details on the return type.
Referenced by inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::TimeMappingIterator< Interpolator >::getValue(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::getValue(), inet::physicallayer::MultiDimMappingIterator< Linear >::MultiDimMappingIterator(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateSubIterator().
|
inline |
Returns true if the a call of "next()" would increase to the position of an a valid entry of the data structure.
This means if the current position is smaller than position of the last entry.
Referenced by inet::physicallayer::TimeMappingIterator< Interpolator >::hasNext(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::hasNext(), inet::physicallayer::MultiDimMappingIterator< Linear >::hasNext(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
|
inline |
Returns true if the current position of the iterator is between the position of the first and the last entry of the data structure.
Referenced by inet::physicallayer::MultiDimMappingIterator< Linear >::hasNext(), inet::physicallayer::TimeMappingIterator< Interpolator >::inRange(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::inRange(), and inet::physicallayer::MultiDimMappingIterator< Linear >::inRange().
|
inline |
forward iterates the iterator to the passed position.
This position can be any value of the Key-type.
This method assumes that the passed position is near the current position of the iterator. If this is the case this method will be faster than the jumpTo-method.
Referenced by inet::physicallayer::TimeMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::iterateTo(), inet::physicallayer::TimeMappingIterator< Interpolator >::next(), and inet::physicallayer::FrequencyMappingIterator< Interpolator >::next().
|
inline |
Moves the iterator to the passed position.
This position can be any value of the Key-type.
Referenced by inet::physicallayer::InterpolateableMap< Interpolator< std::map< simtime_t, argument_value_t > > >::findIntpl(), inet::physicallayer::TimeMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpTo(), and inet::physicallayer::MultiDimMappingIterator< Linear >::MultiDimMappingIterator().
|
inline |
Moves the iterator to the first element.
Referenced by inet::physicallayer::TimeMappingIterator< Interpolator >::jumpToBegin(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpToBegin(), and inet::physicallayer::MultiDimMappingIterator< Linear >::jumpToBegin().
|
inline |
Iterates to the next entry in the underlying data structure.
If the current position is before the position of the first element of the data structure this method will iterate to the first entry. If the current position is after the position of the last element of the data structure this method will increase the current position with the ++ operator.
Referenced by inet::physicallayer::TimeMappingIterator< Interpolator >::next(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::next(), and inet::physicallayer::MultiDimMappingIterator< Linear >::next().
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |