INET Framework for OMNeT++/OMNEST
inet::physicallayer::Mapping Class Referenceabstract

Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type. More...

#include <MappingBase.h>

Inheritance diagram for inet::physicallayer::Mapping:
inet::physicallayer::ConstMapping inet::physicallayer::BaseDelayedMapping< Mapping > inet::physicallayer::ConstMappingWrapper inet::physicallayer::FrequencyMapping< Interpolator > inet::physicallayer::LinearIntplMapping inet::physicallayer::MultiDimMapping< Interpolator > inet::physicallayer::TimeMapping< Interpolator > inet::physicallayer::MultiDimMapping< Linear > inet::physicallayer::DelayedMapping inet::physicallayer::FilledUpMapping

Public Types

enum  InterpolationMethod { STEPS, NEAREST, LINEAR }
 Types of interpolation methods for mappings. More...
 
- Public Types inherited from inet::physicallayer::ConstMapping
typedef Argument::mapped_type argument_value_t
 
typedef Argument::mapped_type_cref argument_value_cref_t
 

Public Member Functions

Mappingoperator= (const Mapping &copy)
 Mapping assignment operator. More...
 
void swap (Mapping &s)
 Swaps data with another Mapping. More...
 
 Mapping (const DimensionSet &dims)
 Initializes the Mapping with the passed DimensionSet as domain. More...
 
 Mapping ()
 Initializes the Mapping with the time dimension as domain. More...
 
 Mapping (const Mapping &o)
 
virtual ~Mapping ()
 
virtual void setValue (const Argument &pos, argument_value_cref_t value)=0
 Changes the value of the Mapping at the specified position. More...
 
virtual void appendValue (const Argument &pos, argument_value_cref_t value)
 Appends the passed value at the passed position to the mapping. More...
 
virtual MappingIteratorcreateIterator ()=0
 Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change it. More...
 
virtual MappingIteratorcreateIterator (const Argument &pos)=0
 Returns a pointer of a new Iterator which is able to iterate over the function and can change it. More...
 
virtual ConstMappingIteratorcreateConstIterator () const override
 Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method. More...
 
virtual ConstMappingIteratorcreateConstIterator (const Argument &pos) const override
 Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method. More...
 
virtual Mappingclone () const =0
 Returns a deep copy of this Mapping. More...
 
virtual ConstMappingconstClone () const override
 Returns a deep const copy of this mapping by using the according "clone()"-implementation. More...
 
- Public Member Functions inherited from inet::physicallayer::ConstMapping
ConstMappingoperator= (const ConstMapping &copy)
 ConstMapping assignment operator. More...
 
void swap (ConstMapping &s)
 Swaps data with another ConstMapping. More...
 
 ConstMapping ()
 Initializes the ConstMapping with a the time dimension as domain. More...
 
 ConstMapping (const ConstMapping &o)
 
 ConstMapping (const DimensionSet &dimSet)
 Initializes the ConstMapping with the passed DimensionSet as Domain. More...
 
virtual ~ConstMapping ()
 
virtual argument_value_t getValue (const Argument &pos) const =0
 Returns the value of this Mapping at the position specified by the passed Argument. More...
 
argument_value_t operator[] (const Argument &pos) const
 Returns the value of this Mapping at the position specified by the passed Argument. More...
 
const DimensionSetgetDimensionSet () const
 Returns this Mappings domain as DimensionSet. More...
 
template<class stream >
stream & print (stream &out, argument_value_cref_t lTimeScale=argument_value_t(1), argument_value_cref_t lLeftColScale=Argument::MappedOne, const std::string &sTableHead=std::string("o\\ms"), const Dimension *const pOnlyDim=nullptr) const
 Prints the Mapping to an output stream. More...
 

Additional Inherited Members

- Protected Attributes inherited from inet::physicallayer::ConstMapping
DimensionSet dimensions
 The dimensions of this mappings domain. More...
 

Detailed Description

Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.

This class extends the ConstMapping interface with write access.

See ConstMapping for details.

Author
Karl Wessel

Member Enumeration Documentation

Types of interpolation methods for mappings.

Enumerator
STEPS 

interpolates with next lower entry

NEAREST 

interpolates with nearest entry

LINEAR 

interpolates linear with next lower and next upper entry constant before the first and after the last entry

1249  {
1251  STEPS,
1253  NEAREST,
1256  LINEAR
1257  };
interpolates with nearest entry
Definition: MappingBase.h:1253
interpolates with next lower entry
Definition: MappingBase.h:1251
interpolates linear with next lower and next upper entry constant before the first and after the last...
Definition: MappingBase.h:1256

Constructor & Destructor Documentation

inet::physicallayer::Mapping::Mapping ( const DimensionSet dims)
inline

Initializes the Mapping with the passed DimensionSet as domain.

The passed DimensionSet has to contain the time dimension!

1293  :
1294  ConstMapping(dims) {}
ConstMapping()
Initializes the ConstMapping with a the time dimension as domain.
Definition: MappingBase.h:935
inet::physicallayer::Mapping::Mapping ( )
inline

Initializes the Mapping with the time dimension as domain.

1299  :
1300  ConstMapping() {}
ConstMapping()
Initializes the ConstMapping with a the time dimension as domain.
Definition: MappingBase.h:935
inet::physicallayer::Mapping::Mapping ( const Mapping o)
inline
1302  :
1303  ConstMapping(o) {}
ConstMapping()
Initializes the ConstMapping with a the time dimension as domain.
Definition: MappingBase.h:935
virtual inet::physicallayer::Mapping::~Mapping ( )
inlinevirtual
1305 {}

Member Function Documentation

virtual void inet::physicallayer::Mapping::appendValue ( const Argument pos,
argument_value_cref_t  value 
)
inlinevirtual

Appends the passed value at the passed position to the mapping.

This method assumes that the passed position is after the last key entry of the mapping.

Depending on the implementation of the underlying method this method could be faster or at least as fast as the "setValue()"-method.

Implementations of the Mapping interface can override this method if appending values to the end of the mapping could be implemented faster than the "setValue()" method. Otherwise this method just calls the "setValue()"-method implementation.

Referenced by inet::physicallayer::FilledUpMapping::appendValue().

1329  {
1330  setValue(pos, value);
1331  }
virtual void setValue(const Argument &pos, argument_value_cref_t value)=0
Changes the value of the Mapping at the specified position.
virtual ConstMapping* inet::physicallayer::Mapping::constClone ( ) const
inlineoverridevirtual

Returns a deep const copy of this mapping by using the according "clone()"-implementation.

Implements inet::physicallayer::ConstMapping.

Reimplemented in inet::physicallayer::ConstMappingWrapper.

1378 { return clone(); }
virtual Mapping * clone() const =0
Returns a deep copy of this Mapping.
virtual ConstMappingIterator* inet::physicallayer::Mapping::createConstIterator ( ) const
inlineoverridevirtual

Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method.

Override this method if your ConstIterator differs from the normal iterator.

Implements inet::physicallayer::ConstMapping.

Reimplemented in inet::physicallayer::BaseDelayedMapping< Mapping >, and inet::physicallayer::ConstMappingWrapper.

1354  {
1355  return dynamic_cast<ConstMappingIterator *>(const_cast<Mapping *>(this)->createIterator());
1356  }
virtual MappingIterator * createIterator()=0
Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change it...
Mapping()
Initializes the Mapping with the time dimension as domain.
Definition: MappingBase.h:1299
virtual ConstMappingIterator* inet::physicallayer::Mapping::createConstIterator ( const Argument pos) const
inlineoverridevirtual

Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method.

Override this method if your ConstIterator differs from the normal iterator.

Implements inet::physicallayer::ConstMapping.

Reimplemented in inet::physicallayer::BaseDelayedMapping< Mapping >, and inet::physicallayer::ConstMappingWrapper.

1365  {
1366  return dynamic_cast<ConstMappingIterator *>(const_cast<Mapping *>(this)->createIterator(pos));
1367  }
virtual MappingIterator * createIterator()=0
Returns a pointer of a new Iterator which is able to iterate over the Mapping and can change it...
Mapping()
Initializes the Mapping with the time dimension as domain.
Definition: MappingBase.h:1299
virtual MappingIterator* inet::physicallayer::Mapping::createIterator ( const Argument pos)
pure virtual
Mapping& inet::physicallayer::Mapping::operator= ( const Mapping copy)
inline

Mapping assignment operator.

Parameters
copyA Mapping of identical element and allocator types.

All the elements of copy are copied.

1267  {
1269  return *this;
1270  }
ConstMapping & operator=(const ConstMapping &copy)
ConstMapping assignment operator.
Definition: MappingBase.h:888
void inet::physicallayer::Mapping::swap ( Mapping s)
inline

Swaps data with another Mapping.

Parameters
sA Mapping of the same element and allocator types.

This exchanges the elements between two DimensionSet's in constant time. Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function.

Referenced by inet::physicallayer::LinearIntplMapping::swap().

1281  {
1282  ConstMapping::swap(s); // swap the base class members
1283  /* Swap all D members */
1284  }
value< double, units::s > s
Definition: Units.h:1049
void swap(ConstMapping &s)
Swaps data with another ConstMapping.
Definition: MappingBase.h:902

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