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
 The key. More...
 
const mapped_typecval () const
 Const access to the mapped value. More...
 
mapped_typeval ()
 Non-const access to the mapped value. 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 struct stores a value. More...
 

Public Attributes

key_type key_
 The lookup key. More...
 
mapped_type 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.

Structure with a (K,V) tuple and a linked-list for 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 120 of file HashTableDetail.H.

Member Function Documentation

◆ stores_value()

static constexpr bool stores_value ( )
inlinestaticconstexprnoexcept

This struct 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
inline

The key.

Definition at line 133 of file HashTableDetail.H.

References HashTablePair< K, V >::key_.

◆ cval()

const mapped_type& cval ( ) const
inline

Const access to the mapped value.

Definition at line 139 of file HashTableDetail.H.

References HashTablePair< K, V >::val_.

◆ val()

mapped_type& val ( )
inline

Non-const access to the mapped value.

Definition at line 145 of file HashTableDetail.H.

References HashTablePair< K, V >::val_.

◆ 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 160 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 180 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_

key_type key_

The lookup key.

Definition at line 99 of file HashTableDetail.H.

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

◆ 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: