![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <HashMappedArray.h>
Public Types | |
| using | FIDType = TIDType |
| using | FElementType = TElementType |
| using | FTraits = TTraits |
| using | FHashType = uint32 |
| using | FType = THashMappedArray< FIDType, FElementType, FTraits > |
Public Member Functions | |
| THashMappedArray (const int32 InHashSize) | |
| void | Reset (const int32 InReserveElements) |
| FORCEINLINE bool | TryAdd (const FIDType ID, const FElementType &Element) |
| template<typename... ArgsType> | |
| FORCEINLINE bool | TryEmplace (const FIDType ID, ArgsType &&... Args) |
| FORCEINLINE void | Add (const FIDType ID, const FElementType &Element) |
| template<typename... ArgsType> | |
| FORCEINLINE void | Emplace (const FIDType ID, ArgsType &&... Args) |
| void | Remove (const FIDType ID) |
| const FElementType * | Find (const FIDType ID) const |
| FElementType * | Find (const FIDType ID) |
| int32 | Num () const |
| FElementType & | At (const int32 ElementIndex) |
| const FElementType & | At (const int32 ElementIndex) const |
| TArray< FElementType > | ExtractElements () |
A HashMap using FHashTable to index an array of elements of type TElementType, whcih should be uniquely identified by an object of type TIDType.
E.g., using FMyDataID = int32; struct FMyData { FMyDataID ID; // Every FMyData will require a unique ID if using the default THashMappedArrayTraits float MyValue; };
const int32 HashTableSize = 128; // Must be power of 2 THashMapedArray<FMyDataID, FMyData> MyDataMap(HashTableSize);
MyDataMap.Add(1, { 1, 1.0 }); // NOTE: ID passed twice. Once for the hash map and once to construct FMyData MyDataMap.Emplace(2, 2, 2.0); // NOTE: ID passed twice. Once for the hash map and once for forwarding args to FMyData
const FMyData* MyData2 = MyDataMap.Find(2); // MyData2->MyValue == 2.0
| using Chaos::Private::THashMappedArray< TIDType, TElementType, TTraits >::FElementType = TElementType |
| using Chaos::Private::THashMappedArray< TIDType, TElementType, TTraits >::FHashType = uint32 |
| using Chaos::Private::THashMappedArray< TIDType, TElementType, TTraits >::FIDType = TIDType |
| using Chaos::Private::THashMappedArray< TIDType, TElementType, TTraits >::FTraits = TTraits |
| using Chaos::Private::THashMappedArray< TIDType, TElementType, TTraits >::FType = THashMappedArray<FIDType, FElementType, FTraits> |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |