WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::util::interpolating_map< Key, Value > Class Template Reference

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

#include <wpi/util/interpolating_map.hpp>

Public Member Functions

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

Detailed Description

template<typename Key, typename Value>
class wpi::util::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::util::interpolating_map< Key, Value >::clear ( )
inline

Clears the contents.

◆ insert() [1/2]

template<typename Key, typename Value>
void wpi::util::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::util::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::util::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: