|
This class is pretty much similar to a map. More...
#include <ArmarXCore/util/CPPUtility/KeyValueVector.h>
Public Types | |
using | const_iterator = typename ValContT::const_iterator |
using | iterator = typename ValContT::iterator |
Public Member Functions | |
void | add (KeyT key, ValT value) |
ValT & | at (const KeyT &k) |
ValT const & | at (const KeyT &k) const |
ValT const & | at (const KeyT &k, const ValT &defaultVal) const |
ValT & | at (const KeyT &k, ValT &defaultVal) |
ValT & | at (IdxT i) |
ValT const & | at (IdxT i) const |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
void | clear () |
IdxT | count (const KeyT &k) const |
iterator | end () |
const_iterator | end () const |
bool | has (const KeyT &k) const |
IdxT | index (const KeyT &k) const |
MapT const & | indices () const |
KeyContT const & | keys () const |
IdxT | size () const |
ValContT const & | values () const |
This class is pretty much similar to a map.
This class stores keys and values in two vectors and uses a map to map the keys to the index of the corresponding value This enables map acces and index access. The index of an inserted element never changes (this is different to a map). Index access may be required in a high frequency case (e.g. an rt control loop)
Definition at line 45 of file KeyValueVector.h.
using const_iterator = typename ValContT::const_iterator |
Definition at line 67 of file KeyValueVector.h.
using iterator = typename ValContT::iterator |
Definition at line 66 of file KeyValueVector.h.
void add | ( | KeyT | key, |
ValT | value | ||
) |
ValT & at | ( | const KeyT & | k | ) |
Definition at line 129 of file KeyValueVector.h.
const ValT & at | ( | const KeyT & | k | ) | const |
Definition at line 136 of file KeyValueVector.h.
const ValT & at | ( | const KeyT & | k, |
const ValT & | defaultVal | ||
) | const |
Definition at line 150 of file KeyValueVector.h.
ValT & at | ( | const KeyT & | k, |
ValT & | defaultVal | ||
) |
Definition at line 143 of file KeyValueVector.h.
ValT & at | ( | IdxT | i | ) |
const ValT & at | ( | IdxT | i | ) | const |
Definition at line 122 of file KeyValueVector.h.
KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator begin |
Definition at line 209 of file KeyValueVector.h.
const_iterator begin | ( | ) | const |
KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator cbegin |
Definition at line 237 of file KeyValueVector.h.
KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator cend |
Definition at line 244 of file KeyValueVector.h.
void clear |
Definition at line 200 of file KeyValueVector.h.
IdxT count | ( | const KeyT & | k | ) | const |
Definition at line 186 of file KeyValueVector.h.
KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator end |
Definition at line 216 of file KeyValueVector.h.
const_iterator end | ( | ) | const |
bool has | ( | const KeyT & | k | ) | const |
IdxT index | ( | const KeyT & | k | ) | const |
const MapT & indices |
Definition at line 172 of file KeyValueVector.h.
const KeyContT & keys |
IdxT size |
const ValContT & values |