A strict one-to-one mapping from objects of type T1 to type T2 (which must be different types).
More...
|
forwardType::const_iterator | begin () |
| Get an iterator to the start of the forward map.
|
|
forwardType::const_iterator | end () |
| Get an iterator to the end of the forward map.
|
|
void | emplace (T1 a, T2 b) |
| Adds a new entry to the bijection. More...
|
|
const T1 & | operator[] (T2 key) |
| Looks up an object in the reverse direction. More...
|
|
const T2 & | operator[] (T1 key) |
| Looks up an object in the forward direction. More...
|
|
bool | HasEntry (T1 key) |
| Determines if an object is present in the forward mapping. More...
|
|
bool | HasEntry (T2 key) |
| Determines if an object is present in the reverse mapping. More...
|
|
void | clear () |
| Erase all entries in the bijection.
|
|
void | erase (T1 key) |
| Erase an entry given a forward key. More...
|
|
void | erase (T2 key) |
| Erase an entry given a reverse key. More...
|
|
void | replace (T2 oldval, T2 newval) |
| Replaces one value with another, keeping the keys identical.
|
|
size_t | size () |
| Return the number of entries in the bijection.
|
|
template<class T1, class T2, typename Compare1 = std::less<T1>, typename Compare2 = std::less<T2>>
class Bijection< T1, T2, Compare1, Compare2 >
A strict one-to-one mapping from objects of type T1 to type T2 (which must be different types).
Internally implemented as two synchronized std::map instances
template<class T1 , class T2 , typename Compare1 = std::less<T1>, typename Compare2 = std::less<T2>>
void Bijection< T1, T2, Compare1, Compare2 >::emplace |
( |
T1 |
a, |
|
|
T2 |
b |
|
) |
| |
|
inline |
Adds a new entry to the bijection.
Neither a nor b is allowed to be in the map when this function is called.
- Parameters
-
a | First object |
b | Second object |