HashTablePair< K, V > Class Template Reference

Internal storage type for HashTable entries. More...

Collaboration diagram for HashTablePair< K, V >:
[legend]

Public Types

typedef K key_type
 Type of key. More...
 
typedef V mapped_type
 Type of content. More...
 

Public Member Functions

 HashTablePair (const HashTablePair &)=delete
 No copy construct. More...
 
void operator= (const HashTablePair &)=delete
 No copy assignment. More...
 
template<class... Args>
 HashTablePair (HashTablePair *next, const key_type &key, Args &&... args)
 Construct from next pointer, key, contents. More...
 
const key_typekey () const noexcept
 The key. More...
 
const mapped_typecval () const noexcept
 Const access to the mapped value. More...
 
const mapped_typeval () const noexcept
 Const access to the mapped value. More...
 
mapped_typeval () noexcept
 Non-const access to the mapped value. More...
 
bool operator< (const HashTablePair &rhs) const
 Compare keys. More...
 
template<class TypeT = V>
std::enable_if<(std::is_pointer< TypeT >::value||Detail::isPointerLike< TypeT >::value), void >::type print (Ostream &os) const
 Write (key, val) pair - for pointer types. More...
 
template<class TypeT = V>
std::enable_if<(!std::is_pointer< TypeT >::value &&!Detail::isPointerLike< TypeT >::value), void >::type print (Ostream &os) const
 Write (key, val) pair - for non-pointer types. More...
 

Static Public Member Functions

static constexpr bool stores_value () noexcept
 This class stores a value. More...
 

Public Attributes

const K key_
 The lookup key. More...
 
val_
 The mapped data. More...
 
HashTablePairnext_
 Addressing (next in collision list) More...
 

Detailed Description

template<class K, class V>
class Foam::Detail::HashTablePair< K, V >

Internal storage type for HashTable entries.

Internal storage type for HashTable.

Comprises a (K,V) tuple and a linked-list entry for hash collisions. Could store key/val as std::pair, but no particular advantage unless the iterator dereference type changes.

Source files

Definition at line 79 of file HashTableDetail.H.

Member Typedef Documentation

◆ key_type

typedef K key_type

Type of key.

Definition at line 84 of file HashTableDetail.H.

◆ mapped_type

typedef V mapped_type

Type of content.

Definition at line 87 of file HashTableDetail.H.

Constructor & Destructor Documentation

◆ HashTablePair() [1/2]

HashTablePair ( const HashTablePair< K, V > &  )
delete

No copy construct.

◆ HashTablePair() [2/2]

HashTablePair ( HashTablePair< K, V > *  next,
const key_type key,
Args &&...  args 
)
inline

Construct from next pointer, key, contents.

Definition at line 121 of file HashTableDetail.H.

Member Function Documentation

◆ stores_value()

static constexpr bool stores_value ( )
inlinestaticconstexprnoexcept

This class stores a value.

Definition at line 90 of file HashTableDetail.H.

◆ operator=()

void operator= ( const HashTablePair< K, V > &  )
delete

No copy assignment.

◆ key()

const key_type & key ( ) const
inlinenoexcept

The key.

Definition at line 137 of file HashTableDetail.H.

References HashTablePair< K, V >::key_.

◆ cval()

const mapped_type & cval ( ) const
inlinenoexcept

Const access to the mapped value.

Definition at line 143 of file HashTableDetail.H.

References HashTablePair< K, V >::val_.

◆ val() [1/2]

const mapped_type & val ( ) const
inlinenoexcept

Const access to the mapped value.

Definition at line 149 of file HashTableDetail.H.

References HashTablePair< K, V >::val_.

◆ val() [2/2]

mapped_type & val ( )
inlinenoexcept

Non-const access to the mapped value.

Definition at line 155 of file HashTableDetail.H.

References HashTablePair< K, V >::val_.

◆ operator<()

bool operator< ( const HashTablePair< K, V > &  rhs) const
inline

Compare keys.

Definition at line 162 of file HashTableDetail.H.

References HashTablePair< K, V >::key_.

◆ print() [1/2]

std::enable_if<(std::is_pointer< TypeT >::value||Detail::isPointerLike< TypeT >::value), void >::type print ( Ostream os) const
inline

Write (key, val) pair - for pointer types.

Definition at line 177 of file HashTableDetail.H.

References HashTablePair< K, V >::key_, os(), and HashTablePair< K, V >::val_.

Here is the call graph for this function:

◆ print() [2/2]

std::enable_if<(!std::is_pointer< TypeT >::value &&!Detail::isPointerLike< TypeT >::value), void >::type print ( Ostream os) const
inline

Write (key, val) pair - for non-pointer types.

Definition at line 197 of file HashTableDetail.H.

References HashTablePair< K, V >::key_, os(), and HashTablePair< K, V >::val_.

Here is the call graph for this function:

Member Data Documentation

◆ key_

const K key_

◆ val_

V val_

The mapped data.

Definition at line 102 of file HashTableDetail.H.

Referenced by HashTablePair< K, V >::cval(), HashTablePair< K, V >::print(), and HashTablePair< K, V >::val().

◆ next_

HashTablePair* next_

Addressing (next in collision list)

Definition at line 105 of file HashTableDetail.H.


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