|
|
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 | ) |
| const ValT & at | ( | const KeyT & | k | ) | const |
| const ValT & at | ( | const KeyT & | k, |
| const ValT & | defaultVal ) const |
| ValT & at | ( | const KeyT & | k, |
| ValT & | defaultVal ) |
| 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 >::iterator begin | ( | ) |
| KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator begin | ( | ) | const |
Definition at line 223 of file KeyValueVector.h.
| KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator cbegin | ( | ) | const |
| KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator cend | ( | ) | const |
| 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 >::iterator end | ( | ) |
| KeyValueVector< KeyT, ValT, KeyContT, ValContT, IdxT, MapT >::const_iterator end | ( | ) | const |
Definition at line 230 of file KeyValueVector.h.
| bool has | ( | const KeyT & | k | ) | const |
| IdxT index | ( | const KeyT & | k | ) | const |
Definition at line 108 of file KeyValueVector.h.
| const MapT & indices | ( | ) | const |
Definition at line 172 of file KeyValueVector.h.
| const KeyContT & keys | ( | ) | const |
Definition at line 179 of file KeyValueVector.h.
| IdxT size | ( | ) | const |
| const ValContT & values | ( | ) | const |