INET Framework for OMNeT++/OMNEST
inet::physicallayer::LinearIntplMappingIterator Class Reference

Helper-class for the MultiDimMapping which provides an Iterator which linear interpolates between two other Mapping iterators. More...

#include <MappingUtils.h>

Inheritance diagram for inet::physicallayer::LinearIntplMappingIterator:
inet::physicallayer::MappingIterator inet::physicallayer::ConstMappingIterator

Public Member Functions

 LinearIntplMappingIterator (ConstMappingIterator *leftIt, ConstMappingIterator *rightIt, argument_value_cref_t f)
 Initializes the Iterator with the passed Iterators of the mappings to Interpolate and the their interpolation-factor. More...
 
virtual ~LinearIntplMappingIterator ()
 Deletes the left and the right mapping iterator. More...
 
virtual bool hasNext () const override
 An interpolated mapping isn't really iterateable over specific values, it only provides an fast way to get several values from an Interpolated mapping. More...
 
virtual bool inRange () const override
 An interpolated mapping isn't really iterateable over specific values, it only provides an fast way to get several values from an Interpolated mapping. More...
 
virtual void jumpToBegin () override
 This method isn't supported by an interpolated Mapping. More...
 
virtual void next () override
 This method isn't supported by an interpolated Mapping. More...
 
virtual void setValue (argument_value_cref_t) override
 This method isn't supported by an interpolated Mapping. More...
 
virtual void jumpTo (const Argument &pos) override
 Lets the iterator point to the passed position. More...
 
virtual void iterateTo (const Argument &pos) override
 Increases the iterator to the passed position. More...
 
virtual argument_value_t getValue () const override
 Returns the value of the Interpolated mapping at the current position of the iterator. More...
 
virtual const ArgumentgetPosition () const override
 Returns the current position of the iterator. More...
 
virtual const ArgumentgetNextPosition () const override
 This method isn't supported by an interpolated mapping. More...
 
- Public Member Functions inherited from inet::physicallayer::MappingIterator
 MappingIterator ()
 
virtual ~MappingIterator ()
 
- Public Member Functions inherited from inet::physicallayer::ConstMappingIterator
 ConstMappingIterator ()
 
virtual ~ConstMappingIterator ()
 
 ConstMappingIterator (const ConstMappingIterator &)
 Copy constructor. More...
 
ConstMappingIteratoroperator= (const ConstMappingIterator &)
 ConstMappingIterator assignment operator. More...
 
void swap (ConstMappingIterator &)
 Swaps data with another ConstMappingIterator. More...
 

Protected Attributes

ConstMappingIteratorleftIt
 Iterator for the left Mapping to interpolate. More...
 
ConstMappingIteratorrightIt
 Iterator for the right Mapping to interpolate. More...
 
argument_value_t factor
 The factor defining how strong the left and the right Mapping affect the interpolation. More...
 

Private Member Functions

 LinearIntplMappingIterator (const LinearIntplMappingIterator &)
 Copy constructor is not allowed. More...
 
LinearIntplMappingIteratoroperator= (const LinearIntplMappingIterator &)
 Assignment operator is not allowed. More...
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::ConstMappingIterator
typedef Argument::mapped_type argument_value_t
 
typedef Argument::mapped_type_cref argument_value_cref_t
 

Detailed Description

Helper-class for the MultiDimMapping which provides an Iterator which linear interpolates between two other Mapping iterators.

Or in other words, it provides an Iterator for an linear interpolated Mapping.

Author
Karl Wessel

Constructor & Destructor Documentation

inet::physicallayer::LinearIntplMappingIterator::LinearIntplMappingIterator ( const LinearIntplMappingIterator )
private

Copy constructor is not allowed.

inet::physicallayer::LinearIntplMappingIterator::LinearIntplMappingIterator ( ConstMappingIterator leftIt,
ConstMappingIterator rightIt,
Mapping::argument_value_cref_t  f 
)

Initializes the Iterator with the passed Iterators of the mappings to Interpolate and the their interpolation-factor.

477  :
479 {
480  assert(leftIt->getPosition() == rightIt->getPosition());
481 }
ConstMappingIterator * rightIt
Iterator for the right Mapping to interpolate.
Definition: MappingUtils.h:763
virtual const Argument & getPosition() const =0
Returns the current position of the iterator.
MappingIterator()
Definition: MappingBase.h:1221
argument_value_t factor
The factor defining how strong the left and the right Mapping affect the interpolation.
Definition: MappingUtils.h:767
ConstMappingIterator * leftIt
Iterator for the left Mapping to interpolate.
Definition: MappingUtils.h:761
inet::physicallayer::LinearIntplMappingIterator::~LinearIntplMappingIterator ( )
virtual

Deletes the left and the right mapping iterator.

484 {
485  if (leftIt)
486  delete leftIt;
487  if (rightIt)
488  delete rightIt;
489 }
ConstMappingIterator * rightIt
Iterator for the right Mapping to interpolate.
Definition: MappingUtils.h:763
ConstMappingIterator * leftIt
Iterator for the left Mapping to interpolate.
Definition: MappingUtils.h:761

Member Function Documentation

virtual const Argument& inet::physicallayer::LinearIntplMappingIterator::getNextPosition ( ) const
inlineoverridevirtual

This method isn't supported by an interpolated mapping.

Implements inet::physicallayer::ConstMappingIterator.

871 { assert(false); return *((Argument *)nullptr); }
virtual const Argument& inet::physicallayer::LinearIntplMappingIterator::getPosition ( ) const
inlineoverridevirtual

Returns the current position of the iterator.

Constant complexity.

Implements inet::physicallayer::ConstMappingIterator.

864  {
865  return leftIt->getPosition();
866  }
virtual const Argument & getPosition() const =0
Returns the current position of the iterator.
ConstMappingIterator * leftIt
Iterator for the left Mapping to interpolate.
Definition: MappingUtils.h:761
virtual argument_value_t inet::physicallayer::LinearIntplMappingIterator::getValue ( ) const
inlineoverridevirtual

Returns the value of the Interpolated mapping at the current position of the iterator.

This method has constant complexity.

Implements inet::physicallayer::ConstMappingIterator.

852  {
855  return v0 + (v1 - v0) * factor;
856  }
ConstMappingIterator * rightIt
Iterator for the right Mapping to interpolate.
Definition: MappingUtils.h:763
Argument::mapped_type_cref argument_value_cref_t
Definition: MappingBase.h:722
argument_value_t factor
The factor defining how strong the left and the right Mapping affect the interpolation.
Definition: MappingUtils.h:767
virtual argument_value_t getValue() const =0
Returns the value of the Mapping at the current position.
ConstMappingIterator * leftIt
Iterator for the left Mapping to interpolate.
Definition: MappingUtils.h:761
virtual bool inet::physicallayer::LinearIntplMappingIterator::hasNext ( ) const
inlineoverridevirtual

An interpolated mapping isn't really iterateable over specific values, it only provides an fast way to get several values from an Interpolated mapping.

Implements inet::physicallayer::ConstMappingIterator.

794 { return false; }
virtual bool inet::physicallayer::LinearIntplMappingIterator::inRange ( ) const
inlineoverridevirtual

An interpolated mapping isn't really iterateable over specific values, it only provides an fast way to get several values from an Interpolated mapping.

Implements inet::physicallayer::ConstMappingIterator.

800 { return false; }
virtual void inet::physicallayer::LinearIntplMappingIterator::iterateTo ( const Argument pos)
inlineoverridevirtual

Increases the iterator to the passed position.

This position should be near the current position of the iterator.

The passed position has to be compared bigger than the current position.

This method has linear complexity over the number of key entries between the current and the passed position in both underlying mappings used to interpolate. So if the passed position is near the current position this method has nearly constant complexity.

Implements inet::physicallayer::ConstMappingIterator.

840  {
841  leftIt->iterateTo(pos);
842  rightIt->iterateTo(pos);
843  }
virtual void iterateTo(const Argument &pos)=0
Iterates to the specified position.
ConstMappingIterator * rightIt
Iterator for the right Mapping to interpolate.
Definition: MappingUtils.h:763
ConstMappingIterator * leftIt
Iterator for the left Mapping to interpolate.
Definition: MappingUtils.h:761
virtual void inet::physicallayer::LinearIntplMappingIterator::jumpTo ( const Argument pos)
inlineoverridevirtual

Lets the iterator point to the passed position.

This method has logarithmic complexity over both of the underlying Mappings used to interpolate.

Implements inet::physicallayer::ConstMappingIterator.

823  {
824  leftIt->jumpTo(pos);
825  rightIt->jumpTo(pos);
826  }
ConstMappingIterator * rightIt
Iterator for the right Mapping to interpolate.
Definition: MappingUtils.h:763
virtual void jumpTo(const Argument &pos)=0
Lets the iterator point to the passed position.
ConstMappingIterator * leftIt
Iterator for the left Mapping to interpolate.
Definition: MappingUtils.h:761
virtual void inet::physicallayer::LinearIntplMappingIterator::jumpToBegin ( )
inlineoverridevirtual

This method isn't supported by an interpolated Mapping.

Implements inet::physicallayer::ConstMappingIterator.

805 { assert(false); }
virtual void inet::physicallayer::LinearIntplMappingIterator::next ( )
inlineoverridevirtual

This method isn't supported by an interpolated Mapping.

Implements inet::physicallayer::ConstMappingIterator.

809 { assert(false); }
LinearIntplMappingIterator& inet::physicallayer::LinearIntplMappingIterator::operator= ( const LinearIntplMappingIterator )
private

Assignment operator is not allowed.

virtual void inet::physicallayer::LinearIntplMappingIterator::setValue ( argument_value_cref_t  )
inlineoverridevirtual

This method isn't supported by an interpolated Mapping.

Implements inet::physicallayer::MappingIterator.

814 { assert(false); }

Member Data Documentation

argument_value_t inet::physicallayer::LinearIntplMappingIterator::factor
protected

The factor defining how strong the left and the right Mapping affect the interpolation.

ConstMappingIterator* inet::physicallayer::LinearIntplMappingIterator::leftIt
protected

Iterator for the left Mapping to interpolate.

Referenced by ~LinearIntplMappingIterator().

ConstMappingIterator* inet::physicallayer::LinearIntplMappingIterator::rightIt
protected

Iterator for the right Mapping to interpolate.

Referenced by ~LinearIntplMappingIterator().


The documentation for this class was generated from the following files: