|
| UE_FORCEINLINE_HINT constexpr | UE_TSPARSE_SET ()=default |
| |
| consteval | UE_TSPARSE_SET (EConstEval) |
| |
| UE_FORCEINLINE_HINT | UE_TSPARSE_SET (const UE_TSPARSE_SET &Copy) |
| |
| UE_FORCEINLINE_HINT | UE_TSPARSE_SET (TArrayView< const ElementType > InArrayView) |
| |
| UE_FORCEINLINE_HINT | UE_TSPARSE_SET (TArray< ElementType > &&InArray) |
| |
| UE_FORCEINLINE_HINT | ~UE_TSPARSE_SET () |
| |
| | UE_TSPARSE_SET (FIntrusiveUnsetOptionalState Tag) |
| |
| bool | operator== (FIntrusiveUnsetOptionalState Tag) const |
| |
| UE_TSPARSE_SET & | operator= (const UE_TSPARSE_SET &Copy) |
| |
| | UE_TSPARSE_SET (std::initializer_list< ElementType > InitList) |
| |
| | UE_TSPARSE_SET (UE_TSPARSE_SET &&Other) |
| |
| UE_TSPARSE_SET & | operator= (UE_TSPARSE_SET &&Other) |
| |
| template<typename OtherAllocator > |
| | UE_TSPARSE_SET (UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &&Other) |
| |
| template<typename OtherAllocator > |
| | UE_TSPARSE_SET (const UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &Other) |
| |
| template<typename OtherAllocator > |
| UE_TSPARSE_SET & | operator= (UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &&Other) |
| |
| template<typename OtherAllocator > |
| UE_TSPARSE_SET & | operator= (const UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &Other) |
| |
| UE_TSPARSE_SET & | operator= (std::initializer_list< ElementType > InitList) |
| |
| void | Empty (int32 ExpectedNumElements=0) |
| |
| void | Reset () |
| |
| void | Shrink () |
| |
| void | Compact () |
| |
| void | CompactStable () |
| |
| void | Reserve (int32 Number) |
| |
| UE_FORCEINLINE_HINT void | Relax () |
| |
| UE_FORCEINLINE_HINT SIZE_T | GetAllocatedSize (void) const |
| |
| void | CountBytes (FArchive &Ar) const |
| |
| bool | IsEmpty () const |
| |
| UE_FORCEINLINE_HINT int32 | Num () const |
| |
| UE_FORCEINLINE_HINT int32 | Max () const |
| |
| UE_FORCEINLINE_HINT int32 | GetMaxIndex () const |
| |
| bool | IsValidId (FSetElementId Id) const |
| |
| UE_FORCEINLINE_HINT ElementType & | operator[] (FSetElementId Id) |
| |
| UE_FORCEINLINE_HINT const ElementType & | operator[] (FSetElementId Id) const |
| |
| UE_FORCEINLINE_HINT ElementType & | Get (FSetElementId Id) |
| |
| UE_FORCEINLINE_HINT const ElementType & | Get (FSetElementId Id) const |
| |
| UE_FORCEINLINE_HINT FSetElementId | Add (const InElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| UE_FORCEINLINE_HINT FSetElementId | Add (InElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| UE_FORCEINLINE_HINT ElementType & | FindOrAdd (const InElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| UE_FORCEINLINE_HINT ElementType & | FindOrAdd (InElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| UE_FORCEINLINE_HINT FSetElementId | AddByHash (uint32 KeyHash, const InElementType &InElement, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| UE_FORCEINLINE_HINT FSetElementId | AddByHash (uint32 KeyHash, InElementType &&InElement, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| template<typename ElementReferenceType > |
| ElementType & | FindOrAddByHash (uint32 KeyHash, ElementReferenceType &&InElement, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| template<typename ArgType = ElementType> |
| FSetElementId | Emplace (ArgType &&Arg, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| template<typename... ArgTypes> |
| TPair< FSetElementId, bool > | Emplace (EInPlace, ArgTypes &&... InArgs) |
| |
| template<typename ArgType = ElementType> |
| FSetElementId | EmplaceByHash (uint32 KeyHash, ArgType &&Args, bool *bIsAlreadyInSetPtr=nullptr) |
| |
| template<typename... ArgTypes> |
| TPair< FSetElementId, bool > | EmplaceByHash (EInPlace, uint32 KeyHash, ArgTypes &&... InArgs) |
| |
| void | Append (TArrayView< const ElementType > InElements) |
| |
| template<typename ArrayAllocator > |
| void | Append (TArray< ElementType, ArrayAllocator > &&InElements) |
| |
| template<typename OtherAllocator > |
| void | Append (const UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &OtherSet) |
| |
| template<typename OtherAllocator > |
| void | Append (UE_TSPARSE_SET< ElementType, KeyFuncs, OtherAllocator > &&OtherSet) |
| |
| void | Append (std::initializer_list< ElementType > InitList) |
| |
| void | Remove (FSetElementId ElementId) |
| |
| void | RemoveStable (FSetElementId ElementId) |
| |
| ElementType * | FindArbitraryElement () |
| |
| const ElementType * | FindArbitraryElement () const |
| |
| FSetElementId | FindId (KeyInitType Key) const |
| |
| template<typename ComparableKey > |
| FSetElementId | FindIdByHash (uint32 KeyHash, const ComparableKey &Key) const |
| |
| ElementType * | Find (KeyInitType Key) |
| |
| UE_FORCEINLINE_HINT const ElementType * | Find (KeyInitType Key) const |
| |
| template<typename ComparableKey > |
| ElementType * | FindByHash (uint32 KeyHash, const ComparableKey &Key) |
| |
| template<typename ComparableKey > |
| const ElementType * | FindByHash (uint32 KeyHash, const ComparableKey &Key) const |
| |
| int32 | Remove (KeyInitType Key) |
| |
| int32 | RemoveStable (KeyInitType Key) |
| |
| template<typename ComparableKey > |
| int32 | RemoveByHash (uint32 KeyHash, const ComparableKey &Key) |
| |
| UE_FORCEINLINE_HINT bool | Contains (KeyInitType Key) const |
| |
| template<typename ComparableKey > |
| bool | ContainsByHash (uint32 KeyHash, const ComparableKey &Key) const |
| |
| template<typename PREDICATE_CLASS > |
| void | Sort (const PREDICATE_CLASS &Predicate) |
| |
| template<typename PREDICATE_CLASS > |
| void | StableSort (const PREDICATE_CLASS &Predicate) |
| |
| void | SortFreeList () |
| |
| void | Dump (FOutputDevice &Ar) |
| |
| bool | VerifyHashElementsKey (KeyInitType Key) const |
| |
| void | DumpHashElements (FOutputDevice &Ar) |
| |
| UE_TSPARSE_SET | Intersect (const UE_TSPARSE_SET &OtherSet) const |
| |
| UE_TSPARSE_SET | Union (const UE_TSPARSE_SET &OtherSet) const |
| |
| UE_TSPARSE_SET | Difference (const UE_TSPARSE_SET &OtherSet) const |
| |
| bool | Includes (const UE_TSPARSE_SET< ElementType, KeyFuncs, Allocator > &OtherSet) const |
| |
| TArray< ElementType > | Array () const |
| |
| UE_FORCEINLINE_HINT void | CheckAddress (const ElementType *Addr) const |
| |
| template<typename OtherKeyFuncs , typename AliasElementType = ElementType> |
| UE_TSPARSE_SET & | operator= (UE_TSPARSE_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, Allocator > &&Other) |
| |
| template<typename OtherKeyFuncs , typename OtherAllocator , typename AliasElementType = ElementType> |
| UE_TSPARSE_SET & | operator= (const UE_TSPARSE_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, OtherAllocator > &Other) |
| |
| template<typename OtherKeyFuncs , typename OtherAllocator , typename AliasElementType = ElementType> |
| void | Append (const UE_TSPARSE_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, OtherAllocator > &OtherSet) |
| |
| template<typename OtherKeyFuncs , typename AliasElementType = ElementType> |
| void | Append (UE_TSPARSE_SET< typename TContainerElementTypeCompatibility< ElementType >::CopyFromOtherType, OtherKeyFuncs, Allocator > &&OtherSet) |
| |
| void | WriteMemoryImage (FMemoryImageWriter &Writer) const |
| |
| void | CopyUnfrozen (const FMemoryUnfreezeContent &Context, void *Dst) const |
| |
| UE_FORCEINLINE_HINT TIterator | CreateIterator () |
| |
| UE_FORCEINLINE_HINT TConstIterator | CreateConstIterator () const |
| |
| UE_FORCEINLINE_HINT TRangedForIterator | begin () |
| |
| UE_FORCEINLINE_HINT TRangedForConstIterator | begin () const |
| |
| UE_FORCEINLINE_HINT TRangedForIterator | end () |
| |
| UE_FORCEINLINE_HINT TRangedForConstIterator | end () const |
| |
A set with an optional KeyFuncs parameters for customizing how the elements are compared and searched. E.g. You can specify a mapping from elements to keys if you want to find elements by specifying a subset of the element type. It uses a TSparseArray of the elements, and also links the elements into a hash with a number of buckets proportional to the number of elements. Addition, removal, and finding are O(1).
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.