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 32 of file valuedescriptor.hpp.
#include <valuedescriptor.hpp>
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 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 44 of file valuedescriptor.hpp.
using 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 51 of file valuedescriptor.hpp.
using 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 38 of file valuedescriptor.hpp.
|
inline |
Returns the first element of the given std::pair
.
src | The value to extract from. |
Definition at line 56 of file valuedescriptor.hpp.
|
inline |
Returns the second element of the given std::pair
.
src | The value to extract from. |
Definition at line 61 of file valuedescriptor.hpp.