Public Member Functions | Protected Types | Protected Attributes

TimeMapping< Interpolator > Class Template Reference
[mapping - classes representing mathematical mappings]

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>

Inherits Mapping.

Collaboration diagram for TimeMapping< Interpolator >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TimeMapping (InterpolationMethod intpl=LINEAR)
 Initializes the Mapping with the passed Interpolation method.
 TimeMapping (double outOfRangeVal, InterpolationMethod intpl=LINEAR)
 Initializes the Mapping with the passed Interpolation method.
virtual Mappingclone () const
 returns a deep copy of this mapping instance.
virtual double getValue (const Argument &pos) const
 Returns the value of this Function at the position specified by the passed Argument.
virtual void setValue (const Argument &pos, double value)
 Changes the value of the function at the specified position.
virtual MappingIteratorcreateIterator ()
 Returns a pointer of a new Iterator which is able to iterate over the function and can change the value the iterator points to.
virtual MappingIteratorcreateIterator (const Argument &pos)
 Returns a pointer of a new Iterator which is able to iterate over the function and can change the value the iterator points to.

Protected Types

typedef std::map< simtime_t,
double > 
MapType
 The type of the std::map used by the InterpolateableMap.
typedef InterpolateableMap
< simtime_t, double,
Interpolator< simtime_t,
double, MapType::value_type,
MapType::const_iterator > > 
ValueMap
 Defines the used InterpolateableMap and its template-parameters.

Protected Attributes

ValueMap entries
 Stores the key-entries defining the function.
bool isStepMapping
 Stores if this mapping represents a step function.

Detailed Description

template<template< class Key, class Value, class Pair, class Iterator > class Interpolator>
class 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

Definition at line 276 of file MappingUtils.h.


Member Function Documentation

template<template< class Key, class Value, class Pair, class Iterator > class Interpolator>
virtual MappingIterator* TimeMapping< Interpolator >::createIterator ( const Argument pos  )  [inline, virtual]

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 Mapping.

Definition at line 356 of file MappingUtils.h.

                                                               {
    return new TimeMappingIterator<Interpolator>(entries.findIntpl(pos.getTime()), isStepMapping);
  }

template<template< class Key, class Value, class Pair, class Iterator > class Interpolator>
virtual MappingIterator* TimeMapping< Interpolator >::createIterator (  )  [inline, virtual]

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 Mapping.

Definition at line 345 of file MappingUtils.h.

Referenced by UWBIRIEEE802154APathlossModel::filterSignal().

template<template< class Key, class Value, class Pair, class Iterator > class Interpolator>
virtual double TimeMapping< Interpolator >::getValue ( const Argument pos  )  const [inline, virtual]

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

This method has logarithmic complexity.

Implements ConstMapping.

Definition at line 324 of file MappingUtils.h.

                                                     {
    return *entries.getIntplValue(pos.getTime());
  }

template<template< class Key, class Value, class Pair, class Iterator > class Interpolator>
virtual void TimeMapping< Interpolator >::setValue ( const Argument pos,
double  value 
) [inline, virtual]

Changes the value of the function at the specified position.

This method has logarithmic complexity.

Implements Mapping.

Definition at line 334 of file MappingUtils.h.

Referenced by UWBIRStochasticPathlossModel::filterSignal(), PERModel::filterSignal(), IntensityModel::filterSignal(), and BreakpointPathlossModel::filterSignal().

                                                           {
    entries[pos.getTime()] = value;
  }


Member Data Documentation

template<template< class Key, class Value, class Pair, class Iterator > class Interpolator>
bool TimeMapping< Interpolator >::isStepMapping [protected]

Stores if this mapping represents a step function.

Assures that the steps are considered when iterating the mapping by adding a second key-entry as short as possible before every key entry set by the user. The additional key-entry defines the value the mapping has just before the key entry the user added.

Definition at line 298 of file MappingUtils.h.

Referenced by TimeMapping< Linear >::createIterator().


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