|
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 43 of file KeyValueVector.h.
using const_iterator = typename ValContT::const_iterator |
Definition at line 65 of file KeyValueVector.h.
using iterator = typename ValContT::iterator |
Definition at line 64 of file KeyValueVector.h.
void add | ( | KeyT | key, |
ValT | value | ||
) |
ValT & at | ( | const KeyT & | k | ) |
Definition at line 122 of file KeyValueVector.h.
const ValT & at | ( | const KeyT & | k | ) | const |
Definition at line 128 of file KeyValueVector.h.
const ValT & at | ( | const KeyT & | k, |
const ValT & | defaultVal | ||
) | const |
Definition at line 140 of file KeyValueVector.h.
ValT & at | ( | const KeyT & | k, |
ValT & | defaultVal | ||
) |
Definition at line 134 of file KeyValueVector.h.
ValT & at | ( | IdxT | i | ) |
const ValT & at | ( | IdxT | i | ) | const |
Definition at line 116 of file KeyValueVector.h.
KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator begin |
Definition at line 191 of file KeyValueVector.h.
const_iterator begin | ( | ) | const |
KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator cbegin |
Definition at line 219 of file KeyValueVector.h.
KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator cend |
Definition at line 226 of file KeyValueVector.h.
void clear |
Definition at line 182 of file KeyValueVector.h.
IdxT count | ( | const KeyT & | k | ) | const |
Definition at line 170 of file KeyValueVector.h.
KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator end |
Definition at line 198 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 158 of file KeyValueVector.h.
const KeyContT & keys |
IdxT size |
const ValContT & values |