|
FORCEINLINE | TSet () |
|
FORCEINLINE | TSet (const TSet &Copy) |
|
FORCEINLINE | TSet (const TArray< ElementType > &InArray) |
|
FORCEINLINE | TSet (TArray< ElementType > &&InArray) |
|
FORCEINLINE | ~TSet () |
|
TSet & | operator= (const TSet &Copy) |
|
| TSet (std::initializer_list< ElementType > InitList) |
|
| TSet (TSet &&Other) |
|
TSet & | operator= (TSet &&Other) |
|
template<typename OtherAllocator > |
| TSet (TSet< ElementType, KeyFuncs, OtherAllocator > &&Other) |
|
template<typename OtherAllocator > |
| TSet (const TSet< ElementType, KeyFuncs, OtherAllocator > &Other) |
|
template<typename OtherAllocator > |
TSet & | operator= (TSet< ElementType, KeyFuncs, OtherAllocator > &&Other) |
|
template<typename OtherAllocator > |
TSet & | operator= (const TSet< ElementType, KeyFuncs, OtherAllocator > &Other) |
|
TSet & | operator= (std::initializer_list< ElementType > InitList) |
|
void | Empty (int32 ExpectedNumElements=0) |
|
void | Reset () |
|
FORCEINLINE void | Shrink () |
|
FORCEINLINE void | Compact () |
|
FORCEINLINE void | CompactStable () |
|
FORCEINLINE void | Reserve (int32 Number) |
|
FORCEINLINE void | Relax () |
|
FORCEINLINE uint32 | GetAllocatedSize (void) const |
|
FORCEINLINE int32 | Num () const |
|
FORCEINLINE bool | IsValidId (FSetElementId Id) const |
|
FORCEINLINE ElementType & | operator[] (FSetElementId Id) |
|
FORCEINLINE const ElementType & | operator[] (FSetElementId Id) const |
|
FORCEINLINE FSetElementId | Add (const InElementType &InElement, bool *bIsAlreadyInSetPtr=NULL) |
|
FORCEINLINE FSetElementId | Add (InElementType &&InElement, bool *bIsAlreadyInSetPtr=NULL) |
|
template<typename ArgsType > |
FSetElementId | Emplace (ArgsType &&Args, bool *bIsAlreadyInSetPtr=NULL) |
|
template<typename ArrayAllocator > |
void | Append (const TArray< ElementType, ArrayAllocator > &InElements) |
|
template<typename ArrayAllocator > |
void | Append (TArray< ElementType, ArrayAllocator > &&InElements) |
|
template<typename OtherAllocator > |
void | Append (const TSet< ElementType, KeyFuncs, OtherAllocator > &OtherSet) |
|
template<typename OtherAllocator > |
void | Append (TSet< ElementType, KeyFuncs, OtherAllocator > &&OtherSet) |
|
void | Append (std::initializer_list< ElementType > InitList) |
|
void | Remove (FSetElementId ElementId) |
|
FSetElementId | FindId (KeyInitType Key) const |
|
FORCEINLINE ElementType * | Find (KeyInitType Key) |
|
FORCEINLINE const ElementType * | Find (KeyInitType Key) const |
|
int32 | Remove (KeyInitType Key) |
|
FORCEINLINE bool | Contains (KeyInitType Key) const |
|
template<typename PREDICATE_CLASS > |
void | Sort (const PREDICATE_CLASS &Predicate) |
|
bool | VerifyHashElementsKey (KeyInitType Key) |
|
TSet | Intersect (const TSet &OtherSet) const |
|
TSet | Union (const TSet &OtherSet) const |
|
TSet | Difference (const TSet &OtherSet) const |
|
bool | Includes (const TSet< ElementType, KeyFuncs, Allocator > &OtherSet) const |
|
TArray< ElementType > | Array () const |
|
FORCEINLINE void | CheckAddress (const ElementType *Addr) const |
|
FORCEINLINE TIterator | CreateIterator () |
|
FORCEINLINE TConstIterator | CreateConstIterator () const |
|
template<typename InElementType, typename KeyFuncs, typename Allocator>
class TSet< InElementType, KeyFuncs, Allocator >
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).
Definition at line 193 of file Set.h.
template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename OtherAllocator >
void TSet< InElementType, KeyFuncs, Allocator >::Append |
( |
const TSet< ElementType, KeyFuncs, OtherAllocator > & | OtherSet | ) |
|
|
inline |
Add all items from another set to our set (union without creating a new set)
- Parameters
-
OtherSet | - The other set of items to add. |
Definition at line 549 of file Set.h.
template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE void TSet< InElementType, KeyFuncs, Allocator >::CheckAddress |
( |
const ElementType * | Addr | ) |
const |
|
inline |
Checks that the specified address is not part of an element within the container. Used for implementations to check that reference arguments aren't going to be invalidated by possible reallocation.
- Parameters
-
Addr | The address to check. |
Definition at line 856 of file Set.h.
template<typename InElementType , typename KeyFuncs , typename Allocator >
bool TSet< InElementType, KeyFuncs, Allocator >::ConditionalRehash |
( |
int32 | NumHashedElements, |
|
|
bool | bAllowShrinking = false ) const |
|
inlineprivate |
Checks if the hash has an appropriate number of buckets, and if not resizes it.
- Parameters
-
NumHashedElements | - The number of elements to size the hash for. |
bAllowShrinking | - true if the hash is allowed to shrink. |
- Returns
- true if the set was rehashed.
Definition at line 931 of file Set.h.
template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename ArgsType >
FSetElementId TSet< InElementType, KeyFuncs, Allocator >::Emplace |
( |
ArgsType && | Args, |
|
|
bool * | bIsAlreadyInSetPtr = NULL ) |
|
inline |
Adds an element to the set.
- Parameters
-
Args | The argument(s) to be forwarded to the set element's constructor. |
bIsAlreadyInSetPtr | [out] Optional pointer to bool that will be set depending on whether element is already in set |
- Returns
- A pointer to the element stored in the set.
Definition at line 472 of file Set.h.
template<typename InElementType , typename KeyFuncs , typename Allocator >
void TSet< InElementType, KeyFuncs, Allocator >::Empty |
( |
int32 | ExpectedNumElements = 0 | ) |
|
|
inline |
Removes all elements from the set, potentially leaving space allocated for an expected number of elements about to be added.
- Parameters
-
ExpectedNumElements | - The number of elements about to be added to the set. |
Definition at line 340 of file Set.h.
template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename OtherAllocator >
TSet & TSet< InElementType, KeyFuncs, Allocator >::operator= |
( |
const TSet< ElementType, KeyFuncs, OtherAllocator > & | Other | ) |
|
|
inline |
Assignment operator for copying elements from a TSet with a different SetAllocator
Definition at line 321 of file Set.h.
template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename OtherAllocator >
TSet & TSet< InElementType, KeyFuncs, Allocator >::operator= |
( |
TSet< ElementType, KeyFuncs, OtherAllocator > && | Other | ) |
|
|
inline |
Assignment operator for moving elements from a TSet with a different SetAllocator
Definition at line 312 of file Set.h.
template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename PREDICATE_CLASS >
void TSet< InElementType, KeyFuncs, Allocator >::Sort |
( |
const PREDICATE_CLASS & | Predicate | ) |
|
|
inline |
Sorts the set's elements using the provided comparison class.
Definition at line 716 of file Set.h.