Loading...
Searching...
No Matches
HashTablePair< K, V > Class Template Reference

Internal storage type for HashTable entries. More...

#include <HashTableDetail.H>

Collaboration diagram for HashTablePair< K, V >:

Public Types

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

Public Member Functions

 HashTablePair (const HashTablePair &)=delete
 No copy construct.
void operator= (const HashTablePair &)=delete
 No copy assignment.
template<class... Args>
 HashTablePair (HashTablePair *next, const key_type &key, Args &&... args)
 Construct from next pointer, key, contents.
const key_typekey () const noexcept
 The key.
const mapped_typecval () const noexcept
 Const access to the mapped value.
const mapped_typeval () const noexcept
 Const access to the mapped value.
mapped_typeval () noexcept
 Non-const access to the mapped value.
bool operator< (const HashTablePair &rhs) const
 Compare keys.
void print (Ostream &os) const
 Write (key, val) pair.

Static Public Member Functions

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

Public Attributes

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

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 84 of file HashTableDetail.H.

Member Typedef Documentation

◆ key_type

template<class K, class V>
typedef K key_type

Type of key.

Definition at line 91 of file HashTableDetail.H.

◆ mapped_type

template<class K, class V>
typedef V mapped_type

Type of content.

Definition at line 96 of file HashTableDetail.H.

Constructor & Destructor Documentation

◆ HashTablePair() [1/2]

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

No copy construct.

References HashTablePair().

Referenced by HashTablePair(), HashTablePair(), operator<(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HashTablePair() [2/2]

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

Construct from next pointer, key, contents.

Definition at line 144 of file HashTableDetail.H.

References args, HashTablePair(), key(), key_, next_, and val_.

Here is the call graph for this function:

Member Function Documentation

◆ stores_value()

template<class K, class V>
constexpr bool stores_value ( )
inlinestaticconstexprnoexcept

This class stores a value.

Definition at line 101 of file HashTableDetail.H.

References Foam::noexcept.

◆ operator=()

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

No copy assignment.

References HashTablePair().

Here is the call graph for this function:

◆ key()

template<class K, class V>
const key_type & key ( ) const
inlinenoexcept

The key.

Definition at line 162 of file HashTableDetail.H.

References key_, and Foam::noexcept.

Referenced by HashTablePair().

Here is the caller graph for this function:

◆ cval()

template<class K, class V>
const mapped_type & cval ( ) const
inlinenoexcept

Const access to the mapped value.

Definition at line 170 of file HashTableDetail.H.

References Foam::noexcept, and val_.

◆ val() [1/2]

template<class K, class V>
const mapped_type & val ( ) const
inlinenoexcept

Const access to the mapped value.

Definition at line 178 of file HashTableDetail.H.

References Foam::noexcept, and val_.

◆ val() [2/2]

template<class K, class V>
mapped_type & val ( )
inlinenoexcept

Non-const access to the mapped value.

Definition at line 186 of file HashTableDetail.H.

References Foam::noexcept, and val_.

◆ operator<()

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

Compare keys.

Definition at line 195 of file HashTableDetail.H.

References HashTablePair(), key_, and Foam::rhs().

Here is the call graph for this function:

◆ print()

template<class K, class V>
void print ( Ostream & os) const
inline

Write (key, val) pair.

Definition at line 203 of file HashTableDetail.H.

References key_, os(), and val_.

Here is the call graph for this function:

Member Data Documentation

◆ key_

template<class K, class V>
const K key_

The lookup key.

Definition at line 112 of file HashTableDetail.H.

Referenced by HashTablePair(), key(), operator<(), and print().

◆ val_

template<class K, class V>
V val_

The mapped data.

Definition at line 117 of file HashTableDetail.H.

Referenced by cval(), HashTablePair(), print(), val(), and val().

◆ next_

template<class K, class V>
HashTablePair* next_

Addressing (next in collision list).

Definition at line 122 of file HashTableDetail.H.

Referenced by HashTablePair().


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