29 template <
typename KEY,
typename VALUE>
81 bool direct(
const KEY& k, VALUE& out_v)
const
84 if (i ==
m_k2v.end())
return false;
91 inline bool hasKey(
const KEY& k)
const
122 if (i ==
m_v2k.end())
return false;
A bidirectional version of std::map, declared as bimap<KEY,VALUE> and which actually contains two std...
void clear()
Clear the contents of the bi-map.
iterator_inverse inverse_begin()
const_iterator_inverse inverse_begin() const
const_iterator begin() const
const std::map< VALUE, KEY > & getInverseMap() const
Return a read-only reference to the internal map KEY->VALUES.
const_iterator find_key(const KEY &k) const
const_iterator_inverse find_value(const VALUE &v) const
void insert(const KEY &k, const VALUE &v)
Insert a new pair KEY<->VALUE in the bi-map.
bool inverse(const VALUE &v, KEY &out_k) const
Get the key associated the given value, VALUE->KEY, returning false if not present.
typename std::map< VALUE, KEY >::const_iterator const_iterator_inverse
typename std::map< KEY, VALUE >::iterator iterator
std::map< KEY, VALUE > m_k2v
typename std::map< VALUE, KEY >::iterator iterator_inverse
bool hasValue(const VALUE &v) const
Return true if the given value 'v' is in the bi-map.
bool hasKey(const KEY &k) const
Return true if the given key 'k' is in the bi-map.
const_iterator_inverse inverse_end() const
std::map< VALUE, KEY > m_v2k
bimap()
Default constructor - does nothing.
iterator_inverse find_value(const VALUE &v)
iterator_inverse inverse_end()
typename std::map< KEY, VALUE >::const_iterator const_iterator
const_iterator end() const
bool direct(const KEY &k, VALUE &out_v) const
Get the value associated the given key, KEY->VALUE, returning false if not present.
VALUE direct(const KEY &k) const
Get the value associated the given key, KEY->VALUE, raising an exception if not present.
iterator find_key(const KEY &k)
const std::map< KEY, VALUE > & getDirectMap() const
Return a read-only reference to the internal map KEY->VALUES.
KEY inverse(const VALUE &v) const
Get the key associated the given value, VALUE->KEY, raising an exception if not present.
const Scalar * const_iterator
#define THROW_EXCEPTION(msg)