Wraps an ConstMappingIterator into a MappingIterator interface. More...
#include <MappingUtils.h>
Inherits MappingIterator.
Public Member Functions | |
ConstMappingIteratorWrapper (ConstMappingIterator *it) | |
virtual void | setValue (double value) |
Changes the value of the Mapping at the current position. | |
virtual const Argument & | getNextPosition () const |
Returns the position the next call to "next()" of this Iterator would iterate to. | |
virtual void | jumpTo (const Argument &pos) |
Lets the iterator point to the passed position. | |
virtual void | jumpToBegin () |
Lets the iterator point to the begin of the mapping. | |
virtual void | iterateTo (const Argument &pos) |
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. | |
virtual void | next () |
Iterates to the next position of the Mapping. | |
virtual bool | inRange () const |
Returns true if the current position of the iterator is in range of the function. | |
virtual bool | hasNext () const |
Returns true if the iterator has a next value it can iterate to on a call to "next()". | |
virtual const Argument & | getPosition () const |
Returns the current position of the iterator. | |
virtual double | getValue () const |
Returns the value of the Mapping at the current position. | |
Protected Attributes | |
ConstMappingIterator * | iterator |
Wraps an ConstMappingIterator into a MappingIterator interface.
Assumes that "setValue()" of the MappingIterator interface will never be called.
Definition at line 831 of file MappingUtils.h.
virtual double ConstMappingIteratorWrapper::getValue | ( | ) | const [inline, virtual] |
Returns the value of the Mapping at the current position.
The complexity of this method should be constant for every implementation.
Implements ConstMappingIterator.
Definition at line 861 of file MappingUtils.h.
References ConstMappingIterator::getValue().
{ return iterator->getValue(); }
virtual bool ConstMappingIteratorWrapper::inRange | ( | ) | const [inline, 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.
Implements ConstMappingIterator.
Definition at line 855 of file MappingUtils.h.
References ConstMappingIterator::inRange().
{ return iterator->inRange(); }
virtual void ConstMappingIteratorWrapper::jumpTo | ( | const Argument & | pos | ) | [inline, virtual] |
Lets the iterator point to the passed position.
The passed new position can be at arbitrary places.
Implements ConstMappingIterator.
Definition at line 847 of file MappingUtils.h.
References ConstMappingIterator::jumpTo().
{ iterator->jumpTo(pos); }
virtual void ConstMappingIteratorWrapper::jumpToBegin | ( | ) | [inline, 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).
Implements ConstMappingIterator.
Definition at line 849 of file MappingUtils.h.
References ConstMappingIterator::jumpToBegin().
{ iterator->jumpToBegin(); }
virtual void ConstMappingIteratorWrapper::next | ( | ) | [inline, 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.
Implements ConstMappingIterator.
Definition at line 853 of file MappingUtils.h.
References ConstMappingIterator::next().
{ iterator->next(); }
virtual void ConstMappingIteratorWrapper::setValue | ( | double | value | ) | [inline, virtual] |
Changes the value of the Mapping at the current position.
Implementations of this method should provide constant complexity.
Implements MappingIterator.
Definition at line 843 of file MappingUtils.h.
{ assert(false); }