INET Framework for OMNeT++/OMNEST
inet::physicallayer::Interpolated< Mapping * > Class Template Reference

Helper class (-specialization) for multiDimMapping which is used by an InterpolateableMap as return value of the "getValue()" - method. More...

#include <MappingUtils.h>

Public Member Functions

 Interpolated (const LinearIntplMapping &m)
 Initializes this Interpolated instance to represent the passed Interpolated Mapping. More...
 
 Interpolated (value_type v, bool isIntpl=true)
 Initializes this Interpolated instance to represent the Mapping the passed pointer points to and with the passed isIntpl value. More...
 
 Interpolated (const _Self &o)
 Copy-constructor which assures that the internal storage is used correctly. More...
 
 ~Interpolated ()
 
const _Selfoperator= (const _Self &o)
 Assignment operator which assures that the internal storage is copied correctly. More...
 
value_ref_type operator* ()
 Dereferences this Interpolated to the represented value (works like dereferencing an std::iterator). More...
 
value_ptr_type operator-> ()
 Dereferences this Interpolated to the represented value (works like dereferencing an std::iterator). More...
 
bool operator== (const _Self &other) const
 Two Interpolated<Mapping*> are compared equal if the pointer to the represented Mapping is the same as well as the "isInterpolated" value. More...
 
bool operator!= (const _Self &other) const
 Two Interpolated<Mapping*> are compared non equal if the pointer to the represented Mapping differs or the "isInterpolated" value. More...
 

Public Attributes

bool isInterpolated
 Stores if the underlying Mapping is interpolated or not. More...
 

Protected Types

typedef Mappingvalue_type
 
typedef const value_typevalue_cref_type
 
typedef value_typevalue_ref_type
 
typedef value_typevalue_ptr_type
 
typedef Interpolated< value_type_Self
 

Protected Attributes

LinearIntplMapping mapping
 Holds the temporary InterpolatedMapping if necessary. More...
 
value_type value
 A pointer to the Mapping this class represents. More...
 
bool isPointer
 Stores if we use the temporary IntplMapping or a external pointer. More...
 

Detailed Description

template<>
class inet::physicallayer::Interpolated< Mapping * >

Helper class (-specialization) for multiDimMapping which is used by an InterpolateableMap as return value of the "getValue()" - method.

Provides either an pointer to an actual SubMapping of the MultiDimMapping or a Pointer to an temporary InterpolatedMapping between two Sub-mappings of the MultiDimMapping.

Author
Karl Wessel

Member Typedef Documentation

Constructor & Destructor Documentation

Initializes this Interpolated instance to represent the passed Interpolated Mapping.

Copies the passed Mapping to its internal member. Sets "isInterpolated" to true.

1023  :
1024  mapping(m), value(), isPointer(false), isInterpolated(true)
1025  {
1026  value = &mapping;
1027  }
LinearIntplMapping mapping
Holds the temporary InterpolatedMapping if necessary.
Definition: MappingUtils.h:1005
value_type value
A pointer to the Mapping this class represents.
Definition: MappingUtils.h:1008
bool isPointer
Stores if we use the temporary IntplMapping or a external pointer.
Definition: MappingUtils.h:1011
bool isInterpolated
Stores if the underlying Mapping is interpolated or not.
Definition: MappingUtils.h:1015
value< double, units::m > m
Definition: Units.h:1047
inet::physicallayer::Interpolated< Mapping * >::Interpolated ( value_type  v,
bool  isIntpl = true 
)
inline

Initializes this Interpolated instance to represent the Mapping the passed pointer points to and with the passed isIntpl value.

The passed pointer has to be valid as long as this instance exists.

1035  :
1036  mapping(), value(v), isPointer(true), isInterpolated(isIntpl) {}
LinearIntplMapping mapping
Holds the temporary InterpolatedMapping if necessary.
Definition: MappingUtils.h:1005
value_type value
A pointer to the Mapping this class represents.
Definition: MappingUtils.h:1008
bool isPointer
Stores if we use the temporary IntplMapping or a external pointer.
Definition: MappingUtils.h:1011
bool isInterpolated
Stores if the underlying Mapping is interpolated or not.
Definition: MappingUtils.h:1015

Copy-constructor which assures that the internal storage is used correctly.

1041  :
1042  mapping(), value(o.value), isPointer(o.isPointer), isInterpolated(o.isInterpolated)
1043  {
1044  if (!isPointer) {
1045  mapping = o.mapping;
1046  value = &mapping;
1047  }
1048  }
LinearIntplMapping mapping
Holds the temporary InterpolatedMapping if necessary.
Definition: MappingUtils.h:1005
value_type value
A pointer to the Mapping this class represents.
Definition: MappingUtils.h:1008
bool isPointer
Stores if we use the temporary IntplMapping or a external pointer.
Definition: MappingUtils.h:1011
bool isInterpolated
Stores if the underlying Mapping is interpolated or not.
Definition: MappingUtils.h:1015

Member Function Documentation

bool inet::physicallayer::Interpolated< Mapping * >::operator!= ( const _Self other) const
inline

Two Interpolated<Mapping*> are compared non equal if the pointer to the represented Mapping differs or the "isInterpolated" value.

1102  {
1103  return value != other.value || isInterpolated != other.isInterpolated;
1104  }
value_type value
A pointer to the Mapping this class represents.
Definition: MappingUtils.h:1008
bool isInterpolated
Stores if the underlying Mapping is interpolated or not.
Definition: MappingUtils.h:1015

Dereferences this Interpolated to the represented value (works like dereferencing an std::iterator).

1073  {
1074  return value;
1075  }
value_type value
A pointer to the Mapping this class represents.
Definition: MappingUtils.h:1008

Dereferences this Interpolated to the represented value (works like dereferencing an std::iterator).

1082  {
1083  return &value;
1084  }
value_type value
A pointer to the Mapping this class represents.
Definition: MappingUtils.h:1008
const _Self& inet::physicallayer::Interpolated< Mapping * >::operator= ( const _Self o)
inline

Assignment operator which assures that the internal storage is copied correctly.

1057  {
1058  isInterpolated = o.isInterpolated;
1059  isPointer = o.isPointer;
1060  value = o.value;
1061  if (!isPointer) {
1062  mapping = o.mapping;
1063  value = &mapping;
1064  }
1065  return *this;
1066  }
LinearIntplMapping mapping
Holds the temporary InterpolatedMapping if necessary.
Definition: MappingUtils.h:1005
value_type value
A pointer to the Mapping this class represents.
Definition: MappingUtils.h:1008
bool isPointer
Stores if we use the temporary IntplMapping or a external pointer.
Definition: MappingUtils.h:1011
bool isInterpolated
Stores if the underlying Mapping is interpolated or not.
Definition: MappingUtils.h:1015
bool inet::physicallayer::Interpolated< Mapping * >::operator== ( const _Self other) const
inline

Two Interpolated<Mapping*> are compared equal if the pointer to the represented Mapping is the same as well as the "isInterpolated" value.

1092  {
1093  return value == other.value && isInterpolated == other.isInterpolated;
1094  }
value_type value
A pointer to the Mapping this class represents.
Definition: MappingUtils.h:1008
bool isInterpolated
Stores if the underlying Mapping is interpolated or not.
Definition: MappingUtils.h:1015

Member Data Documentation

bool inet::physicallayer::Interpolated< Mapping * >::isInterpolated

Stores if the underlying Mapping is interpolated or not.

bool inet::physicallayer::Interpolated< Mapping * >::isPointer
protected

Stores if we use the temporary IntplMapping or a external pointer.

Holds the temporary InterpolatedMapping if necessary.

A pointer to the Mapping this class represents.


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