Ocean
|
This class implements an interpolation map allowing to determine an interplated value between several individual key values. More...
Public Types | |
typedef std::map< TKey, TValue > | ValueMap |
Definition of a map mapping keys to values. More... | |
typedef TValue(* | LinearInterpolationFunction) (const TValue &, const TValue &, const TFactor &) |
Definition of a function pointer for a function providing a linear interpolation. More... | |
Public Member Functions | |
InterpolationMap () | |
Default constructor. More... | |
InterpolationMap (const InterpolationMap< TKey, TValue, TFactor > &interpolationMap) | |
Copy constructor for interpolation maps. More... | |
InterpolationMap (InterpolationMap< TKey, TValue, TFactor > &&interpolationMap) noexcept | |
Move constructor for interpolation maps. More... | |
InterpolationMap (const ValueMap &valueMap) | |
Creates a new interpolation map object by a given value map. More... | |
InterpolationMap (ValueMap &&valueMap) | |
Creates a new interpolation map object by a given value map. More... | |
size_t | size () const |
Returns the number of elements (pairs of keys and values) of this interpolation map. More... | |
bool | isEmpty () const |
Returns whether this interpolation map object is empty. More... | |
void | clear () |
Clears all elements (pairs of keys and values) of this interpolation map object. More... | |
const ValueMap & | interpolationMap () const |
Returns the entire internal interpolation map. More... | |
void | setInterpolationMap (const ValueMap &interpolationMap) |
Sets or changes the entire internal interpolation map. More... | |
void | setInterpolationMap (ValueMap &&interpolationMap) |
Sets or changes the entire internal interpolation map. More... | |
bool | hasValue (const TKey &key) const |
Returns whether this interpolation map object holds a value for a specified key. More... | |
TValue & | value (const TKey &key) |
Returns the value of this interpolation map object defined by a corresponding key. More... | |
bool | remove (const TKey &key) |
Removes an elements (pair of key and value) from this interpolation map object. More... | |
bool | insert (const TKey &key, const TValue &value, const bool forceOverwrite=false) |
Inserts a new pair of key and value to this map object. More... | |
bool | insert (const TKey &key, TValue &&value, const bool forceOverwrite=false) |
Inserts a new pair of key and value to this map object. More... | |
TValue | linear (const TKey &key) const |
Returns the linear interpolation of the stored values for a given key. More... | |
TValue | linear (const TKey &key, const LinearInterpolationFunction interpolationFunction) const |
Returns the linear interpolation of the stored values for a given key and a given interpolation function. More... | |
InterpolationMap< TKey, TValue, TFactor > & | operator= (const InterpolationMap< TKey, TValue, TFactor > &object) |
Assign operator. More... | |
InterpolationMap< TKey, TValue, TFactor > & | operator= (InterpolationMap< TKey, TValue, TFactor > &&object) noexcept |
Move operator. More... | |
bool | operator== (const InterpolationMap< TKey, TValue, TFactor > &object) const |
Returns whether two interpolation objects are equal. More... | |
bool | operator!= (const InterpolationMap< TKey, TValue, TFactor > &object) const |
Returns whether two interpolation objects are not equal. More... | |
TValue & | operator[] (const TKey &key) |
Returns the value of this interpolation map object defined by a corresponding key. More... | |
Static Public Member Functions | |
static TValue | linear (const ValueMap &valueMap, const TKey &key) |
Returns the linear interpolation of given values for a given key. More... | |
static TValue | linear (const ValueMap &valueMap, const TKey &key, const LinearInterpolationFunction interpolationFunction) |
Returns the linear interpolation of given values for a given key and a given interpolation function. More... | |
Protected Attributes | |
ValueMap | interpolationValueMap |
Map mapping keys to values. More... | |
This class implements an interpolation map allowing to determine an interplated value between several individual key values.
TKey | The data type of the stored keys |
TValue | The data type of the stored values |
TFactor | The data type of the interpolation factor |
typedef TValue(* Ocean::InterpolationMap< TKey, TValue, TFactor >::LinearInterpolationFunction) (const TValue &, const TValue &, const TFactor &) |
Definition of a function pointer for a function providing a linear interpolation.
The first parameter defines the first interpolation value.
The second parameter defines the second interpolation value.
The third parameter defines the interpolation factor, with range [0, 1].
typedef std::map<TKey, TValue> Ocean::InterpolationMap< TKey, TValue, TFactor >::ValueMap |
Definition of a map mapping keys to values.
|
inline |
Default constructor.
|
inline |
Copy constructor for interpolation maps.
interpolationMap | The interpolation map to copy |
|
inlinenoexcept |
Move constructor for interpolation maps.
interpolationMap | The interpolation map to move |
|
inline |
Creates a new interpolation map object by a given value map.
valueMap | The value map that will be stored in this object |
|
inline |
Creates a new interpolation map object by a given value map.
valueMap | The value map that will be moved to this object |
|
inline |
Clears all elements (pairs of keys and values) of this interpolation map object.
|
inline |
Returns whether this interpolation map object holds a value for a specified key.
key | Key which is checked |
|
inline |
Inserts a new pair of key and value to this map object.
key | New key to be inserted |
value | Corresponding value to be instered |
forceOverwrite | True, if an already existing pair with same key will be overwritten by the given pair |
|
inline |
Inserts a new pair of key and value to this map object.
key | New key to be inserted |
value | Corresponding value to be moved |
forceOverwrite | True, if an already existing pair with same key will be overwritten by the given pair |
|
inline |
Returns the entire internal interpolation map.
|
inline |
Returns whether this interpolation map object is empty.
|
inline |
Returns the linear interpolation of the stored values for a given key.
key | The key of the value that will be (interpolated and) returned |
|
inline |
Returns the linear interpolation of the stored values for a given key and a given interpolation function.
key | The key of the value that will be (interpolated and) returned |
interpolationFunction | An explicit interpolation function that is applied |
|
static |
Returns the linear interpolation of given values for a given key.
valueMap | The map of values that are used for interpolation |
key | The key of the value that will be (interpolated and) returned |
|
static |
Returns the linear interpolation of given values for a given key and a given interpolation function.
valueMap | The map of values that are used for interpolation |
key | The key of the value that will be (interpolated and) returned |
interpolationFunction | An explicit interpolation function that is applied |
|
inline |
Returns whether two interpolation objects are not equal.
object | Second interpoation object |
|
inline |
Assign operator.
object | The interpolation map object which will be assigned to this object |
|
inlinenoexcept |
Move operator.
object | The interpolation map object which will be moved to this object |
|
inline |
Returns whether two interpolation objects are equal.
object | Second interpoation object |
|
inline |
Returns the value of this interpolation map object defined by a corresponding key.
If no value exists for this key, the pair of key and value is inserted and the default value is returned.
key | Key for that the value is returned |
|
inline |
Removes an elements (pair of key and value) from this interpolation map object.
key | The key of the element to be removed |
|
inline |
Sets or changes the entire internal interpolation map.
interpolationMap | The interpolation map that will replace the current one |
|
inline |
Sets or changes the entire internal interpolation map.
interpolationMap | The interpolation map that will be moved to this object |
|
inline |
Returns the number of elements (pairs of keys and values) of this interpolation map.
|
inline |
Returns the value of this interpolation map object defined by a corresponding key.
If no value exists for this key, the pair of key and value is inserted and the default value is returned.
key | Key for that the value is returned |
|
protected |
Map mapping keys to values.