INET Framework for OMNeT++/OMNEST
inet::physicallayer::Linear< std::map< Argument::mapped_type, Mapping * > > Class Template Reference

Specialization of the Linear-template which provides LinearInterpolation for pointer two Mappings. More...

#include <MappingUtils.h>

Inheritance diagram for inet::physicallayer::Linear< std::map< Argument::mapped_type, Mapping * > >:
inet::physicallayer::InterpolatorBase< std::map< Argument::mapped_type, Mapping * > >

Public Types

typedef base_class_type::storage_type storage_type
 
typedef base_class_type::container_type container_type
 
typedef base_class_type::key_type key_type
 
typedef base_class_type::key_cref_type key_cref_type
 
typedef base_class_type::mapped_type mapped_type
 
typedef base_class_type::mapped_cref_type mapped_cref_type
 
typedef base_class_type::pair_type pair_type
 
typedef base_class_type::iterator iterator
 
typedef base_class_type::const_iterator const_iterator
 
typedef base_class_type::comparator_type comparator_type
 
typedef base_class_type::interpolated interpolated
 
- Public Types inherited from inet::physicallayer::InterpolatorBase< std::map< Argument::mapped_type, Mapping * > >
typedef std::map< Argument::mapped_type, Mapping * > storage_type
 
typedef storage_type container_type
 
typedef storage_type::key_type key_type
 
typedef const key_typekey_cref_type
 
typedef storage_type::mapped_type mapped_type
 
typedef const mapped_typemapped_cref_type
 
typedef storage_type::value_type pair_type
 
typedef storage_type::iterator iterator
 
typedef storage_type::const_iterator const_iterator
 
typedef PairLess< pair_type, key_typecomparator_type
 
typedef Interpolated< mapped_typeinterpolated
 

Public Member Functions

 Linear ()
 
 Linear (mapped_cref_type oorv)
 
 Linear (const _Self &o)
 
virtual ~Linear ()
 
virtual interpolated operator() (const const_iterator &first, const const_iterator &last, key_cref_type pos, const_iterator upperBound) const override
 Functor operator of this class which linear interpolates the value at the passed position using the values between the passed Iterators. More...
 
- Public Member Functions inherited from inet::physicallayer::InterpolatorBase< std::map< Argument::mapped_type, Mapping * > >
 InterpolatorBase ()
 
 InterpolatorBase (mapped_cref_type oorv)
 
virtual ~InterpolatorBase ()
 
bool continueAtOutOfRange (void) const
 
interpolated operator() (const const_iterator &first, const const_iterator &last, key_cref_type pos) const
 Functor operator of this class which interpolates the value at the passed position using the values between the passed Iterators. More...
 
virtual bool isStepping () const
 Represents the interpolator a stepping function. More...
 
void setOutOfRangeVal (mapped_cref_type oorv)
 Getter and Setter method for out of range value. More...
 
mapped_cref_type getOutOfRangeVal (void) const
 

Protected Types

typedef InterpolatorBase< std::map< Argument::mapped_type, Mapping * > > base_class_type
 
typedef Linear< std::map< Argument::mapped_type, Mapping * > > _Self
 

Static Protected Member Functions

static ConstMapping::argument_value_t linearInterpolationFactor (key_cref_type t, key_cref_type t0, key_cref_type t1)
 calculates the linear interpolation factor used for the created LinearIntplMappings. More...
 

Additional Inherited Members

- Public Attributes inherited from inet::physicallayer::InterpolatorBase< std::map< Argument::mapped_type, Mapping * > >
comparator_type comp
 Comparator for STL functions. More...
 
- Protected Member Functions inherited from inet::physicallayer::InterpolatorBase< std::map< Argument::mapped_type, Mapping * > >
interpolated asInterpolated (mapped_cref_type rVal, bool bIsOutOfRange, bool bIsInterpolated=true) const
 
- Protected Attributes inherited from inet::physicallayer::InterpolatorBase< std::map< Argument::mapped_type, Mapping * > >
bool continueOutOfRange
 
interpolated outOfRangeVal
 

Detailed Description

template<>
class inet::physicallayer::Linear< std::map< Argument::mapped_type, Mapping * > >

Specialization of the Linear-template which provides LinearInterpolation for pointer two Mappings.

Used by MultiDimMapping.

Author
Karl Wessel

Member Typedef Documentation

Constructor & Destructor Documentation

1135  :
1136  base_class_type() {}
InterpolatorBase< std::map< Argument::mapped_type, Mapping * > > base_class_type
Definition: MappingUtils.h:1118
1138  :
1139  base_class_type(oorv) {}
InterpolatorBase< std::map< Argument::mapped_type, Mapping * > > base_class_type
Definition: MappingUtils.h:1118
inet::physicallayer::Linear< std::map< Argument::mapped_type, Mapping * > >::Linear ( const _Self o)
inline
1141  :
1142  base_class_type(o) {}
InterpolatorBase< std::map< Argument::mapped_type, Mapping * > > base_class_type
Definition: MappingUtils.h:1118
virtual inet::physicallayer::Linear< std::map< Argument::mapped_type, Mapping * > >::~Linear ( )
inlinevirtual
1144 {}

Member Function Documentation

static ConstMapping::argument_value_t inet::physicallayer::Linear< std::map< Argument::mapped_type, Mapping * > >::linearInterpolationFactor ( key_cref_type  t,
key_cref_type  t0,
key_cref_type  t1 
)
inlinestaticprotected

calculates the linear interpolation factor used for the created LinearIntplMappings.

1192  {
1193  assert((t0 <= t && t <= t1) || (t0 >= t && t >= t1));
1194  if (t0 == t1) {
1195  return 0;
1196  }
1197  return cast_it<ConstMapping::argument_value_t>((t - t0) / (t1 - t0));
1198  }
virtual interpolated inet::physicallayer::Linear< std::map< Argument::mapped_type, Mapping * > >::operator() ( const const_iterator first,
const const_iterator last,
key_cref_type  pos,
const_iterator  upperBound 
) const
inlineoverridevirtual

Functor operator of this class which linear interpolates the value at the passed position using the values between the passed Iterators.

The upperBound-iterator has to point two the entry next bigger as the passed position to interpolate.

The returned instance of interpolated represents the result. Which can be either an actual entry of the interpolated map (if the position two interpolate was exactly that. Or it can be an interpolated value, if the passed position was between two entries of the map. This state can be retrieved with the "isInterpolated"-Member of the returned "interpolated".

Implements inet::physicallayer::InterpolatorBase< std::map< Argument::mapped_type, Mapping * > >.

1165  {
1166  if (first == last) {
1168  }
1169  if (upperBound == first) {
1170  return asInterpolated(upperBound->second, true);
1171  }
1172 
1173  const_iterator right = upperBound;
1174  const_iterator left = --upperBound;
1175 
1176  if (left->first == pos)
1177  return asInterpolated(left->second, false, false);
1178 
1179  if (right == last) {
1180  return asInterpolated(left->second, true);
1181  }
1182 
1183  return interpolated(LinearIntplMapping(left->second, right->second, linearInterpolationFactor(pos, left->first, right->first)));
1184  }
base_class_type::interpolated interpolated
Definition: MappingUtils.h:1132
interpolated outOfRangeVal
Definition: Interpolation.h:153
static ConstMapping::argument_value_t linearInterpolationFactor(key_cref_type t, key_cref_type t0, key_cref_type t1)
calculates the linear interpolation factor used for the created LinearIntplMappings.
Definition: MappingUtils.h:1191
interpolated asInterpolated(mapped_cref_type rVal, bool bIsOutOfRange, bool bIsInterpolated=true) const
Definition: Interpolation.h:235
base_class_type::const_iterator const_iterator
Definition: MappingUtils.h:1130

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