WPILibC++ 2024.3.2
wpi::interpolating_map< Key, Value > Class Template Reference

Implements a table of key-value pairs with linear interpolation between values. More...

#include <wpi/interpolating_map.h>

Public Member Functions

void insert (const Key &key, const Value &value)
 Inserts a key-value pair. More...
 
void insert (Key &&key, Value &&value)
 Inserts a key-value pair. More...
 
Value operator[] (const Key &key) const
 Returns the value associated with a given key. More...
 
void clear ()
 Clears the contents. More...
 

Detailed Description

template<typename Key, typename Value>
class wpi::interpolating_map< Key, Value >

Implements a table of key-value pairs with linear interpolation between values.

If there's no matching key, the value returned will be a linear interpolation between the keys before and after the provided one.

Template Parameters
KeyThe key type.
ValueThe value type.

Member Function Documentation

◆ clear()

template<typename Key , typename Value >
void wpi::interpolating_map< Key, Value >::clear ( )
inline

Clears the contents.

◆ insert() [1/2]

template<typename Key , typename Value >
void wpi::interpolating_map< Key, Value >::insert ( const Key &  key,
const Value &  value 
)
inline

Inserts a key-value pair.

Parameters
keyThe key.
valueThe value.

◆ insert() [2/2]

template<typename Key , typename Value >
void wpi::interpolating_map< Key, Value >::insert ( Key &&  key,
Value &&  value 
)
inline

Inserts a key-value pair.

Parameters
keyThe key.
valueThe value.

◆ operator[]()

template<typename Key , typename Value >
Value wpi::interpolating_map< Key, Value >::operator[] ( const Key &  key) const
inline

Returns the value associated with a given key.

If there's no matching key, the value returned will be a linear interpolation between the keys before and after the provided one.

Parameters
keyThe key.

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