Go to the documentation of this file.
30 template <
typename KEY,
typename VALUE>
39 using iterator =
typename std::map<KEY, VALUE>::iterator;
41 typename std::map<VALUE, KEY>::const_iterator;
71 void insert(
const KEY& k,
const VALUE& v)
82 bool direct(
const KEY& k, VALUE& out_v)
const
85 if (i ==
m_k2v.end())
return false;
92 inline bool hasKey(
const KEY& k)
const
110 auto i =
m_k2v.find(k);
120 bool inverse(
const VALUE& v, KEY& out_k)
const
123 if (i ==
m_v2k.end())
return false;
135 auto i =
m_v2k.find(v);
144 return m_v2k.find(v);
void clear()
Clear the contents of the bi-map.
const_iterator end() const
const_iterator_inverse inverse_end() const
bimap()=default
Default constructor - does nothing.
bool hasKey(const KEY &k) const
Return true if the given key 'k' is in the bi-map.
void insert(const KEY &k, const VALUE &v)
Insert a new pair KEY<->VALUE in the bi-map.
const_iterator_inverse find_value(const VALUE &v) const
const_iterator_inverse inverse_begin() const
#define THROW_EXCEPTION(msg)
VALUE direct(const KEY &k) const
Get the value associated the given key, KEY->VALUE, raising an exception 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< VALUE, KEY > m_v2k
A bidirectional version of std::map, declared as bimap<KEY,VALUE> and which actually contains two std...
bool inverse(const VALUE &v, KEY &out_k) const
Get the key associated the given value, VALUE->KEY, returning false if not present.
bool direct(const KEY &k, VALUE &out_v) const
Get the value associated the given key, KEY->VALUE, returning false if not present.
KEY inverse(const VALUE &v) const
Get the key associated the given value, VALUE->KEY, raising an exception if not present.
const_iterator find_key(const KEY &k) const
iterator_inverse inverse_end()
typename std::map< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::const_iterator const_iterator
iterator find_key(const KEY &k)
iterator_inverse inverse_begin()
std::map< KEY, VALUE > m_k2v
const_iterator begin() const
typename std::map< unsigned int, mrpt::maps::CLandmark::TLandmarkID >::const_iterator const_iterator_inverse
typename std::map< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::iterator iterator
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.
typename std::map< unsigned int, mrpt::maps::CLandmark::TLandmarkID >::iterator iterator_inverse
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Thu May 21 21:53:32 UTC 2020 | |