HashMap< K, V, HASH, ENTRY_HANDLER, ALLOCATOR, MODE, INITIAL_CAPACITY, LOAD_FACTOR >::Entry Class Reference

#include <hashmap.h>

Inheritance diagram for HashMap< K, V, HASH, ENTRY_HANDLER, ALLOCATOR, MODE, INITIAL_CAPACITY, LOAD_FACTOR >::Entry:

详细描述

template<typename K, typename V, typename HASH = DefaultCompare, typename ENTRY_HANDLER = HashMapKeyValuePair, typename ALLOCATOR = DefaultAllocator, HASHMAP_MODE MODE = HASHMAP_MODE::DEFAULT, Int INITIAL_CAPACITY = 16, Int LOAD_FACTOR = (MODE == HASHMAP_MODE::SYNCHRONIZED) ? 0 : 10>
class maxon::HashMap< K, V, HASH, ENTRY_HANDLER, ALLOCATOR, MODE, INITIAL_CAPACITY, LOAD_FACTOR >::Entry

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
-  Public Types inherited from HashMapEntryBase< K, V, Entry, ENTRY_HANDLER >
using  EntryHandler = ENTRY_HANDLER

公共成员函数

  operator Pair< K, V > () const
const Entry GetNextWithSameKey () const
Entry GetNextWithSameKey ()
const Entry GetNextInBucket () const
Entry GetNextInBucket ()
void  PrivateInitNextInBucket ( Entry *next)
SFINAEHelper < String , V >::type  ToString (const FormatStatement *format=nullptr) const
Int   GetMemorySize () const
-  Public Member Functions inherited from HashMapEntryBase< K, V, Entry, ENTRY_HANDLER >
V &  GetValue ()
const V &  GetValue () const
V &  GetSecond ()
const V &  GetSecond () const
void  SetValue (const V &value)
void  SetValue (V &&value)
void  ResetValue ()
HashInt   GetHashCode () const
Int   GetMemorySize () const
  HashMapEntryBase ( UInt hash)
  HashMapEntryBase ( UInt hash, const KEY &)
  HashMapEntryBase ( UInt hash, const KEY &, A &&value)

静态公共成员函数

static const Entry Get (const V *value)
static Entry Get (typename std::remove_const< V >::type *value)

Private Types

using  Super = HashMapEntryBase < K, V, Entry , ENTRY_HANDLER >

私有成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( Entry )

Friends

class  HashMap

Additional Inherited Members

-  Public Attributes inherited from HashMapEntryBase< K, V, Entry, ENTRY_HANDLER >
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, ENTRY_HANDLER >
  MAXON_DISALLOW_COPY_AND_ASSIGN ( HashMapEntryBase )
-  Protected Attributes inherited from HashMapEntryBase< K, V, Entry, ENTRY_HANDLER >
Entry *  _next
UInt   _hashCode
_value

Member Typedef Documentation

◆  Super

using Super = HashMapEntryBase <K, V, Entry , ENTRY_HANDLER>
private

◆  KeyType

using KeyType = K

◆  ValueType

using ValueType = V

成员函数文档编制

◆  operator Pair< K, V >()

operator Pair < K, V > ( ) const

◆  GetNextWithSameKey() [1/2]

const Entry * 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() .

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

◆  GetNextWithSameKey() [2/2]

Entry * 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() .

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

◆  GetNextInBucket() [1/2]

const Entry * GetNextInBucket ( ) const

Returns the next entry in the same bucket.

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

◆  GetNextInBucket() [2/2]

Entry * GetNextInBucket ( )

Returns the next entry in the same bucket.

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

◆  PrivateInitNextInBucket()

void PrivateInitNextInBucket ( Entry next )

◆  ToString()

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

◆  GetMemorySize()

Int GetMemorySize ( ) const

◆  Get() [1/2]

static const Entry * Get ( const V *  value )
static

◆  Get() [2/2]

static Entry * Get ( typename std::remove_const< V >::type *  value )
static

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( Entry   )
private

Friends And Related Function Documentation

◆  HashMap

friend class HashMap
friend