UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs > Struct Template Reference

#include <SherwoodHashTable.h>

Classes

struct  FData
 

Public Types

using HashType = uint32
 

Public Member Functions

 TSherwoodHashTable ()=default
 
 TSherwoodHashTable (const TSherwoodHashTable &)=delete
 
 TSherwoodHashTable (TSherwoodHashTable &&)=delete
 
TSherwoodHashTableoperator= (const TSherwoodHashTable &)=delete
 
TSherwoodHashTableoperator= (TSherwoodHashTable &&)=delete
 
 ~TSherwoodHashTable ()
 
void Reset ()
 
void Empty ()
 
uint32 NumSlots () const
 
FORCEINLINE_DEBUGGABLE TTuple< const KeyType *, ValueType * > Find (KeyType Key) const
 
FORCEINLINE_DEBUGGABLE ValueType * FindOrAdd (KeyType Key, ValueType Value, bool *bIsAlreadyInContainerPtr=nullptr)
 
FORCEINLINE_DEBUGGABLE ValueType * FindOrAddByHash (KeyType Key, HashType Hash, ValueType Value, bool *bIsAlreadyInContainerPtr=nullptr)
 
FORCENOINLINE ValueType * Add (int8 Distance, FData &Data, uint32 Cursor, KeyType Key, HashType Hash, ValueType Value)
 
void Rehash (uint32 DesiredNumSlots)
 
void Grow ()
 
void Reserve (uint32 DesiredNumElements)
 

Static Public Member Functions

template<typename T >
static T * AllocateUninitialized (uint32 Count)
 
static void Deallocate (void *Ptr)
 
static void DeallocateData (FData &Data)
 
static uint8 ComputeMaxLookups (uint32 InNumSlots)
 
static FData AllocateData (uint32 Count)
 

Public Attributes

FData CurrentData
 
uint32 NumSlotsMinusOne = 0
 
int8 MaxLookups = 0
 
int32 NumElements = 0
 

Static Public Attributes

static constexpr bool bIsMap = !std::is_same_v<ValueType, FNoopStruct>
 
static constexpr uint32 MinNumLookups = 4
 
static constexpr uint32 MinNumSlots = 4
 
static constexpr float MaxLoadFactor = 0.9f
 

Detailed Description

template<typename KeyType, typename ValueType, typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
struct Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >

Implementation of Robin Hood hash table based on sherwood_v3_table by Malte Skarupke. Good for small keys and values. If key is already a high quality hash, then identity hash function should be used. Current limitations:

  • Requires key and value to be trivial types.
  • Does not allow move or copy.
  • Does not support custom allocators.

Member Typedef Documentation

◆ HashType

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
using Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::HashType = uint32

Constructor & Destructor Documentation

◆ TSherwoodHashTable() [1/3]

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::TSherwoodHashTable ( )
default

◆ TSherwoodHashTable() [2/3]

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::TSherwoodHashTable ( const TSherwoodHashTable< KeyType, ValueType, KeyFuncs > &  )
delete

◆ TSherwoodHashTable() [3/3]

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::TSherwoodHashTable ( TSherwoodHashTable< KeyType, ValueType, KeyFuncs > &&  )
delete

◆ ~TSherwoodHashTable()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::~TSherwoodHashTable ( )
inline

Member Function Documentation

◆ Add()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
FORCENOINLINE ValueType * Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::Add ( int8  Distance,
FData Data,
uint32  Cursor,
KeyType  Key,
HashType  Hash,
ValueType  Value 
)
inline

◆ AllocateData()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
static FData Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::AllocateData ( uint32  Count)
inlinestatic

◆ AllocateUninitialized()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
template<typename T >
static T * Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::AllocateUninitialized ( uint32  Count)
inlinestatic

◆ ComputeMaxLookups()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
static uint8 Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::ComputeMaxLookups ( uint32  InNumSlots)
inlinestatic

◆ Deallocate()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
static void Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::Deallocate ( void Ptr)
inlinestatic

◆ DeallocateData()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
static void Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::DeallocateData ( FData Data)
inlinestatic

◆ Empty()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
void Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::Empty ( )
inline

◆ Find()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
FORCEINLINE_DEBUGGABLE TTuple< const KeyType *, ValueType * > Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::Find ( KeyType  Key) const
inline

◆ FindOrAdd()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
FORCEINLINE_DEBUGGABLE ValueType * Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::FindOrAdd ( KeyType  Key,
ValueType  Value,
bool bIsAlreadyInContainerPtr = nullptr 
)
inline

◆ FindOrAddByHash()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
FORCEINLINE_DEBUGGABLE ValueType * Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::FindOrAddByHash ( KeyType  Key,
HashType  Hash,
ValueType  Value,
bool bIsAlreadyInContainerPtr = nullptr 
)
inline

◆ Grow()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
void Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::Grow ( )
inline

◆ NumSlots()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
uint32 Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::NumSlots ( ) const
inline

◆ operator=() [1/2]

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
TSherwoodHashTable & Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::operator= ( const TSherwoodHashTable< KeyType, ValueType, KeyFuncs > &  )
delete

◆ operator=() [2/2]

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
TSherwoodHashTable & Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::operator= ( TSherwoodHashTable< KeyType, ValueType, KeyFuncs > &&  )
delete

◆ Rehash()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
void Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::Rehash ( uint32  DesiredNumSlots)
inline

◆ Reserve()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
void Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::Reserve ( uint32  DesiredNumElements)
inline

◆ Reset()

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
void Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::Reset ( )
inline

Member Data Documentation

◆ bIsMap

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
constexpr bool Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::bIsMap = !std::is_same_v<ValueType, FNoopStruct>
staticconstexpr

◆ CurrentData

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
FData Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::CurrentData

◆ MaxLoadFactor

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
constexpr float Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::MaxLoadFactor = 0.9f
staticconstexpr

◆ MaxLookups

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
int8 Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::MaxLookups = 0

◆ MinNumLookups

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
constexpr uint32 Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::MinNumLookups = 4
staticconstexpr

◆ MinNumSlots

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
constexpr uint32 Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::MinNumSlots = 4
staticconstexpr

◆ NumElements

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
int32 Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::NumElements = 0

◆ NumSlotsMinusOne

template<typename KeyType , typename ValueType , typename KeyFuncs = TSherwoodHashKeyFuncs<KeyType, ValueType>>
uint32 Experimental::TSherwoodHashTable_Private::TSherwoodHashTable< KeyType, ValueType, KeyFuncs >::NumSlotsMinusOne = 0

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