INET Framework for OMNeT++/OMNEST
inet::physicallayer::TimeMapping< Interpolator > Class Template Reference

Implements the Mapping-interface with an InterpolateableMap from simtime_t to double between which values can be interpolated to represent a Mapping with only time as domain. More...

#include <MappingUtils.h>

Inheritance diagram for inet::physicallayer::TimeMapping< Interpolator >:
inet::physicallayer::Mapping inet::physicallayer::ConstMapping

Public Member Functions

 TimeMapping ()
 Initializes the Mapping with the passed Interpolation method. More...
 
 TimeMapping (const TimeMapping< Interpolator > &o)
 
 TimeMapping (mapped_cref_type outOfRangeVal)
 Initializes the Mapping with the passed Interpolation method. More...
 
virtual ~TimeMapping ()
 
virtual Mapping * clone () const override
 returns a deep copy of this mapping instance. More...
 
virtual argument_value_t getValue (const Argument &pos) const override
 Returns the value of this Function at the position specified by the passed Argument. More...
 
virtual void setValue (const Argument &pos, argument_value_cref_t value) override
 Changes the value of the function at the specified position. More...
 
virtual MappingIterator * createIterator () override
 Returns a pointer of a new Iterator which is able to iterate over the function and can change the value the iterator points to. More...
 
virtual MappingIterator * createIterator (const Argument &pos) override
 Returns a pointer of a new Iterator which is able to iterate over the function and can change the value the iterator points to. More...
 
- Public Member Functions inherited from inet::physicallayer::Mapping
Mapping & operator= (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 ConstMappingIterator * createConstIterator () const override
 Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method. More...
 
virtual ConstMappingIterator * createConstIterator (const Argument &pos) const override
 Returns an ConstMappingIterator by use of the respective implementation of the "createIterator()"-method. More...
 
virtual ConstMapping * constClone () 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
ConstMapping & operator= (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 ()
 
argument_value_t operator[] (const Argument &pos) const
 Returns the value of this Mapping at the position specified by the passed Argument. More...
 
const DimensionSet & getDimensionSet () 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...
 

Protected Types

typedef InterpolateableMap< Interpolator< std::map< simtime_t, argument_value_t > > > interpolator_map_type
 The templated InterpolateableMap the underlying Mapping uses std::map as storage type. More...
 
typedef interpolator_map_type::interpolator_type interpolator_type
 
typedef interpolator_map_type::mapped_type mapped_type
 
typedef interpolator_map_type::mapped_cref_type mapped_cref_type
 
typedef interpolator_map_type::iterator_intpl iterator
 
typedef interpolator_map_type::const_iterator_intpl const_iterator
 

Protected Attributes

interpolator_map_type entries
 Stores the key-entries defining the function. More...
 
- Protected Attributes inherited from inet::physicallayer::ConstMapping
DimensionSet dimensions
 The dimensions of this mappings domain. More...
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::Mapping
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
 

Detailed Description

template<template< typename > class Interpolator>
class inet::physicallayer::TimeMapping< Interpolator >

Implements the Mapping-interface with an InterpolateableMap from simtime_t to double between which values can be interpolated to represent a Mapping with only time as domain.

Author
Karl Wessel

Member Typedef Documentation

template<template< typename > class Interpolator>
typedef interpolator_map_type::const_iterator_intpl inet::physicallayer::TimeMapping< Interpolator >::const_iterator
protected
template<template< typename > class Interpolator>
typedef InterpolateableMap<Interpolator<std::map<simtime_t, argument_value_t> > > inet::physicallayer::TimeMapping< Interpolator >::interpolator_map_type
protected

The templated InterpolateableMap the underlying Mapping uses std::map as storage type.

template<template< typename > class Interpolator>
typedef interpolator_map_type::interpolator_type inet::physicallayer::TimeMapping< Interpolator >::interpolator_type
protected
template<template< typename > class Interpolator>
typedef interpolator_map_type::iterator_intpl inet::physicallayer::TimeMapping< Interpolator >::iterator
protected
template<template< typename > class Interpolator>
typedef interpolator_map_type::mapped_cref_type inet::physicallayer::TimeMapping< Interpolator >::mapped_cref_type
protected
template<template< typename > class Interpolator>
typedef interpolator_map_type::mapped_type inet::physicallayer::TimeMapping< Interpolator >::mapped_type
protected

Constructor & Destructor Documentation

template<template< typename > class Interpolator>
inet::physicallayer::TimeMapping< Interpolator >::TimeMapping ( )
inline

Initializes the Mapping with the passed Interpolation method.

371  :
372  Mapping(), entries() {}
interpolator_map_type entries
Stores the key-entries defining the function.
Definition: MappingUtils.h:364
Mapping()
Initializes the Mapping with the time dimension as domain.
Definition: MappingBase.h:1299
template<template< typename > class Interpolator>
inet::physicallayer::TimeMapping< Interpolator >::TimeMapping ( const TimeMapping< Interpolator > &  o)
inline
373  :
374  Mapping(o), entries(o.entries) {}
interpolator_map_type entries
Stores the key-entries defining the function.
Definition: MappingUtils.h:364
Mapping()
Initializes the Mapping with the time dimension as domain.
Definition: MappingBase.h:1299
template<template< typename > class Interpolator>
inet::physicallayer::TimeMapping< Interpolator >::TimeMapping ( mapped_cref_type  outOfRangeVal)
inline

Initializes the Mapping with the passed Interpolation method.

379  :
380  Mapping(), entries(outOfRangeVal) {}
interpolator_map_type entries
Stores the key-entries defining the function.
Definition: MappingUtils.h:364
Mapping()
Initializes the Mapping with the time dimension as domain.
Definition: MappingBase.h:1299
template<template< typename > class Interpolator>
virtual inet::physicallayer::TimeMapping< Interpolator >::~TimeMapping ( )
inlinevirtual
382 {}

Member Function Documentation

template<template< typename > class Interpolator>
virtual Mapping* inet::physicallayer::TimeMapping< Interpolator >::clone ( ) const
inlineoverridevirtual

returns a deep copy of this mapping instance.

Implements inet::physicallayer::Mapping.

386 { return new TimeMapping<Interpolator>(*this); }
template<template< typename > class Interpolator>
virtual MappingIterator* inet::physicallayer::TimeMapping< Interpolator >::createIterator ( )
inlineoverridevirtual

Returns a pointer of a new Iterator which is able to iterate over the function and can change the value the iterator points to.

Note: The caller of this method has to delete the returned Iterator pointer if it isn't used anymore.

Implements inet::physicallayer::Mapping.

418  {
419  return new TimeMappingIterator<Interpolator>(entries.beginIntpl());
420  }
interpolator_map_type entries
Stores the key-entries defining the function.
Definition: MappingUtils.h:364
const_iterator_intpl beginIntpl() const
Definition: Interpolation.h:901
template<template< typename > class Interpolator>
virtual MappingIterator* inet::physicallayer::TimeMapping< Interpolator >::createIterator ( const Argument &  pos)
inlineoverridevirtual

Returns a pointer of a new Iterator which is able to iterate over the function and can change the value the iterator points to.

Note: The caller of this method has to delete the returned Iterator pointer if it isn't used anymore.

Implements inet::physicallayer::Mapping.

430  {
431  return new TimeMappingIterator<Interpolator>(entries.findIntpl(pos.getTime()));
432  }
interpolator_map_type entries
Stores the key-entries defining the function.
Definition: MappingUtils.h:364
const_iterator_intpl findIntpl(key_cref_type pos) const
Definition: Interpolation.h:892
template<template< typename > class Interpolator>
virtual argument_value_t inet::physicallayer::TimeMapping< Interpolator >::getValue ( const Argument &  pos) const
inlineoverridevirtual

Returns the value of this Function at the position specified by the passed Argument.

This method has logarithmic complexity.

Implements inet::physicallayer::ConstMapping.

395  {
396  return *entries.getIntplValue(pos.getTime());
397  }
interpolator_map_type entries
Stores the key-entries defining the function.
Definition: MappingUtils.h:364
interpolated getIntplValue(key_cref_type pos) const
Definition: Interpolation.h:887
template<template< typename > class Interpolator>
virtual void inet::physicallayer::TimeMapping< Interpolator >::setValue ( const Argument &  pos,
argument_value_cref_t  value 
)
inlineoverridevirtual

Changes the value of the function at the specified position.

This method has logarithmic complexity.

406  {
407  entries[pos.getTime()] = value;
408  }
interpolator_map_type entries
Stores the key-entries defining the function.
Definition: MappingUtils.h:364

Member Data Documentation

template<template< typename > class Interpolator>
interpolator_map_type inet::physicallayer::TimeMapping< Interpolator >::entries
protected

Stores the key-entries defining the function.


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