ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 118 of file valuedescriptor.hpp.

#include <valuedescriptor.hpp>

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 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.

◆ MappedType

template<typename T , typename TKey >
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.

◆ StoredType

template<typename T , typename TKey >
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.

Method Details:

◆ Key()

template<typename T , typename TKey >
KeyType & 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 & 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 148 of file valuedescriptor.hpp.


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