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

Wraps an ConstMappingIterator into a MappingIterator interface. More...

#include <MappingUtils.h>

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

Public Member Functions

 ConstMappingIteratorWrapper (ConstMappingIterator *it)
 
virtual ~ConstMappingIteratorWrapper ()
 
virtual void setValue (argument_value_cref_t) override
 Changes the value of the Mapping at the current position. More...
 
virtual const ArgumentgetNextPosition () const override
 Returns the position the next call to "next()" of this Iterator would iterate to. More...
 
virtual void jumpTo (const Argument &pos) override
 Lets the iterator point to the passed position. More...
 
virtual void jumpToBegin () override
 Lets the iterator point to the begin of the mapping. More...
 
virtual void iterateTo (const Argument &pos) override
 Iterates to the specified position. More...
 
virtual void next () override
 Iterates to the next position of the Mapping. More...
 
virtual bool inRange () const override
 Returns true if the current position of the iterator is in range of the function. More...
 
virtual bool hasNext () const override
 Returns true if the iterator has a next value it can iterate to on a call to "next()". More...
 
virtual const ArgumentgetPosition () const override
 Returns the current position of the iterator. More...
 
virtual argument_value_t getValue () const override
 Returns the value of the Mapping at the current position. 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

ConstMappingIterator *const iterator
 

Private Member Functions

 ConstMappingIteratorWrapper (const ConstMappingIteratorWrapper &)
 Copy constructor is not allowed. More...
 
ConstMappingIteratorWrapperoperator= (const ConstMappingIteratorWrapper &)
 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

Wraps an ConstMappingIterator into a MappingIterator interface.

Assumes that "setValue()" of the MappingIterator interface will never be called.

Author
Karl Wessel

Constructor & Destructor Documentation

inet::physicallayer::ConstMappingIteratorWrapper::ConstMappingIteratorWrapper ( const ConstMappingIteratorWrapper )
private

Copy constructor is not allowed.

inet::physicallayer::ConstMappingIteratorWrapper::ConstMappingIteratorWrapper ( ConstMappingIterator it)
inline
1276  :
1277  MappingIterator(), iterator(it) {}
MappingIterator()
Definition: MappingBase.h:1221
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual inet::physicallayer::ConstMappingIteratorWrapper::~ConstMappingIteratorWrapper ( )
inlinevirtual
1280  {
1281  if (iterator)
1282  delete iterator;
1283  }
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265

Member Function Documentation

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

Returns the position the next call to "next()" of this Iterator would iterate to.

Implements inet::physicallayer::ConstMappingIterator.

1287 { return iterator->getNextPosition(); }
virtual const Argument & getNextPosition() const =0
Returns the position the next call to "next()" of this Iterator would iterate to. ...
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual const Argument& inet::physicallayer::ConstMappingIteratorWrapper::getPosition ( ) const
inlineoverridevirtual

Returns the current position of the iterator.

Implements inet::physicallayer::ConstMappingIterator.

1301 { return iterator->getPosition(); }
virtual const Argument & getPosition() const =0
Returns the current position of the iterator.
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual argument_value_t inet::physicallayer::ConstMappingIteratorWrapper::getValue ( ) const
inlineoverridevirtual

Returns the value of the Mapping at the current position.

The complexity of this method should be constant for every implementation.

Implements inet::physicallayer::ConstMappingIterator.

1303 { return iterator->getValue(); }
virtual argument_value_t getValue() const =0
Returns the value of the Mapping at the current position.
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual bool inet::physicallayer::ConstMappingIteratorWrapper::hasNext ( ) const
inlineoverridevirtual

Returns true if the iterator has a next value it can iterate to on a call to "next()".

Implements inet::physicallayer::ConstMappingIterator.

1299 { return iterator->hasNext(); }
virtual bool hasNext() const =0
Returns true if the iterator has a next value it can iterate to on a call to "next()".
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual bool inet::physicallayer::ConstMappingIteratorWrapper::inRange ( ) const
inlineoverridevirtual

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 inet::physicallayer::ConstMappingIterator.

1297 { return iterator->inRange(); }
virtual bool inRange() const =0
Returns true if the current position of the iterator is in range of the function. ...
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual void inet::physicallayer::ConstMappingIteratorWrapper::iterateTo ( const Argument pos)
inlineoverridevirtual

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.

Implements inet::physicallayer::ConstMappingIterator.

1293 { iterator->iterateTo(pos); }
virtual void iterateTo(const Argument &pos)=0
Iterates to the specified position.
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual void inet::physicallayer::ConstMappingIteratorWrapper::jumpTo ( const Argument pos)
inlineoverridevirtual

Lets the iterator point to the passed position.

The passed new position can be at arbitrary places.

Implements inet::physicallayer::ConstMappingIterator.

1289 { iterator->jumpTo(pos); }
virtual void jumpTo(const Argument &pos)=0
Lets the iterator point to the passed position.
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual void inet::physicallayer::ConstMappingIteratorWrapper::jumpToBegin ( )
inlineoverridevirtual

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 inet::physicallayer::ConstMappingIterator.

1291 { iterator->jumpToBegin(); }
virtual void jumpToBegin()=0
Lets the iterator point to the begin of the mapping.
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
virtual void inet::physicallayer::ConstMappingIteratorWrapper::next ( )
inlineoverridevirtual

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 inet::physicallayer::ConstMappingIterator.

1295 { iterator->next(); }
virtual void next()=0
Iterates to the next position of the Mapping.
ConstMappingIterator *const iterator
Definition: MappingUtils.h:1265
ConstMappingIteratorWrapper& inet::physicallayer::ConstMappingIteratorWrapper::operator= ( const ConstMappingIteratorWrapper )
private

Assignment operator is not allowed.

virtual void inet::physicallayer::ConstMappingIteratorWrapper::setValue ( argument_value_cref_t  value)
inlineoverridevirtual

Changes the value of the Mapping at the current position.

Implementations of this method should provide constant complexity.

Implements inet::physicallayer::MappingIterator.

1285 { assert(false); }

Member Data Documentation

ConstMappingIterator* const inet::physicallayer::ConstMappingIteratorWrapper::iterator
protected

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