Implements template type TValueDescriptor, which is, for example, offered by types HashTable and LRUCacheTable.
Specifically, this implementation causes a container neither to add a specific key-type to every stored custom object nor to expect instances of a custom object as the key-type itself. Instead, only a subset of the custom type is used as the key-type.
T | The type stored in the container. |
TKey | The key type which is to be extracted out of T by method Key. |
Definition at line 118 of file valuedescriptor.hpp.
#include <valuedescriptor.hpp>
Public Type Index: | |
using | KeyType = TKey |
using | MappedType = T |
using | StoredType = T |
Public Method Index: | |
KeyType & | Key (T &src) |
MappedType & | Mapped (T &src) const |
using KeyType = TKey |
Exposes template parameter TKey.
Container types typically publish an alias to this type. For example, see KeyType, or see KeyType.
Definition at line 130 of file valuedescriptor.hpp.
using MappedType = T |
Exposes template parameter T and thus equals StoredType.
Container types typically publish an alias to this type. For example, see MappedType, or see MappedType.
Definition at line 136 of file valuedescriptor.hpp.
using StoredType = T |
Exposes template parameter T.
Container types typically publish an alias to this type. For example, see StoredType, or see StoredType.
Definition at line 124 of file valuedescriptor.hpp.
KeyType & Key | ( | T & | src | ) |
A custom implementation has to return the key-portion of given src.
src | The stored value to extract the key from. |
|
inline |
Returns the given src as is.
src | The stored value to extract the mapped portion from. |
Definition at line 148 of file valuedescriptor.hpp.