INET Framework for OMNeT++/OMNEST
inet::physicallayer::BaseDelayedIterator< Base, Iterator > Class Template Reference

Common base for a Const- and NonConst-Iterator for a DelayedMapping. More...

#include <MappingUtils.h>

Inheritance diagram for inet::physicallayer::BaseDelayedIterator< Base, Iterator >:

Public Member Functions

 BaseDelayedIterator (Iterator *it, simtime_t_cref delay)
 
virtual ~BaseDelayedIterator ()
 
virtual const ArgumentgetNextPosition () const
 
virtual void jumpTo (const Argument &pos)
 
virtual void jumpToBegin ()
 
virtual void iterateTo (const Argument &pos)
 
virtual void next ()
 
virtual const ArgumentgetPosition () const
 

Protected Member Functions

Argument undelayPosition (const Argument &pos) const
 
Argument delayPosition (const Argument &pos) const
 
void updatePosition ()
 

Protected Attributes

simtime_t delay
 
Argument position
 
Argument nextPosition
 

Detailed Description

template<class Base, class Iterator>
class inet::physicallayer::BaseDelayedIterator< Base, Iterator >

Common base for a Const- and NonConst-Iterator for a DelayedMapping.

See also
BaseDelayedMapping
Author
Karl Wessel

Constructor & Destructor Documentation

template<class Base , class Iterator >
inet::physicallayer::BaseDelayedIterator< Base, Iterator >::BaseDelayedIterator ( Iterator *  it,
simtime_t_cref  delay 
)
inline
2720  :
2721  Base(it), delay(delay), position(), nextPosition()
2722  {
2723  updatePosition();
2724  }
simtime_t delay
Definition: MappingUtils.h:2693
Argument nextPosition
Definition: MappingUtils.h:2696
void updatePosition()
Definition: MappingUtils.h:2713
Argument position
Definition: MappingUtils.h:2695
template<class Base , class Iterator >
virtual inet::physicallayer::BaseDelayedIterator< Base, Iterator >::~BaseDelayedIterator ( )
inlinevirtual
2726 {}

Member Function Documentation

template<class Base , class Iterator >
Argument inet::physicallayer::BaseDelayedIterator< Base, Iterator >::delayPosition ( const Argument pos) const
inlineprotected
2707  {
2708  Argument res(pos);
2709  res.setTime(res.getTime() + delay);
2710  return res;
2711  }
simtime_t delay
Definition: MappingUtils.h:2693
template<class Base , class Iterator >
virtual const Argument& inet::physicallayer::BaseDelayedIterator< Base, Iterator >::getNextPosition ( ) const
inlinevirtual
2728 { return nextPosition; }
Argument nextPosition
Definition: MappingUtils.h:2696
template<class Base , class Iterator >
virtual const Argument& inet::physicallayer::BaseDelayedIterator< Base, Iterator >::getPosition ( ) const
inlinevirtual
2755  {
2756  return position;
2757  }
Argument position
Definition: MappingUtils.h:2695
template<class Base , class Iterator >
virtual void inet::physicallayer::BaseDelayedIterator< Base, Iterator >::iterateTo ( const Argument pos)
inlinevirtual
2743  {
2744  this->origIterator->iterateTo(undelayPosition(pos));
2745  updatePosition();
2746  }
Argument undelayPosition(const Argument &pos) const
Definition: MappingUtils.h:2699
void updatePosition()
Definition: MappingUtils.h:2713
template<class Base , class Iterator >
virtual void inet::physicallayer::BaseDelayedIterator< Base, Iterator >::jumpTo ( const Argument pos)
inlinevirtual
2731  {
2732  this->origIterator->jumpTo(undelayPosition(pos));
2733  updatePosition();
2734  }
Argument undelayPosition(const Argument &pos) const
Definition: MappingUtils.h:2699
void updatePosition()
Definition: MappingUtils.h:2713
template<class Base , class Iterator >
virtual void inet::physicallayer::BaseDelayedIterator< Base, Iterator >::jumpToBegin ( )
inlinevirtual
2737  {
2738  this->origIterator->jumpToBegin();
2739  updatePosition();
2740  }
void updatePosition()
Definition: MappingUtils.h:2713
template<class Base , class Iterator >
virtual void inet::physicallayer::BaseDelayedIterator< Base, Iterator >::next ( )
inlinevirtual
2749  {
2750  this->origIterator->next();
2751  updatePosition();
2752  }
void updatePosition()
Definition: MappingUtils.h:2713
template<class Base , class Iterator >
Argument inet::physicallayer::BaseDelayedIterator< Base, Iterator >::undelayPosition ( const Argument pos) const
inlineprotected
2700  {
2701  Argument res(pos);
2702  res.setTime(res.getTime() - delay);
2703  return res;
2704  }
simtime_t delay
Definition: MappingUtils.h:2693
template<class Base , class Iterator >
void inet::physicallayer::BaseDelayedIterator< Base, Iterator >::updatePosition ( )
inlineprotected
2714  {
2715  nextPosition = delayPosition(this->origIterator->getNextPosition());
2716  position = delayPosition(this->origIterator->getPosition());
2717  }
Argument delayPosition(const Argument &pos) const
Definition: MappingUtils.h:2706
Argument nextPosition
Definition: MappingUtils.h:2696
Argument position
Definition: MappingUtils.h:2695

Member Data Documentation

template<class Base , class Iterator >
simtime_t inet::physicallayer::BaseDelayedIterator< Base, Iterator >::delay
protected
template<class Base , class Iterator >
Argument inet::physicallayer::BaseDelayedIterator< Base, Iterator >::nextPosition
protected
template<class Base , class Iterator >
Argument inet::physicallayer::BaseDelayedIterator< Base, Iterator >::position
protected

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