|
| ValueType | FindRef (KeyConstPointerType InKey) const |
| |
| template<typename FunctionType > |
| bool | FindAndApply (KeyConstPointerType InKey, FunctionType &&InFunction) const |
| |
| template<typename UpdateFunctionType > |
| bool | FindAndApply (KeyConstPointerType InKey, UpdateFunctionType &&InUpdateFunction) |
| |
| bool | Contains (KeyConstPointerType InKey) const |
| |
| template<typename InitKeyType = KeyType, typename InitValueType = ValueType> |
| void | Emplace (InitKeyType &&InKey, InitValueType &&InValue) |
| |
| void | Add (const KeyType &InKey, const ValueType &InValue) |
| |
| void | Add (const KeyType &InKey, ValueType &&InValue) |
| |
| void | Add (KeyType &&InKey, const ValueType &InValue) |
| |
| void | Add (KeyType &&InKey, ValueType &&InValue) |
| |
| template<typename ProduceFunctionType > |
| ValueType | FindOrProduce (const KeyType &InKey, ProduceFunctionType &&InProduceFunction) |
| |
| template<typename ProduceFunctionType , typename ApplyFunctionType > |
| void | FindOrProduceAndApply (const KeyType &InKey, ProduceFunctionType &&InProduceFunction, ApplyFunctionType &&InApplyFunction) |
| |
| template<typename TryProduceFunctionType , typename ApplyFunctionType > |
| bool | FindOrTryProduceAndApply (const KeyType &InKey, TryProduceFunctionType &&InTryProduceFunction, ApplyFunctionType &&InApplyFunction) |
| |
| template<typename ProduceFunctionType , typename ApplyFunctionType > |
| void | FindOrProduceAndApplyForWrite (const KeyType &InKey, ProduceFunctionType &&InProduceFunction, ApplyFunctionType &&InApplyFunction) |
| |
| template<typename TryProduceFunctionType , typename ApplyFunctionType > |
| bool | FindOrTryProduceAndApplyForWrite (const KeyType &InKey, TryProduceFunctionType &&InTryProduceFunction, ApplyFunctionType &&InApplyFunction) |
| |
| int32 | Remove (KeyConstPointerType InKey) |
| |
| int32 | RemoveByHash (uint32 InKeyHash, KeyConstPointerType InKey) |
| |
| template<typename PredicateType > |
| int32 | RemoveIf (KeyConstPointerType InKey, PredicateType &&InPredicate) |
| |
| template<typename PredicateType > |
| int32 | RemoveIf (PredicateType &&InPredicate) |
| |
| bool | RemoveAndCopyValue (KeyConstPointerType InKey, ValueType &OutRemovedValue) |
| |
| ValueType | FindAndRemoveChecked (KeyConstPointerType InKey) |
| |
| void | Empty () |
| |
| void | Reset () |
| |
| void | Shrink () |
| |
| void | Compact () |
| |
| int32 | Num () const |
| |
| template<typename FunctionType > |
| void | ForEach (FunctionType &&InFunction) |
| |
| template<typename FunctionType > |
| void | ForEach (FunctionType &&InFunction) const |
| |
| template<typename Allocator > |
| int32 | GetKeys (TArray< KeyType, Allocator > &OutKeys) const |
| |
|
| uint32 | GetBucketIndex (uint32 Hash) const |
| |
| template<typename FunctionType > |
| decltype(auto) | ApplyUnlockedByHash (uint32 InHash, FunctionType &&InFunction) |
| |
| template<typename FunctionType > |
| decltype(auto) | ApplyUnlocked (KeyConstPointerType InKey, FunctionType &&InFunction) |
| |
| template<typename LockType , typename FunctionType > |
| decltype(auto) | ApplyByHash (uint32 InHash, FunctionType &&InFunction) const |
| |
| template<typename LockType , typename FunctionType > |
| decltype(auto) | Apply (KeyConstPointerType InKey, FunctionType &&InFunction) const |
| |
| template<typename LockType , typename FunctionType > |
| decltype(auto) | ApplyByHash (uint32 InHash, FunctionType &&InFunction) |
| |
| template<typename LockType , typename FunctionType > |
| decltype(auto) | Apply (KeyConstPointerType InKey, FunctionType &&InFunction) |
| |
| template<typename FunctionType > |
| decltype(auto) | Write (KeyConstPointerType InKey, FunctionType &&InFunction) |
| |
| template<typename FunctionType > |
| decltype(auto) | WriteByHash (uint32 InHash, KeyConstPointerType InKey, FunctionType &&InFunction) |
| |
| template<typename FunctionType > |
| decltype(auto) | Read (KeyConstPointerType InKey, FunctionType &&InFunction) |
| |
| template<typename FunctionType > |
| decltype(auto) | ReadByHash (uint32 InHash, KeyConstPointerType InKey, FunctionType &&InFunction) |
| |
| template<typename FunctionType > |
| decltype(auto) | Read (KeyConstPointerType InKey, FunctionType &&InFunction) const |
| |
| template<typename FunctionType > |
| decltype(auto) | ReadByHash (uint32 InHash, KeyConstPointerType InKey, FunctionType &&InFunction) const |
| |
| template<typename FunctionType > |
| void | ForEachMap (FunctionType &&InFunction) |
| |
| template<typename FunctionType > |
| void | ForEachMap (FunctionType &&InFunction) const |
| |
template<
int32 BucketCount,
typename BaseMapType,
typename KeyType,
typename ValueType,
typename SetAllocator,
typename KeyFuncs,
typename LockingPolicy>
class TStripedMapBase< BucketCount, BaseMapType, KeyType, ValueType, SetAllocator, KeyFuncs, LockingPolicy >
The base class of striped maps which is a wrapper that adds thread-safety and contention reduction over regular maps.
The interface is slightly modified compared to regular maps to avoid some thread-safety issues that would arise if we returned pointers or reference to memory inside the map after the lock on a bucket had been released.
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. This class manage this automatically so you don't have to work with ByHash function in this case.