INET Framework for OMNeT++/OMNEST
|
Defines an const iterator for a ConstMapping which is able to iterate over the Mapping. More...
#include <MappingBase.h>
Public Types | |
typedef Argument::mapped_type | argument_value_t |
typedef Argument::mapped_type_cref | argument_value_cref_t |
Public Member Functions | |
ConstMappingIterator () | |
virtual | ~ConstMappingIterator () |
ConstMappingIterator (const ConstMappingIterator &) | |
Copy constructor. More... | |
ConstMappingIterator & | operator= (const ConstMappingIterator &) |
ConstMappingIterator assignment operator. More... | |
void | swap (ConstMappingIterator &) |
Swaps data with another ConstMappingIterator. More... | |
virtual const Argument & | getNextPosition () const =0 |
Returns the position the next call to "next()" of this Iterator would iterate to. More... | |
virtual void | jumpTo (const Argument &pos)=0 |
Lets the iterator point to the passed position. More... | |
virtual void | jumpToBegin ()=0 |
Lets the iterator point to the begin of the mapping. More... | |
virtual void | iterateTo (const Argument &pos)=0 |
Iterates to the specified position. More... | |
virtual void | next ()=0 |
Iterates to the next position of the Mapping. More... | |
virtual bool | inRange () const =0 |
Returns true if the current position of the iterator is in range of the function. More... | |
virtual bool | hasNext () const =0 |
Returns true if the iterator has a next value it can iterate to on a call to "next()". More... | |
virtual const Argument & | getPosition () const =0 |
Returns the current position of the iterator. More... | |
virtual argument_value_t | getValue () const =0 |
Returns the value of the Mapping at the current position. More... | |
Defines an const iterator for a ConstMapping which is able to iterate over the Mapping.
Iterators provide a fast way to iterate over every "entry" or important position of a Mapping. They also provide constant complexity for accessing the Mapping at the position of the Iterator.
Every implementation of an mapping-Iterator provides the same ordering when iterating over a Mapping. This is that, if the iterator is increased, the position of the entry it points to has to be also "increased". Which means that the new position has to be compared bigger than the previous position (see class Argument for comparison of positions).
"Const" means that you can not change the values of the underlying Mapping with this iterator.
|
inline |
|
pure virtual |
Returns the position the next call to "next()" of this Iterator would iterate to.
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::ConstMappingIteratorWrapper::getNextPosition(), inet::physicallayer::MappingUtils::iterateToNext(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
|
pure virtual |
Returns the current position of the iterator.
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::MappingUtils::applyElementWiseOperator(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::MappingUtils::createCompatibleMapping(), inet::physicallayer::FilledUpMapping::FilledUpMapping(), inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::LinearIntplMappingIterator::getPosition(), inet::physicallayer::ConstMappingIteratorWrapper::getPosition(), inet::physicallayer::MappingUtils::iterateToNext(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpToBegin(), inet::physicallayer::LinearIntplMappingIterator::LinearIntplMappingIterator(), inet::physicallayer::MultiDimMappingIterator< Linear >::MultiDimMappingIterator(), inet::physicallayer::MultiDimMappingIterator< Linear >::next(), inet::physicallayer::ConstMapping::print(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
|
pure virtual |
Returns the value of the Mapping at the current position.
The complexity of this method should be constant for every implementation.
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::MappingUtils::applyElementWiseOperator(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::FilledUpMapping::FilledUpMapping(), inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::LinearIntplMappingIterator::getValue(), inet::physicallayer::ConstMappingIteratorWrapper::getValue(), inet::physicallayer::MultiDimMappingIterator< Linear >::getValue(), and inet::physicallayer::ConstMapping::print().
|
pure virtual |
Returns true if the iterator has a next value it can iterate to on a call to "next()".
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::MappingUtils::createCompatibleMapping(), inet::physicallayer::FilledUpMapping::FilledUpMapping(), inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::ConstMappingIteratorWrapper::hasNext(), inet::physicallayer::MultiDimMappingIterator< Linear >::hasNext(), inet::physicallayer::MappingUtils::iterateToNext(), inet::physicallayer::MultiDimMappingIterator< Linear >::next(), inet::physicallayer::ConstMapping::print(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
|
pure virtual |
Returns true if the current position of the iterator is in range of the function.
This method should be used as end-condition when iterating over the function with the "next()" method.
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::MappingUtils::applyElementWiseOperator(), inet::physicallayer::MappingUtils::createCompatibleMapping(), inet::physicallayer::FilledUpMapping::FilledUpMapping(), inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::ConstMappingIteratorWrapper::inRange(), inet::physicallayer::MultiDimMappingIterator< Linear >::inRange(), and inet::physicallayer::ConstMapping::print().
|
pure virtual |
Iterates to the specified position.
This method should be used if the new position is near the current position. Furthermore the new position has to be compared bigger than the old position.
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::MappingUtils::applyElementWiseOperator(), inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::LinearIntplMappingIterator::iterateTo(), inet::physicallayer::ConstMappingIteratorWrapper::iterateTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::iterateTo(), and inet::physicallayer::MappingUtils::iterateToNext().
|
pure virtual |
Lets the iterator point to the passed position.
The passed new position can be at arbitrary places.
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::MappingUtils::applyElementWiseOperator(), inet::physicallayer::LinearIntplMappingIterator::jumpTo(), inet::physicallayer::ConstMappingIteratorWrapper::jumpTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpTo(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateSubIterator().
|
pure virtual |
Lets the iterator point to the begin of the mapping.
The beginning of the mapping depends on the implementation. With an implementation based on a number of key-entries, this could be the key entry with the smallest position (see class Argument for ordering of positions).
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::ConstMappingIteratorWrapper::jumpToBegin(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateSubIterator().
|
pure virtual |
Iterates to the next position of the Mapping.
The next position depends on the implementation of the Mapping. With an implementation based on a number of key-entries this probably would be the next bigger key-entry.
Implemented in inet::physicallayer::MultiDimMappingIterator< Interpolator >, inet::physicallayer::MultiDimMappingIterator< Linear >, inet::physicallayer::SimpleConstMappingIterator, inet::physicallayer::ConstMappingIteratorWrapper, inet::physicallayer::LinearIntplMappingIterator, inet::physicallayer::FrequencyMappingIterator< Interpolator >, inet::physicallayer::TimeMappingIterator< Interpolator >, and inet::physicallayer::BaseFilteredIterator< MappingIterator >.
Referenced by inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::MappingUtils::createCompatibleMapping(), inet::physicallayer::FilledUpMapping::FilledUpMapping(), inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::MappingUtils::iterateToNext(), inet::physicallayer::ConstMappingIteratorWrapper::next(), inet::physicallayer::MultiDimMappingIterator< Linear >::next(), and inet::physicallayer::ConstMapping::print().
|
inline |
|
inline |
Swaps data with another ConstMappingIterator.
s | A ConstMappingIterator of the same element and allocator types. |
This exchanges the elements between two ConstMappingIterator's in constant time. Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function.