HashMapEntry< K, V, ENTRY_HANDLER, HASH > Class Template Reference

#include <hashmap.h>

Inheritance diagram for HashMapEntry< K, V, ENTRY_HANDLER, HASH >:

Detailed Description

template<typename K, typename V, typename ENTRY_HANDLER, typename HASH>
class maxon::HashMapEntry< K, V, ENTRY_HANDLER, HASH >

Class used for entries of the HashMap. The entries of a bucket are stored as a singly linked list, you can loop over this list via GetNextInBucket().

Public Types

using KeyType = K
 
using ValueType = V
 
using HashValueType = typename ENTRY_HANDLER::HashValueType
 
using EntryBase = HashMapEntryBase< K, V, ENTRY_HANDLER >
 
- Public Types inherited from HashMapEntryBase< K, V, ENTRY_HANDLER, LAYOUT >
using EntryHandler = ENTRY_HANDLER
 
using HashValueType = typename ENTRY_HANDLER::HashValueType
 

Public Member Functions

 operator Pair< K, V > () const
 
const HashMapEntryGetNextWithSameKey () const
 
HashMapEntryGetNextWithSameKey ()
 
const HashMapEntryGetNextInBucket () const
 
HashMapEntryGetNextInBucket ()
 
void PrivateInitNextInBucket (HashMapEntry *next)
 
SFINAEHelper< String, V >::type ToString (const FormatStatement *format=nullptr) const
 
Int GetMemorySize () const
 
template<Int I>
decltype(auto) get () const
 
template<Int I>
decltype(auto) get ()
 
- Public Member Functions inherited from HashMapEntryBase< K, V, ENTRY_HANDLER, LAYOUT >
V & GetValue ()
 
const V & GetValue () const
 
V & GetSecond ()
 
const V & GetSecond () const
 
void SetValue (const V &value)
 
void SetValue (V &&value)
 
void ResetValue ()
 
const HashValueTypeGetKeyHashCode () const
 
Int GetMemorySize () const
 
 HashMapEntryBase (HashValueType hash)
 
template<typename KEY >
 HashMapEntryBase (HashValueType hash, const KEY &)
 
template<typename KEY , typename A >
 HashMapEntryBase (HashValueType hash, const KEY &, A &&value)
 

Private Member Functions

 MAXON_DISALLOW_COPY_AND_ASSIGN (HashMapEntry)
 

Friends

template<typename IK , typename IV , typename IHASH , typename IENTRY_HANDLER , typename ALLOCATOR , HASHMAP_MODE MODE, Int INITIAL_CAPACITY, Int LOAD_FACTOR, typename ENTRY_ALLOCATOR >
class HashMap
 

Additional Inherited Members

- Public Attributes inherited from HashMapEntryBase< K, V, ENTRY_HANDLER, LAYOUT >
decltype(ENTRY_HANDLER::GetKey(*(V *) nullptr) GetKey )() const
 
decltype(ENTRY_HANDLER::GetKey(*(V *) nullptr) GetFirst )() const
 
- Protected Member Functions inherited from HashMapEntryBase< K, V, ENTRY_HANDLER, LAYOUT >
 MAXON_DISALLOW_COPY_AND_ASSIGN (HashMapEntryBase)
 
- Protected Attributes inherited from HashMapEntryBase< K, V, ENTRY_HANDLER, LAYOUT >
HashMapEntryBase_next
 
HashValueType _hashCode
 
_value
 

Member Typedef Documentation

◆ KeyType

using KeyType = K

◆ ValueType

using ValueType = V

◆ HashValueType

using HashValueType = typename ENTRY_HANDLER::HashValueType

◆ EntryBase

using EntryBase = HashMapEntryBase<K, V, ENTRY_HANDLER>

Member Function Documentation

◆ operator Pair< K, V >()

operator Pair< K, V > ( ) const

◆ GetNextWithSameKey() [1/2]

const HashMapEntry* GetNextWithSameKey ( ) const

Returns the next entry with the same key. This is needed for multi-maps to iterate over all entries for a key, see InsertMultiEntry().

Returns
Next entry with the same key, or nullptr if there is no further entry with the same key.

◆ GetNextWithSameKey() [2/2]

HashMapEntry* GetNextWithSameKey ( )

Returns the next entry with the same key. This is needed for multi-maps to iterate over all entries for a key, see InsertMultiEntry().

Returns
Next entry with the same key, or nullptr if there is no further entry with the same key.

◆ GetNextInBucket() [1/2]

const HashMapEntry* GetNextInBucket ( ) const

Returns the next entry in the same bucket.

Returns
Next entry in bucket, or nullptr if this is the last entry.

◆ GetNextInBucket() [2/2]

HashMapEntry* GetNextInBucket ( )

Returns the next entry in the same bucket.

Returns
Next entry in bucket, or nullptr if this is the last entry.

◆ PrivateInitNextInBucket()

void PrivateInitNextInBucket ( HashMapEntry< K, V, ENTRY_HANDLER, HASH > *  next)

◆ ToString()

SFINAEHelper<String, V>::type ToString ( const FormatStatement format = nullptr) const

◆ GetMemorySize()

Int GetMemorySize ( ) const

◆ get() [1/2]

decltype(auto) get ( ) const

◆ get() [2/2]

decltype(auto) get ( )

◆ MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( HashMapEntry< K, V, ENTRY_HANDLER, HASH >  )
private

Friends And Related Function Documentation

◆ HashMap

friend class HashMap
friend