Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Containers/Map.h |
Include |
#include "Containers/Map.h" |
template<typename KeyType, typename ValueType, typename SetAllocator, typename KeyFuncs>
class TMapBase
The base class of maps from keys to values. Implemented using a TSet of key-value pairs with a custom KeyFuncs, with the same O(1) addition, removal, and finding.
The ByHash() functions are somewhat dangerous but particularly useful in two scenarios: Heterogeneous lookup to avoid creating expensive keys like FString when looking up by const TCHAR*. You must ensure the hash is calculated in the same way as ElementType is hashed. If possible put both ComparableKey and ElementType hash functions next to each other in the same header to avoid bugs when the ElementType hash function is changed. Reducing contention around hash tables protected by a lock. It is often important to incur the cache misses of reading key data and doing the hashing before acquiring the lock.
Name | Description | ||
---|---|---|---|
|
Pairs |
A set of the key-value pairs in the map. |
Name | Description | |
---|---|---|
|
TMapBase() |
|
|
TMapBase ( |
|
|
TMapBase ( |
|
|
TMapBase ( |
Constructor for moving elements from a TMap with a different SetAllocator |
|
TMapBase ( |
Constructor for copying elements from a TMap with a different SetAllocator |
Name | Description | ||
---|---|---|---|
|
ValueType & |
Add ( |
|
|
ValueType & |
Add ( |
|
|
ValueType & |
Add ( |
|
|
ValueType & |
Add ( |
Set the value associated with a key. |
|
ValueType & |
Add ( |
|
|
ValueType & |
Add ( |
Set the value associated with a key. |
|
ValueType & |
Add ( |
|
|
ValueType & |
Add ( |
Set a default value associated with a key. |
|
ValueType & |
AddByHash ( |
See Add() and class documentation section on ByHash() functions |
|
ValueType & |
AddByHash ( |
|
|
ValueType & |
AddByHash ( |
|
|
ValueType & |
AddByHash ( |
|
|
ValueType & |
AddByHash ( |
|
|
ValueType & |
AddByHash ( |
See Add() and class documentation section on ByHash() functions |
|
void |
AppendHash ( |
|
|
Array() |
Copy the key/value pairs in this map into an array. |
|
|
TRangedForCo... |
begin() |
|
|
TRangedForIt... |
begin() |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support. |
|
void |
Compact() |
Compacts the pair set to remove holes |
|
void |
CompactStable() |
Compacts the pair set to remove holes. Does not change the iteration order of the elements. |
|
bool |
Contains ( |
Check if map contains the specified key. |
|
bool |
ContainsByHash ( |
See Contains() and class documentation section on ByHash() functions |
|
void |
CopyUnfrozen ( |
|
|
void |
CountBytes ( |
Track the container's memory use through an archive. |
|
TConstIterat... |
CreateConstIterator() |
Creates a const iterator over all the pairs in this map |
|
TConstKeyIte... |
CreateConstKeyIterator ( |
Creates a const iterator over the values associated with a specified key in a map |
|
CreateIterator() |
Creates an iterator over all the pairs in this map |
|
|
CreateKeyIterator ( |
Creates an iterator over the values associated with a specified key in a map |
|
|
void |
Dump ( |
Describes the map's contents through an output device. |
|
ValueType & |
Emplace ( |
Sets the value associated with a key. |
|
ValueType & |
Emplace ( |
Set a default value associated with a key. |
|
ValueType & |
EmplaceByHash ( |
See Emplace() and class documentation section on ByHash() functions |
|
ValueType & |
EmplaceByHash ( |
See Emplace() and class documentation section on ByHash() functions |
|
void |
Empty ( |
Removes all elements from the map. |
|
TRangedForIt... |
end() |
|
|
TRangedForCo... |
end() |
|
|
TMap< KeyTyp... |
FilterByPredicate ( |
Filters the elements in the map based on a predicate functor. |
|
ValueType &#... |
Find ( |
Find the value associated with a specified key. |
|
const ValueT... |
Find ( |
|
|
const ValueT... |
FindByHash ( |
|
|
ValueType &#... |
FindByHash ( |
See Find() and class documentation section on ByHash() functions |
|
ValueType & |
FindChecked ( |
Find a reference to the value associated with a specified key. |
|
const ValueT... |
FindChecked ( |
Find a reference to the value associated with a specified key. |
|
const KeyTyp... |
FindKey ( |
Find the key associated with the specified value. The time taken is O(N) in the number of pairs. |
|
ValueType & |
FindOrAdd ( |
|
|
ValueType & |
FindOrAdd ( |
|
|
ValueType & |
FindOrAdd ( |
|
|
ValueType & |
FindOrAdd ( |
|
|
ValueType & |
FindOrAdd ( |
Find the value associated with a specified key, or if none exists, adds a value using the default constructor. |
|
ValueType & |
FindOrAdd ( |
Find the value associated with a specified key, or if none exists, adds a value using the default constructor. |
|
ValueType & |
FindOrAddByHash ( |
|
|
ValueType & |
FindOrAddByHash ( |
|
|
ValueType & |
FindOrAddByHash ( |
See FindOrAdd() and class documentation section on ByHash() functions |
|
ValueType & |
FindOrAddByHash ( |
|
|
ValueType & |
FindOrAddByHash ( |
|
|
ValueType & |
FindOrAddByHash ( |
See FindOrAdd() and class documentation section on ByHash() functions |
|
ValueType |
FindRef ( |
Find the value associated with a specified key. |
|
void |
GenerateKeyArray ( |
Generate an array from the keys in this map. |
|
void |
GenerateValueArray ( |
Generate an array from the values in this map. |
|
ElementType ... |
Get ( |
Return a mapped pair by internal identifier. Element must be valid (see ). |
|
const Elemen... |
Get ( |
Return a mapped pair by internal identifier. Element must be valid (see ). |
|
SIZE_T |
GetAllocatedSize() |
Helper function to return the amount of memory allocated by this container . |
|
int32 |
GetKeys ( |
Get the unique keys contained within this map. |
|
int32 |
GetKeys ( |
Get the unique keys contained within this map. |
|
int32 |
GetMaxIndex() |
|
|
bool |
IsEmpty() |
Returns true if the map is empty and contains no elements. |
|
bool |
IsValidId ( |
Checks whether an element id is valid. |
|
int32 |
Num() |
|
|
bool |
OrderIndependentCompareEqual ( |
Compare this map with another for equality. |
|
int32 |
Remove ( |
Remove all value associations for a key. |
|
int32 |
RemoveByHash ( |
See Remove() and class documentation section on ByHash() functions |
|
void |
Reserve ( |
Preallocates enough memory to contain Number elements |
|
void |
Reset() |
Efficiently empties out the map but preserves all allocations and capacities |
|
void |
Shrink() |
Shrinks the pair set to avoid slack. |
|
void |
WriteMemoryImage ( |
Name | Description | ||
---|---|---|---|
|
TMapBase & |
operator= ( |
Assignment operator for moving elements from a TMap with a different SetAllocator |
|
TMapBase & |
operator= ( |
|
|
TMapBase & |
operator= ( |
|
|
TMapBase & |
operator= ( |
Assignment operator for copying elements from a TMap with a different SetAllocator |
Name |
Description |
|
---|---|---|
|
TBaseIterator |
The base of TMapBase iterators. |
|
TBaseKeyIterator |
The base type of iterators that iterate over the values associated with a specified key. |
|
TConstIterator |
Const map iterator. |
|
TConstKeyIterator |
Iterates over values associated with a specified key in a const map. |
|
TIterator |
Map iterator. |
|
TKeyIterator |
Iterates over values associated with a specified key in a map. |