Navigation
API > API/Runtime > API/Runtime/Core
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.
| Name | TSherwoodHashTable |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Experimental/Containers/SherwoodHashTable.h |
| Include Path | #include "Experimental/Containers/SherwoodHashTable.h" |
Syntax
template<typename KeyType, typename ValueType, typename KeyFuncs>
struct TSherwoodHashTable
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| NOTE: Non-trivial type support, move and copy ops are not implemented yet, but can be. | Experimental/Containers/SherwoodHashTable.h | ||
TSherwoodHashTable
(
const TSherwoodHashTable& |
Experimental/Containers/SherwoodHashTable.h | ||
| Experimental/Containers/SherwoodHashTable.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TSherwoodHashTable() |
Experimental/Containers/SherwoodHashTable.h |
Structs
| Name | Remarks |
|---|---|
| FData |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| HashType | uint32 | Experimental/Containers/SherwoodHashTable.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bIsMap | bool | TSherwoodHashTable can be used to implement a set or a map. | Experimental/Containers/SherwoodHashTable.h |
| MaxLoadFactor | float | Ratio between number of stored elements and allocated capacity beyond which the container will be grown (doubled in size). | Experimental/Containers/SherwoodHashTable.h |
| MinNumLookups | uint32 | Minimum probing distance when searching for an entry slot. | Experimental/Containers/SherwoodHashTable.h |
| MinNumSlots | uint32 | Smallest capacity of non-empty container. | Experimental/Containers/SherwoodHashTable.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CurrentData | FData | Experimental/Containers/SherwoodHashTable.h | ||
| MaxLookups | int8 | Experimental/Containers/SherwoodHashTable.h | ||
| NumElements | int32 | Experimental/Containers/SherwoodHashTable.h | ||
| NumSlotsMinusOne | uint32 | Experimental/Containers/SherwoodHashTable.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ValueType * Add
(
int8 Distance, |
Experimental/Containers/SherwoodHashTable.h | ||
void Empty() |
Experimental/Containers/SherwoodHashTable.h | ||
TTuple< const KeyType *, ValueType * > Find
(
KeyType Key |
Experimental/Containers/SherwoodHashTable.h | ||
ValueType * FindOrAdd
(
KeyType Key, |
Experimental/Containers/SherwoodHashTable.h | ||
ValueType * FindOrAddByHash
(
KeyType Key, |
Experimental/Containers/SherwoodHashTable.h | ||
void Grow() |
Experimental/Containers/SherwoodHashTable.h | ||
uint32 NumSlots() |
Experimental/Containers/SherwoodHashTable.h | ||
void Rehash
(
uint32 DesiredNumSlots |
Experimental/Containers/SherwoodHashTable.h | ||
void Reserve
(
uint32 DesiredNumElements |
Experimental/Containers/SherwoodHashTable.h | ||
void Reset() |
Experimental/Containers/SherwoodHashTable.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FData AllocateData
(
uint32 Count |
Experimental/Containers/SherwoodHashTable.h | ||
static T * AllocateUninitialized
(
uint32 Count |
Experimental/Containers/SherwoodHashTable.h | ||
static uint8 ComputeMaxLookups
(
uint32 InNumSlots |
Experimental/Containers/SherwoodHashTable.h | ||
static void Deallocate
(
void* Ptr |
Experimental/Containers/SherwoodHashTable.h | ||
static void DeallocateData
(
FData& Data |
Experimental/Containers/SherwoodHashTable.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSherwoodHashTable & operator=
(
const TSherwoodHashTable& |
Experimental/Containers/SherwoodHashTable.h | ||
| Experimental/Containers/SherwoodHashTable.h |