46template<
class T1,
class T2,
typename Compare1 = std::less<T1>,
typename Compare2 = std::less<T2> >
58 typename forwardType::const_iterator
begin()
62 typename forwardType::const_iterator
end()
A strict one-to-one mapping from objects of type T1 to type T2 (which must be different types).
Definition: Bijection.h:48
forwardType::const_iterator begin()
Get an iterator to the start of the forward map.
Definition: Bijection.h:58
void replace(T2 oldval, T2 newval)
Replaces one value with another, keeping the keys identical.
Definition: Bijection.h:145
forwardType m_forwardMap
Map of object-to-object in the forward direction.
Definition: Bijection.h:160
std::map< T2, T1, Compare2 > reverseType
Type of the reverse map.
Definition: Bijection.h:55
bool HasEntry(T1 key)
Determines if an object is present in the forward mapping.
Definition: Bijection.h:100
void emplace(T1 a, T2 b)
Adds a new entry to the bijection.
Definition: Bijection.h:73
void erase(T1 key)
Erase an entry given a forward key.
Definition: Bijection.h:123
const T2 & operator[](T1 key)
Looks up an object in the forward direction.
Definition: Bijection.h:92
forwardType::const_iterator end()
Get an iterator to the end of the forward map.
Definition: Bijection.h:62
const T1 & operator[](T2 key)
Looks up an object in the reverse direction.
Definition: Bijection.h:84
void clear()
Erase all entries in the bijection.
Definition: Bijection.h:112
bool HasEntry(T2 key)
Determines if an object is present in the reverse mapping.
Definition: Bijection.h:108
void erase(T2 key)
Erase an entry given a reverse key.
Definition: Bijection.h:135
reverseType m_reverseMap
Map of object-to-object in the reverse direction.
Definition: Bijection.h:163
std::map< T1, T2, Compare1 > forwardType
Type of the forward map.
Definition: Bijection.h:52
size_t size()
Return the number of entries in the bijection.
Definition: Bijection.h:154