MRPT
2.0.1
|
A bidirectional version of std::map, declared as bimap<KEY,VALUE> and which actually contains two std::map's, one for keys and another for values.
To use this class, insert new pairs KEY<->VALUE with bimap::insert. Then, you can access the KEY->VALUE map with bimap::direct(), and the VALUE->KEY map with bimap::inverse(). The consistency of the two internal maps is assured at any time.
#include <mrpt/containers/bimap.h>
Public Types | |
using | const_iterator = typename std::map< KEY, VALUE >::const_iterator |
using | iterator = typename std::map< KEY, VALUE >::iterator |
using | const_iterator_inverse = typename std::map< VALUE, KEY >::const_iterator |
using | iterator_inverse = typename std::map< VALUE, KEY >::iterator |
Public Member Functions | |
bimap ()=default | |
Default constructor - does nothing. More... | |
const_iterator | begin () const |
iterator | begin () |
const_iterator | end () const |
iterator | end () |
const_iterator_inverse | inverse_begin () const |
iterator_inverse | inverse_begin () |
const_iterator_inverse | inverse_end () const |
iterator_inverse | inverse_end () |
size_t | size () const |
bool | empty () const |
const std::map< KEY, VALUE > & | getDirectMap () const |
Return a read-only reference to the internal map KEY->VALUES. More... | |
const std::map< VALUE, KEY > & | getInverseMap () const |
Return a read-only reference to the internal map KEY->VALUES. More... | |
void | clear () |
Clear the contents of the bi-map. More... | |
void | insert (const KEY &k, const VALUE &v) |
Insert a new pair KEY<->VALUE in the bi-map. More... | |
bool | direct (const KEY &k, VALUE &out_v) const |
Get the value associated the given key, KEY->VALUE, returning false if not present. More... | |
bool | hasKey (const KEY &k) const |
Return true if the given key 'k' is in the bi-map. More... | |
bool | hasValue (const VALUE &v) const |
Return true if the given value 'v' is in the bi-map. More... | |
VALUE | direct (const KEY &k) const |
Get the value associated the given key, KEY->VALUE, raising an exception if not present. More... | |
bool | inverse (const VALUE &v, KEY &out_k) const |
Get the key associated the given value, VALUE->KEY, returning false if not present. More... | |
KEY | inverse (const VALUE &v) const |
Get the key associated the given value, VALUE->KEY, raising an exception if not present. More... | |
const_iterator | find_key (const KEY &k) const |
iterator | find_key (const KEY &k) |
const_iterator_inverse | find_value (const VALUE &v) const |
iterator_inverse | find_value (const VALUE &v) |
Private Attributes | |
std::map< KEY, VALUE > | m_k2v |
std::map< VALUE, KEY > | m_v2k |
using mrpt::containers::bimap< KEY, VALUE >::const_iterator = typename std::map<KEY, VALUE>::const_iterator |
using mrpt::containers::bimap< KEY, VALUE >::const_iterator_inverse = typename std::map<VALUE, KEY>::const_iterator |
using mrpt::containers::bimap< KEY, VALUE >::iterator = typename std::map<KEY, VALUE>::iterator |
using mrpt::containers::bimap< KEY, VALUE >::iterator_inverse = typename std::map<VALUE, KEY>::iterator |
|
default |
Default constructor - does nothing.
|
inline |
|
inline |
|
inline |
Clear the contents of the bi-map.
Definition at line 64 of file bimap.h.
Referenced by mrpt::slam::CRangeBearingKFSLAM2D::reset(), and mrpt::slam::CRangeBearingKFSLAM::reset().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 48 of file bimap.h.
Referenced by mrpt::slam::CRangeBearingKFSLAM2D::OnGetObservationsAndDataAssociation(), and mrpt::slam::CRangeBearingKFSLAM::OnGetObservationsAndDataAssociation().
|
inline |
|
inline |
Definition at line 140 of file bimap.h.
Referenced by mrpt::slam::CRangeBearingKFSLAM2D::OnGetObservationsAndDataAssociation(), and mrpt::slam::CRangeBearingKFSLAM::OnGetObservationsAndDataAssociation().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return a read-only reference to the internal map KEY->VALUES.
Definition at line 62 of file bimap.h.
Referenced by mrpt::slam::CRangeBearingKFSLAM2D::getCurrentState(), mrpt::slam::CRangeBearingKFSLAM::getCurrentState(), and mrpt::slam::CRangeBearingKFSLAM2D::getLandmarkIDsFromIndexInStateVector().
|
inline |
|
inline |
|
inline |
Insert a new pair KEY<->VALUE in the bi-map.
Definition at line 71 of file bimap.h.
Referenced by mrpt::slam::CRangeBearingKFSLAM2D::OnNewLandmarkAddedToMap(), mrpt::slam::CRangeBearingKFSLAM::OnNewLandmarkAddedToMap(), and mrpt::apps::KFSLAMApp::Run_KF_SLAM().
|
inline |
Get the key associated the given value, VALUE->KEY, returning false if not present.
Definition at line 120 of file bimap.h.
Referenced by mrpt::slam::CRangeBearingKFSLAM::getAs3DObject(), and mrpt::slam::CRangeBearingKFSLAM::getLastPartitionLandmarks().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 57 of file bimap.h.
Referenced by mrpt::slam::CRangeBearingKFSLAM2D::processActionObservation(), and mrpt::slam::CRangeBearingKFSLAM::processActionObservation().
|
private |
Definition at line 34 of file bimap.h.
Referenced by mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::begin(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::clear(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::direct(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::empty(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::end(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::find_key(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::getDirectMap(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::hasKey(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::insert(), and mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::size().
|
private |
Definition at line 35 of file bimap.h.
Referenced by mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::clear(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::find_value(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::getInverseMap(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::hasValue(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::insert(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::inverse(), mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::inverse_begin(), and mrpt::containers::bimap< mrpt::maps::CLandmark::TLandmarkID, unsigned int >::inverse_end().
Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020 |