|
| FORCEINLINE ValueType & | Add (const KeyType &InKey) |
| | Set a default value associated with a key. 更多...
|
| |
| FORCEINLINE ValueType & | Add (const KeyType &InKey, const ValueType &InValue) |
| | Set the value associated with a key. 更多...
|
| |
| FORCEINLINE ValueType & | Add (const TTuple< KeyType, ValueType > &InKeyValue) |
| | Set the value associated with a key. 更多...
|
| |
|
FORCEINLINE ValueType & | AddByHash (uint32 KeyHash, const KeyType &InKey) |
| | See Add() and class documentation section on ByHash() functions
|
| |
|
FORCEINLINE ValueType & | AddByHash (uint32 KeyHash, const KeyType &InKey, const ValueType &InValue) |
| | See Add() and class documentation section on ByHash() functions
|
| |
|
FORCEINLINE TRangedForIterator | begin () |
| | DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
|
| |
|
FORCEINLINE void | Compact () |
| | Compacts the pair set to remove holes
|
| |
| FORCEINLINE void | CompactStable () |
| | Compacts the pair set to remove holes. 更多...
|
| |
| FORCEINLINE bool | Contains (KeyConstPointerType Key) const |
| | Check if map contains the specified key. 更多...
|
| |
|
template<typename ComparableKey > |
| FORCEINLINE bool | ContainsByHash (uint32 KeyHash, const ComparableKey &Key) const |
| | See Contains() and class documentation section on ByHash() functions
|
| |
| FORCEINLINE void | CountBytes (FArchive &Ar) const |
| | Track the container's memory use through an archive. 更多...
|
| |
|
FORCEINLINE TConstIterator | CreateConstIterator () const |
| | Creates a const iterator over all the pairs in this map
|
| |
|
FORCEINLINE TConstKeyIterator | CreateConstKeyIterator (KeyInitType InKey) const |
| | Creates a const iterator over the values associated with a specified key in a map
|
| |
|
FORCEINLINE TIterator | CreateIterator () |
| | Creates an iterator over all the pairs in this map
|
| |
|
FORCEINLINE TKeyIterator | CreateKeyIterator (KeyInitType InKey) |
| | Creates an iterator over the values associated with a specified key in a map
|
| |
| void | Dump (FOutputDevice &Ar) |
| | Describes the map's contents through an output device. 更多...
|
| |
| template<typename InitKeyType > |
| ValueType & | Emplace (InitKeyType &&InKey) |
| | Set a default value associated with a key. 更多...
|
| |
| template<typename InitKeyType , typename InitValueType > |
| ValueType & | Emplace (InitKeyType &&InKey, InitValueType &&InValue) |
| | Sets the value associated with a key. 更多...
|
| |
|
template<typename InitKeyType > |
| ValueType & | EmplaceByHash (uint32 KeyHash, InitKeyType &&InKey) |
| | See Emplace() and class documentation section on ByHash() functions
|
| |
|
template<typename InitKeyType , typename InitValueType > |
| ValueType & | EmplaceByHash (uint32 KeyHash, InitKeyType &&InKey, InitValueType &&InValue) |
| | See Emplace() and class documentation section on ByHash() functions
|
| |
| FORCEINLINE void | Empty (int32 ExpectedNumElements=0) |
| | Removes all elements from the map. 更多...
|
| |
| FORCEINLINE ValueType * | Find (KeyConstPointerType Key) |
| | Find the value associated with a specified key. 更多...
|
| |
|
template<typename ComparableKey > |
| FORCEINLINE ValueType * | FindByHash (uint32 KeyHash, const ComparableKey &Key) |
| | See Find() and class documentation section on ByHash() functions
|
| |
| FORCEINLINE ValueType & | FindChecked (KeyConstPointerType Key) |
| | Find a reference to the value associated with a specified key. 更多...
|
| |
| FORCEINLINE const ValueType & | FindChecked (KeyConstPointerType Key) const |
| | Find a reference to the value associated with a specified key. 更多...
|
| |
| const KeyType * | FindKey (ValueInitType Value) const |
| | Find the key associated with the specified value. 更多...
|
| |
| FORCEINLINE ValueType & | FindOrAdd (const KeyType &Key) |
| | Find the value associated with a specified key, or if none exists, adds a value using the default constructor. 更多...
|
| |
| FORCEINLINE ValueType & | FindOrAdd (const KeyType &Key, const ValueType &Value) |
| | Find the value associated with a specified key, or if none exists, adds a value using the default constructor. 更多...
|
| |
|
FORCEINLINE ValueType & | FindOrAddByHash (uint32 KeyHash, const KeyType &Key) |
| | See FindOrAdd() and class documentation section on ByHash() functions
|
| |
|
FORCEINLINE ValueType & | FindOrAddByHash (uint32 KeyHash, const KeyType &Key, const ValueType &Value) |
| | See FindOrAdd() and class documentation section on ByHash() functions
|
| |
| FORCEINLINE ValueType | FindRef (KeyConstPointerType Key) const |
| | Find the value associated with a specified key. 更多...
|
| |
| template<typename Allocator > |
| void | GenerateKeyArray (TArray< KeyType, Allocator > &OutArray) const |
| | Generate an array from the keys in this map. 更多...
|
| |
| template<typename Allocator > |
| void | GenerateValueArray (TArray< ValueType, Allocator > &OutArray) const |
| | Generate an array from the values in this map. 更多...
|
| |
| FORCEINLINE uint32 | GetAllocatedSize () const |
| | Helper function to return the amount of memory allocated by this container . 更多...
|
| |
| template<typename Allocator > |
| int32 | GetKeys (TArray< KeyType, Allocator > &OutKeys) const |
| | Get the unique keys contained within this map. 更多...
|
| |
| template<typename Allocator > |
| int32 | GetKeys (TSet< KeyType, Allocator > &OutKeys) const |
| | Get the unique keys contained within this map. 更多...
|
| |
| FORCEINLINE int32 | Num () const |
| |
| bool | OrderIndependentCompareEqual (const TMapBase &Other) const |
| | Compare this map with another for equality. 更多...
|
| |
| FORCEINLINE int32 | Remove (KeyConstPointerType InKey) |
| | Remove all value associations for a key. 更多...
|
| |
|
template<typename ComparableKey > |
| FORCEINLINE int32 | RemoveByHash (uint32 KeyHash, const ComparableKey &Key) |
| | See Remove() and class documentation section on ByHash() functions
|
| |
|
FORCEINLINE void | Reserve (int32 Number) |
| | Preallocates enough memory to contain Number elements
|
| |
|
FORCEINLINE void | Reset () |
| | Efficiently empties out the map but preserves all allocations and capacities
|
| |
|
FORCEINLINE void | Shrink () |
| | Shrinks the pair set to avoid slack.
|
| |
template<typename KeyType, typename ValueType, typename SetAllocator, typename KeyFuncs>
class TMapBase< KeyType, ValueType, SetAllocator, KeyFuncs >
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.