|
Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
|
Maintains a one-to-one mapping that can be queried from either side. More...
#include <BidirectionalMap.h>
Classes | |
| class | Side |
| Read-only view for one direction of the map. More... | |
Public Types | |
| using | LeftSideType = Side<T, U> |
| Read-only view that maps T to U. | |
| using | RightSideType = Side<U, T> |
| Read-only view that maps U to T. | |
Public Member Functions | |
| BidirectionalMap ()=default | |
| Creates an empty bidirectional map. | |
| LeftSideType & | get_left () |
| Gets the left-to-right view. | |
| const LeftSideType & | get_left () const |
| Gets the left-to-right view. | |
| RightSideType & | get_right () |
| Gets the right-to-left view. | |
| const RightSideType & | get_right () const |
| Gets the right-to-left view. | |
| void | insert (const T &key, const U &value) |
| Inserts or replaces a one-to-one mapping. | |
| template<typename KT, typename KU> | |
| void | emplace (KT &&key, KU &&value) |
| Constructs or replaces a one-to-one mapping in place. | |
| void | remove_left (const T &key) |
| Removes a mapping by left-side key. | |
| void | remove_right (const U &key) |
| Removes a mapping by right-side key. | |
| void | clear () |
| Removes all mappings from both sides. | |
| void | reserve (size_t n) |
| Reserves storage for mappings on both sides. | |
Private Attributes | |
| LeftSideType | left {} |
| RightSideType | right {} |
Maintains a one-to-one mapping that can be queried from either side.
Inserting a key or value that already exists removes the previous opposite mapping before storing the new pair.
| T | Left-side key type. |
| U | Right-side key type. |
Definition at line 16 of file BidirectionalMap.h.
| using BidirectionalMap< T, U >::LeftSideType = Side<T, U> |
Read-only view that maps T to U.
Definition at line 98 of file BidirectionalMap.h.
| using BidirectionalMap< T, U >::RightSideType = Side<U, T> |
Read-only view that maps U to T.
Definition at line 99 of file BidirectionalMap.h.
|
default |
Creates an empty bidirectional map.
|
inline |
Removes all mappings from both sides.
Definition at line 208 of file BidirectionalMap.h.
|
inline |
Constructs or replaces a one-to-one mapping in place.
| KT | Forwarded left-side key type. |
| KU | Forwarded right-side value type. |
| key | Left-side key. |
| value | Right-side value. |
Definition at line 162 of file BidirectionalMap.h.
|
inline |
Gets the left-to-right view.
Definition at line 110 of file BidirectionalMap.h.
References left.
|
inline |
Gets the left-to-right view.
Definition at line 116 of file BidirectionalMap.h.
References left.
|
inline |
Gets the right-to-left view.
Definition at line 122 of file BidirectionalMap.h.
References right.
|
inline |
Gets the right-to-left view.
Definition at line 128 of file BidirectionalMap.h.
References right.
|
inline |
Inserts or replaces a one-to-one mapping.
| key | Left-side key. |
| value | Right-side value. |
Definition at line 135 of file BidirectionalMap.h.
|
inline |
Removes a mapping by left-side key.
| key | Left-side key to remove. |
Definition at line 183 of file BidirectionalMap.h.
|
inline |
Removes a mapping by right-side key.
| key | Right-side key to remove. |
Definition at line 196 of file BidirectionalMap.h.
|
inline |
Reserves storage for mappings on both sides.
| n | Number of mappings to reserve. |
Definition at line 217 of file BidirectionalMap.h.
|
private |
Definition at line 223 of file BidirectionalMap.h.
Referenced by clear(), emplace(), get_left(), get_left(), insert(), remove_left(), remove_right(), and reserve().
|
private |
Definition at line 224 of file BidirectionalMap.h.
Referenced by BidirectionalMap< T, U >::Side< T, U >::BidirectionalMap< T, U >, clear(), emplace(), get_right(), get_right(), insert(), remove_left(), remove_right(), and reserve().