INET Framework for OMNeT++/OMNEST
inet::physicallayer::InterpolatorBase< _ContainerType > Class Template Referenceabstract

#include <Interpolation.h>

Inheritance diagram for inet::physicallayer::InterpolatorBase< _ContainerType >:
inet::physicallayer::Linear< _ContainerType > inet::physicallayer::Nearest< _ContainerType > inet::physicallayer::NextSmaller< _ContainerType >

Public Types

typedef _ContainerType 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

 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...
 
virtual interpolated operator() (const const_iterator &first, const const_iterator &last, key_cref_type pos, const_iterator upperBound) const =0
 Functor operator of this class which interpolates the value at the passed position using the values between the passed Iterators. More...
 
void setOutOfRangeVal (mapped_cref_type oorv)
 Getter and Setter method for out of range value. More...
 
mapped_cref_type getOutOfRangeVal (void) const
 

Public Attributes

comparator_type comp
 Comparator for STL functions. More...
 

Protected Member Functions

interpolated asInterpolated (mapped_cref_type rVal, bool bIsOutOfRange, bool bIsInterpolated=true) const
 

Protected Attributes

bool continueOutOfRange
 
interpolated outOfRangeVal
 

Member Typedef Documentation

template<class _ContainerType>
typedef PairLess<pair_type, key_type> inet::physicallayer::InterpolatorBase< _ContainerType >::comparator_type
template<class _ContainerType>
typedef storage_type::const_iterator inet::physicallayer::InterpolatorBase< _ContainerType >::const_iterator
template<class _ContainerType>
typedef storage_type inet::physicallayer::InterpolatorBase< _ContainerType >::container_type
template<class _ContainerType>
typedef Interpolated<mapped_type> inet::physicallayer::InterpolatorBase< _ContainerType >::interpolated
template<class _ContainerType>
typedef storage_type::iterator inet::physicallayer::InterpolatorBase< _ContainerType >::iterator
template<class _ContainerType>
typedef const key_type& inet::physicallayer::InterpolatorBase< _ContainerType >::key_cref_type
template<class _ContainerType>
typedef storage_type::key_type inet::physicallayer::InterpolatorBase< _ContainerType >::key_type
template<class _ContainerType>
typedef const mapped_type& inet::physicallayer::InterpolatorBase< _ContainerType >::mapped_cref_type
template<class _ContainerType>
typedef storage_type::mapped_type inet::physicallayer::InterpolatorBase< _ContainerType >::mapped_type
template<class _ContainerType>
typedef storage_type::value_type inet::physicallayer::InterpolatorBase< _ContainerType >::pair_type
template<class _ContainerType>
typedef _ContainerType inet::physicallayer::InterpolatorBase< _ContainerType >::storage_type

Constructor & Destructor Documentation

template<class _ContainerType>
inet::physicallayer::InterpolatorBase< _ContainerType >::InterpolatorBase ( )
inline
156  :
storage_type::mapped_type mapped_type
Definition: Interpolation.h:139
comparator_type comp
Comparator for STL functions.
Definition: Interpolation.h:149
interpolated outOfRangeVal
Definition: Interpolation.h:153
bool continueOutOfRange
Definition: Interpolation.h:152
template<class _ContainerType>
inet::physicallayer::InterpolatorBase< _ContainerType >::InterpolatorBase ( mapped_cref_type  oorv)
inline
159  :
160  comp(), continueOutOfRange(false), outOfRangeVal(oorv) {}
comparator_type comp
Comparator for STL functions.
Definition: Interpolation.h:149
interpolated outOfRangeVal
Definition: Interpolation.h:153
bool continueOutOfRange
Definition: Interpolation.h:152
template<class _ContainerType>
virtual inet::physicallayer::InterpolatorBase< _ContainerType >::~InterpolatorBase ( )
inlinevirtual
162 {}

Member Function Documentation

template<class _ContainerType>
interpolated inet::physicallayer::InterpolatorBase< _ContainerType >::asInterpolated ( mapped_cref_type  rVal,
bool  bIsOutOfRange,
bool  bIsInterpolated = true 
) const
inlineprotected
236  {
237  if (!bIsOutOfRange)
238  return interpolated(rVal, bIsInterpolated);
239 
240  if (continueOutOfRange)
241  return interpolated(rVal);
242  else
243  return outOfRangeVal;
244  }
interpolated outOfRangeVal
Definition: Interpolation.h:153
bool continueOutOfRange
Definition: Interpolation.h:152
Interpolated< mapped_type > interpolated
Definition: Interpolation.h:145
template<class _ContainerType>
bool inet::physicallayer::InterpolatorBase< _ContainerType >::continueAtOutOfRange ( void  ) const
inline
181  {
182  return continueOutOfRange;
183  }
bool continueOutOfRange
Definition: Interpolation.h:152
template<class _ContainerType>
mapped_cref_type inet::physicallayer::InterpolatorBase< _ContainerType >::getOutOfRangeVal ( void  ) const
inline
174  {
175  return *(&outOfRangeVal);
176  }
interpolated outOfRangeVal
Definition: Interpolation.h:153
template<class _ContainerType>
virtual bool inet::physicallayer::InterpolatorBase< _ContainerType >::isStepping ( ) const
inlinevirtual

Represents the interpolator a stepping function.

Reimplemented in inet::physicallayer::NextSmaller< _ContainerType >.

210 { return false; }
template<class _ContainerType>
interpolated inet::physicallayer::InterpolatorBase< _ContainerType >::operator() ( const const_iterator first,
const const_iterator last,
key_cref_type  pos 
) const
inline

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

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

199  {
200  if (first == last) {
201  return outOfRangeVal;
202  }
203 
204  const_iterator right = std::upper_bound(first, last, pos, comp);
205 
206  return operator()(first, last, pos, right);
207  }
comparator_type comp
Comparator for STL functions.
Definition: Interpolation.h:149
interpolated outOfRangeVal
Definition: Interpolation.h:153
storage_type::const_iterator const_iterator
Definition: Interpolation.h:143
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 b...
Definition: Interpolation.h:196
template<class _ContainerType>
virtual interpolated inet::physicallayer::InterpolatorBase< _ContainerType >::operator() ( const const_iterator first,
const const_iterator last,
key_cref_type  pos,
const_iterator  upperBound 
) const
pure virtual

Functor operator of this class which 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 to 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".

Returns
The value of a element between first and last which is nearest to pos and the position is of the element is less or equal to pos.

Implemented in inet::physicallayer::Linear< std::map< Argument::mapped_type, Mapping * > >, inet::physicallayer::Linear< _ContainerType >, inet::physicallayer::Linear< std::map< argument_value_t, Mapping * > >, inet::physicallayer::Nearest< _ContainerType >, and inet::physicallayer::NextSmaller< _ContainerType >.

template<class _ContainerType>
void inet::physicallayer::InterpolatorBase< _ContainerType >::setOutOfRangeVal ( mapped_cref_type  oorv)
inline

Getter and Setter method for out of range value.

168  {
169  continueOutOfRange = false;
170  outOfRangeVal = interpolated(oorv);
171  }
interpolated outOfRangeVal
Definition: Interpolation.h:153
bool continueOutOfRange
Definition: Interpolation.h:152
Interpolated< mapped_type > interpolated
Definition: Interpolation.h:145

Member Data Documentation

template<class _ContainerType>
comparator_type inet::physicallayer::InterpolatorBase< _ContainerType >::comp

Comparator for STL functions.

template<class _ContainerType>
bool inet::physicallayer::InterpolatorBase< _ContainerType >::continueOutOfRange
protected
template<class _ContainerType>
interpolated inet::physicallayer::InterpolatorBase< _ContainerType >::outOfRangeVal
protected

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