RIT VEXU Core API
Loading...
Searching...
No Matches
InterpolatingMap< KEY, VALUE > Class Template Reference

#include <interpolating_map.h>

Public Member Functions

void insert (const KEY &key, const VALUE &value)
 
VALUE operator[] (const KEY &key)
 
void clear ()
 

Detailed Description

template<typename KEY, typename VALUE>
class InterpolatingMap< KEY, VALUE >

This class implements a map of key-value pairs.

If there is not a pair with the given key in the map, the value will be a linear interpolation of the preceding and following values.

Template Parameters
KEYThe type of the key.
VALUEThe type of the value.

Member Function Documentation

◆ clear()

template<typename KEY, typename VALUE>
void InterpolatingMap< KEY, VALUE >::clear ( )
inline

Clears the contents of the map.

◆ insert()

template<typename KEY, typename VALUE>
void InterpolatingMap< KEY, VALUE >::insert ( const KEY & key,
const VALUE & value )
inline

Inserts a key value pair.

Parameters
keyThe key.
vlueThe value.

◆ operator[]()

template<typename KEY, typename VALUE>
VALUE InterpolatingMap< KEY, VALUE >::operator[] ( const KEY & key)
inline

Obtains the value at the given key.

If the key does not exactly match a pair in the map, it will interpolate between the preceding and following pairs.

Parameters
keyThe key.
Returns
The value.

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