Implements template type TValueDescriptor, which is, for example, offered by types HashTable and LRUCacheTable.
Specifically, this implementation is used when the custom type to be stored with a container should be associated to a TKkey-type, which is not included in the stored type itself. Consequently, to associate custom type TMapped with the key, the StoredType results in std::pair<TKey,TMapped
.
Type definitions HashMap and LRUCacheMap establish a shortcut to their corresponding base type, which incorporates this helper.
TKey | The key type. |
TMapped | The type of the mapped objects. |
Definition at line 23 of file valuedescriptor.inl.
Public Type Index: | |
using | KeyType = TKey |
using | MappedType = TMapped |
using | StoredType = std::pair<TKey, TMapped> |
Public Method Index: | |
TKey & | Key (std::pair< TKey, TMapped > &src) const |
TMapped & | Mapped (std::pair< TKey, TMapped > &src) const |
using alib::containers::TPairDescriptor< TKey, TMapped >::KeyType = TKey |
The key type. (Exposes template parameter TKey).
Container types typically publish an alias to this type. For example, see KeyType, or see KeyType.
Definition at line 35 of file valuedescriptor.inl.
using alib::containers::TPairDescriptor< TKey, TMapped >::MappedType = TMapped |
The type associated to a key. (Exposes template parameter TMapped). The type of the mapped portion of the data.
Container types typically publish an alias to this type. For example, see MappedType, or see MappedType.
Definition at line 42 of file valuedescriptor.inl.
using alib::containers::TPairDescriptor< TKey, TMapped >::StoredType = std::pair<TKey, TMapped> |
The type stored in the container.
Container types typically publish an alias to this type. For example, see StoredType, or see StoredType.
Definition at line 29 of file valuedescriptor.inl.
|
inline |
Returns the first element of the given std::pair
.
src | The value to extract from. |
Definition at line 47 of file valuedescriptor.inl.
|
inline |
Returns the second element of the given std::pair
.
src | The value to extract from. |
Definition at line 52 of file valuedescriptor.inl.