Navigation
API > API/Runtime > API/Runtime/uLangCore
A Robin-Hood hash table Inspired by https://www.sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/ and http://codecapsule.com/2013/11/17/robin-hood-hashing-backward-shift-deletion/
| Name | THashTable |
| Type | class |
| Header File | /Engine/Source/Runtime/Solaris/uLangCore/Public/uLang/Common/Containers/HashTable.h |
| Include Path | #include "uLang/Common/Containers/HashTable.h" |
Syntax
template<class KeyType, class KeyValueType, class HashTraits, class AllocatorType, typename... AllocatorArgsType>
class THashTable
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
THashTable
(
const THashTable& Other |
uLang/Common/Containers/HashTable.h | ||
THashTable
(
AllocatorArgsType&&... AllocatorArgs |
uLang/Common/Containers/HashTable.h | ||
THashTable
(
THashTable&& Other |
uLang/Common/Containers/HashTable.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~THashTable() |
uLang/Common/Containers/HashTable.h |
Structs
| Name | Remarks |
|---|---|
| SEntry |
Interfaces
| Name | Remarks |
|---|---|
| Iterator |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| MaxLoadFactorDenominator | uint64_t | uLang/Common/Containers/HashTable.h | |
| MaxLoadFactorNumerator | uint64_t | Load factor = what fraction of entries are occupied. | uLang/Common/Containers/HashTable.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| uLang/Common/Containers/HashTable.h | |||
| uLang/Common/Containers/HashTable.h | |||
ULANG_FORCEINLINEIterator< true > cbegin() |
uLang/Common/Containers/HashTable.h | ||
ULANG_FORCEINLINEIterator< true > cend() |
uLang/Common/Containers/HashTable.h | ||
ULANG_FORCEINLINE bool Contains
(
const KeyType& Key |
uLang/Common/Containers/HashTable.h | ||
void Empty() |
uLang/Common/Containers/HashTable.h | ||
| uLang/Common/Containers/HashTable.h | |||
| uLang/Common/Containers/HashTable.h | |||
ULANG_FORCEINLINE const KeyValueType * Find
(
const KeyType& Key |
uLang/Common/Containers/HashTable.h | ||
ULANG_FORCEINLINE KeyValueType * Find
(
const KeyType& Key |
uLang/Common/Containers/HashTable.h | ||
KeyValueType * FindByPredicate
(
Predicate Pred |
Finds a key-value pair which matches a predicate functor. | uLang/Common/Containers/HashTable.h | |
const KeyValueType * FindByPredicate
(
Predicate Pred |
Finds an key-value pair which matches a predicate functor. | uLang/Common/Containers/HashTable.h | |
KeyValueType & FindOrInsert
(
KeyValueType&& KeyValue |
uLang/Common/Containers/HashTable.h | ||
KeyValueType & Insert
(
KeyValueType&& KeyValue |
uLang/Common/Containers/HashTable.h | ||
KeyValueType & Insert
(
const KeyValueType& KeyValue |
uLang/Common/Containers/HashTable.h | ||
bool IsEmpty() |
uLang/Common/Containers/HashTable.h | ||
ULANG_FORCEINLINE uint32_t Num() |
uLang/Common/Containers/HashTable.h | ||
bool Remove
(
const KeyType& Key |
uLang/Common/Containers/HashTable.h | ||
void Swap
(
THashTable& Other |
uLang/Common/Containers/HashTable.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Allocate() |
Allocate memory according to currently set _NumEntries. | uLang/Common/Containers/HashTable.h | |
ULANG_FORCEINLINE uint32_t DesiredPos
(
uint32_t Hash |
Get desired position for an entry given a hash value. | uLang/Common/Containers/HashTable.h | |
void Grow() |
Double the size of the table. | uLang/Common/Containers/HashTable.h | |
uint32_t InsertInternal
(
uint32_t Hash, |
Create a new entry Use Robin Hood mechanism to rearrange entries to minimize probe distance Returns position of new entry | uLang/Common/Containers/HashTable.h | |
KeyValueType & InsertInternal
(
KeyValueType&& KeyValue |
uLang/Common/Containers/HashTable.h | ||
ULANG_FORCEINLINE uint32_t Lookup
(
const KeyType& Key |
Look up a key, return its index. | uLang/Common/Containers/HashTable.h | |
ULANG_FORCEINLINE uint32_t ProbeDistance
(
uint32_t Hash, |
Get probe distance of an entry with given hash and position in entry array. | uLang/Common/Containers/HashTable.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static ULANG_FORCEINLINE uint32_t ComputeNonZeroHash
(
const KeyType& Key |
Hash values in the table must not be zero. | uLang/Common/Containers/HashTable.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
THashTable & operator=
(
THashTable Other |
uLang/Common/Containers/HashTable.h |