ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::containers::TSubsetKeyDescriptor< T, TKey > Struct Template Reference

Description:

template<typename T, typename TKey>
struct alib::containers::TSubsetKeyDescriptor< T, TKey >

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.

Template Parameters
TThe type stored in the container.
TKeyThe key type which is to be extracted out of T by method Key.

Definition at line 109 of file valuedescriptor.inl.

Public Type Index:

using KeyType = TKey
 
using MappedType = T
 
using StoredType = T
 

Public Method Index:

KeyTypeKey (T &src)
 
MappedTypeMapped (T &src) const
 

Type Definition Details:

◆ KeyType

template<typename T, typename TKey>
using alib::containers::TSubsetKeyDescriptor< T, TKey >::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 121 of file valuedescriptor.inl.

◆ MappedType

template<typename T, typename TKey>
using alib::containers::TSubsetKeyDescriptor< T, TKey >::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 127 of file valuedescriptor.inl.

◆ StoredType

template<typename T, typename TKey>
using alib::containers::TSubsetKeyDescriptor< T, TKey >::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 115 of file valuedescriptor.inl.

Method Details:

◆ Key()

template<typename T, typename TKey>
KeyType & alib::containers::TSubsetKeyDescriptor< T, TKey >::Key ( T & src)

A custom implementation has to return the key-portion of given src.

Attention
This method is just declared. A type-specific implementation has to be provided by the using code!
Parameters
srcThe stored value to extract the key from.
Returns
The given reference.

◆ Mapped()

template<typename T, typename TKey>
MappedType & alib::containers::TSubsetKeyDescriptor< T, TKey >::Mapped ( T & src) const
inline

Returns the given src as is.

Parameters
srcThe stored value to extract the mapped portion from.
Returns
The given reference.

Definition at line 139 of file valuedescriptor.inl.


The documentation for this struct was generated from the following file: