27 template <
typename KEY,
typename VALUE>
79 bool direct(
const KEY &k, VALUE &out_v)
const 82 if (i==
m_k2v.end())
return false;
88 inline bool hasKey(
const KEY& k)
const {
114 if (i==
m_v2k.end())
return false;
iterator find_key(const KEY &k)
bool direct(const KEY &k, VALUE &out_v) const
Get the value associated the given key, KEY->VALUE, returning false if not present.
bimap()
Default constructor - does nothing.
const_iterator end() const
std::map< KEY, VALUE >::const_iterator const_iterator
#define THROW_EXCEPTION(msg)
std::map< VALUE, KEY >::const_iterator const_iterator_inverse
iterator_inverse inverse_end()
const Scalar * const_iterator
bool hasKey(const KEY &k) const
Return true if the given key 'k' is in the bi-map.
A bidirectional version of std::map, declared as bimap<KEY,VALUE> and which actually contains two std...
const_iterator find_key(const KEY &k) const
const_iterator_inverse inverse_end() const
bool inverse(const VALUE &v, KEY &out_k) const
Get the key associated the given value, VALUE->KEY, returning false if not present.
iterator_inverse find_value(const VALUE &v)
bool hasValue(const VALUE &v) const
Return true if the given value 'v' is in the bi-map.
std::map< KEY, VALUE >::iterator iterator
const_iterator_inverse find_value(const VALUE &v) const
std::map< VALUE, KEY >::iterator iterator_inverse
VALUE direct(const KEY &k) const
Get the value associated the given key, KEY->VALUE, raising an exception if not present.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
const_iterator_inverse inverse_begin() const
const_iterator begin() const
std::map< VALUE, KEY > m_v2k
KEY inverse(const VALUE &v) const
Get the key associated the given value, VALUE->KEY, raising an exception if not present.
std::map< KEY, VALUE > m_k2v
void insert(const KEY &k, const VALUE &v)
Insert a new pair KEY<->VALUE in the bi-map.
iterator_inverse inverse_begin()
const std::map< VALUE, KEY > & getInverseMap() const
Return a read-only reference to the internal map KEY->VALUES.
const std::map< KEY, VALUE > & getDirectMap() const
Return a read-only reference to the internal map KEY->VALUES.