Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
TSet< InElementType, KeyFuncs, Allocator > Class Template Reference

#include <Set.h>

+ Collaboration diagram for TSet< InElementType, KeyFuncs, Allocator >:

Classes

class  FElementCompareClass
 
class  TBaseIterator
 
class  TBaseKeyIterator
 
class  TConstIterator
 
class  TConstKeyIterator
 
class  TIterator
 
class  TKeyIterator
 

Public Types

typedef InElementType ElementType
 
using TRangedForConstIterator = TBaseIterator<true, true>
 
using TRangedForIterator = TBaseIterator<false, true>
 

Public Member Functions

FORCEINLINE TSet ()
 
FORCEINLINE TSet (const TSet &Copy)
 
FORCEINLINE TSet (const TArray< ElementType > &InArray)
 
FORCEINLINE TSet (TArray< ElementType > &&InArray)
 
FORCEINLINE ~TSet ()
 
TSetoperator= (const TSet &Copy)
 
 TSet (std::initializer_list< ElementType > InitList)
 
 TSet (TSet &&Other)
 
TSetoperator= (TSet &&Other)
 
template<typename OtherAllocator >
 TSet (TSet< ElementType, KeyFuncs, OtherAllocator > &&Other)
 
template<typename OtherAllocator >
 TSet (const TSet< ElementType, KeyFuncs, OtherAllocator > &Other)
 
template<typename OtherAllocator >
TSetoperator= (TSet< ElementType, KeyFuncs, OtherAllocator > &&Other)
 
template<typename OtherAllocator >
TSetoperator= (const TSet< ElementType, KeyFuncs, OtherAllocator > &Other)
 
TSetoperator= (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 ElementTypeoperator[] (FSetElementId Id)
 
FORCEINLINE const ElementTypeoperator[] (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 ElementTypeFind (KeyInitType Key)
 
FORCEINLINE const ElementTypeFind (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< ElementTypeArray () const
 
FORCEINLINE void CheckAddress (const ElementType *Addr) const
 
FORCEINLINE TIterator CreateIterator ()
 
FORCEINLINE TConstIterator CreateConstIterator () const
 

Private Types

typedef KeyFuncs::KeyInitType KeyInitType
 
typedef KeyFuncs::ElementInitType ElementInitType
 
typedef TSetElement< InElementType > SetElementType
 
typedef TSparseArray< SetElementType, typename Allocator::SparseArrayAllocator > ElementArrayType
 
typedef Allocator::HashAllocator::template ForElementType< FSetElementIdHashType
 

Private Member Functions

FORCEINLINE FSetElementIdGetTypedHash (int32 HashIndex) const
 
FORCEINLINE const SetElementTypeGetInternalElement (FSetElementId Id) const
 
FORCEINLINE SetElementTypeGetInternalElement (FSetElementId Id)
 
FORCEINLINE void HashElement (FSetElementId ElementId, const SetElementType &Element) const
 
bool ConditionalRehash (int32 NumHashedElements, bool bAllowShrinking=false) const
 
void Rehash () const
 

Static Private Member Functions

template<typename SetType >
static FORCEINLINE TEnableIf< TContainerTraits< SetType >::MoveWillEmptyContainer >::Type MoveOrCopy (SetType &ToSet, SetType &FromSet)
 
template<typename SetType >
static FORCEINLINE TEnableIf<!TContainerTraits< SetType >::MoveWillEmptyContainer >::Type MoveOrCopy (SetType &ToSet, SetType &FromSet)
 
static FORCEINLINE FSetElementId IndexToId (int32 Index)
 

Private Attributes

ElementArrayType Elements
 
HashType Hash
 
int32 HashSize
 

Friends

struct TContainerTraits< TSet >
 
class FScriptSet
 
bool LegacyCompareEqual (const TSet &A, const TSet &B)
 
bool LegacyCompareNotEqual (const TSet &A, const TSet &B)
 
FORCEINLINE friend TRangedForIterator begin (TSet &Set)
 
FORCEINLINE friend TRangedForConstIterator begin (const TSet &Set)
 
FORCEINLINE friend TRangedForIterator end (TSet &Set)
 
FORCEINLINE friend TRangedForConstIterator end (const TSet &Set)
 

Detailed Description

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.

Member Typedef Documentation

◆ ElementArrayType

template<typename InElementType , typename KeyFuncs , typename Allocator >
typedef TSparseArray<SetElementType,typename Allocator::SparseArrayAllocator> TSet< InElementType, KeyFuncs, Allocator >::ElementArrayType
private

Definition at line 879 of file Set.h.

◆ ElementInitType

template<typename InElementType , typename KeyFuncs , typename Allocator >
typedef KeyFuncs::ElementInitType TSet< InElementType, KeyFuncs, Allocator >::ElementInitType
private

Definition at line 199 of file Set.h.

◆ ElementType

template<typename InElementType , typename KeyFuncs , typename Allocator >
typedef InElementType TSet< InElementType, KeyFuncs, Allocator >::ElementType

Definition at line 204 of file Set.h.

◆ HashType

template<typename InElementType , typename KeyFuncs , typename Allocator >
typedef Allocator::HashAllocator::template ForElementType<FSetElementId> TSet< InElementType, KeyFuncs, Allocator >::HashType
private

Definition at line 880 of file Set.h.

◆ KeyInitType

template<typename InElementType , typename KeyFuncs , typename Allocator >
typedef KeyFuncs::KeyInitType TSet< InElementType, KeyFuncs, Allocator >::KeyInitType
private

Definition at line 198 of file Set.h.

◆ SetElementType

template<typename InElementType , typename KeyFuncs , typename Allocator >
typedef TSetElement<InElementType> TSet< InElementType, KeyFuncs, Allocator >::SetElementType
private

Definition at line 201 of file Set.h.

◆ TRangedForConstIterator

template<typename InElementType , typename KeyFuncs , typename Allocator >
using TSet< InElementType, KeyFuncs, Allocator >::TRangedForConstIterator = TBaseIterator<true, true>

Definition at line 1144 of file Set.h.

◆ TRangedForIterator

template<typename InElementType , typename KeyFuncs , typename Allocator >
using TSet< InElementType, KeyFuncs, Allocator >::TRangedForIterator = TBaseIterator<false, true>

Definition at line 1145 of file Set.h.

Constructor & Destructor Documentation

◆ TSet() [1/8]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE TSet< InElementType, KeyFuncs, Allocator >::TSet ( )
inline

Initialization constructor.

Definition at line 207 of file Set.h.

◆ TSet() [2/8]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE TSet< InElementType, KeyFuncs, Allocator >::TSet ( const TSet< InElementType, KeyFuncs, Allocator > & Copy)
inline

Copy constructor.

Definition at line 212 of file Set.h.

◆ TSet() [3/8]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE TSet< InElementType, KeyFuncs, Allocator >::TSet ( const TArray< ElementType > & InArray)
inlineexplicit

Definition at line 218 of file Set.h.

◆ TSet() [4/8]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE TSet< InElementType, KeyFuncs, Allocator >::TSet ( TArray< ElementType > && InArray)
inlineexplicit

Definition at line 224 of file Set.h.

◆ ~TSet()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE TSet< InElementType, KeyFuncs, Allocator >::~TSet ( )
inline

Destructor.

Definition at line 231 of file Set.h.

◆ TSet() [5/8]

template<typename InElementType , typename KeyFuncs , typename Allocator >
TSet< InElementType, KeyFuncs, Allocator >::TSet ( std::initializer_list< ElementType > InitList)
inline

Initializer list constructor.

Definition at line 270 of file Set.h.

◆ TSet() [6/8]

template<typename InElementType , typename KeyFuncs , typename Allocator >
TSet< InElementType, KeyFuncs, Allocator >::TSet ( TSet< InElementType, KeyFuncs, Allocator > && Other)
inline

Move constructor.

Definition at line 277 of file Set.h.

◆ TSet() [7/8]

template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename OtherAllocator >
TSet< InElementType, KeyFuncs, Allocator >::TSet ( TSet< ElementType, KeyFuncs, OtherAllocator > && Other)
inline

Constructor for moving elements from a TSet with a different SetAllocator

Definition at line 296 of file Set.h.

◆ TSet() [8/8]

template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename OtherAllocator >
TSet< InElementType, KeyFuncs, Allocator >::TSet ( const TSet< ElementType, KeyFuncs, OtherAllocator > & Other)
inline

Constructor for copying elements from a TSet with a different SetAllocator

Definition at line 304 of file Set.h.

Member Function Documentation

◆ Add() [1/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE FSetElementId TSet< InElementType, KeyFuncs, Allocator >::Add ( const InElementType & InElement,
bool * bIsAlreadyInSetPtr = NULL )
inline

Adds an element to the set.

Parameters
InElementElement to add to set
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 458 of file Set.h.

◆ Add() [2/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE FSetElementId TSet< InElementType, KeyFuncs, Allocator >::Add ( InElementType && InElement,
bool * bIsAlreadyInSetPtr = NULL )
inline

Definition at line 459 of file Set.h.

◆ Append() [1/5]

template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename ArrayAllocator >
void TSet< InElementType, KeyFuncs, Allocator >::Append ( const TArray< ElementType, ArrayAllocator > & InElements)
inline

Definition at line 524 of file Set.h.

◆ Append() [2/5]

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.

◆ Append() [3/5]

template<typename InElementType , typename KeyFuncs , typename Allocator >
void TSet< InElementType, KeyFuncs, Allocator >::Append ( std::initializer_list< ElementType > InitList)
inline

Definition at line 569 of file Set.h.

◆ Append() [4/5]

template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename ArrayAllocator >
void TSet< InElementType, KeyFuncs, Allocator >::Append ( TArray< ElementType, ArrayAllocator > && InElements)
inline

Definition at line 534 of file Set.h.

◆ Append() [5/5]

template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename OtherAllocator >
void TSet< InElementType, KeyFuncs, Allocator >::Append ( TSet< ElementType, KeyFuncs, OtherAllocator > && OtherSet)
inline

Definition at line 559 of file Set.h.

◆ Array()

template<typename InElementType , typename KeyFuncs , typename Allocator >
TArray< ElementType > TSet< InElementType, KeyFuncs, Allocator >::Array ( ) const
inline
Returns
a TArray of the elements

Definition at line 839 of file Set.h.

◆ CheckAddress()

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
AddrThe address to check.

Definition at line 856 of file Set.h.

◆ Compact()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE void TSet< InElementType, KeyFuncs, Allocator >::Compact ( )
inline

Compacts the allocated elements into a contiguous range.

Definition at line 377 of file Set.h.

◆ CompactStable()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE void TSet< InElementType, KeyFuncs, Allocator >::CompactStable ( )
inline

Compacts the allocated elements into a contiguous range. Does not change the iteration order of the elements.

Definition at line 386 of file Set.h.

◆ ConditionalRehash()

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.

◆ Contains()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE bool TSet< InElementType, KeyFuncs, Allocator >::Contains ( KeyInitType Key) const
inline

Checks if the element contains an element with the given key.

Parameters
Key- The key to check for.
Returns
true if the set contains an element with the given key.

Definition at line 707 of file Set.h.

◆ CreateConstIterator()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE TConstIterator TSet< InElementType, KeyFuncs, Allocator >::CreateConstIterator ( ) const
inline

Creates a const iterator for the contents of this set

Definition at line 1182 of file Set.h.

◆ CreateIterator()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE TIterator TSet< InElementType, KeyFuncs, Allocator >::CreateIterator ( )
inline

Creates an iterator for the contents of this set

Definition at line 1176 of file Set.h.

◆ Difference()

template<typename InElementType , typename KeyFuncs , typename Allocator >
TSet TSet< InElementType, KeyFuncs, Allocator >::Difference ( const TSet< InElementType, KeyFuncs, Allocator > & OtherSet) const
inline
Returns
the complement of two sets. (A not in B where A is this and B is Other)

Definition at line 794 of file Set.h.

◆ Emplace()

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
ArgsThe 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.

◆ Empty()

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.

◆ Find() [1/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE ElementType * TSet< InElementType, KeyFuncs, Allocator >::Find ( KeyInitType Key)
inline

Finds an element with the given key in the set.

Parameters
Key- The key to search for.
Returns
A pointer to an element with the given key. If no element in the set has the given key, this will return NULL.

Definition at line 633 of file Set.h.

◆ Find() [2/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE const ElementType * TSet< InElementType, KeyFuncs, Allocator >::Find ( KeyInitType Key) const
inline

Finds an element with the given key in the set.

Parameters
Key- The key to search for.
Returns
A const pointer to an element with the given key. If no element in the set has the given key, this will return NULL.

Definition at line 651 of file Set.h.

◆ FindId()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FSetElementId TSet< InElementType, KeyFuncs, Allocator >::FindId ( KeyInitType Key) const
inline

Finds an element with the given key in the set.

Parameters
Key- The key to search for.
Returns
The id of the set element matching the given key, or the NULL id if none matches.

Definition at line 610 of file Set.h.

◆ GetAllocatedSize()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE uint32 TSet< InElementType, KeyFuncs, Allocator >::GetAllocatedSize ( void ) const
inline

Helper function to return the amount of memory allocated by this container

Returns
number of bytes allocated by this container

Definition at line 415 of file Set.h.

◆ GetInternalElement() [1/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE SetElementType & TSet< InElementType, KeyFuncs, Allocator >::GetInternalElement ( FSetElementId Id)
inlineprivate

Definition at line 900 of file Set.h.

◆ GetInternalElement() [2/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE const SetElementType & TSet< InElementType, KeyFuncs, Allocator >::GetInternalElement ( FSetElementId Id) const
inlineprivate

Accesses an element in the set. This is needed because the iterator classes aren't friends of FSetElementId and so can't access the element index.

Definition at line 896 of file Set.h.

◆ GetTypedHash()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE FSetElementId & TSet< InElementType, KeyFuncs, Allocator >::GetTypedHash ( int32 HashIndex) const
inlineprivate

Definition at line 887 of file Set.h.

◆ HashElement()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE void TSet< InElementType, KeyFuncs, Allocator >::HashElement ( FSetElementId ElementId,
const SetElementType & Element ) const
inlineprivate

Adds an element to the hash.

Definition at line 915 of file Set.h.

◆ Includes()

template<typename InElementType , typename KeyFuncs , typename Allocator >
bool TSet< InElementType, KeyFuncs, Allocator >::Includes ( const TSet< ElementType, KeyFuncs, Allocator > & OtherSet) const
inline

Determine whether the specified set is entirely included within this set

Parameters
OtherSetSet to check
Returns
True if the other set is entirely included in this set, false if it is not

Definition at line 816 of file Set.h.

◆ IndexToId()

template<typename InElementType , typename KeyFuncs , typename Allocator >
static FORCEINLINE FSetElementId TSet< InElementType, KeyFuncs, Allocator >::IndexToId ( int32 Index)
inlinestaticprivate

Translates an element index into an element ID. This is needed because the iterator classes aren't friends of FSetElementId and so can't access the FSetElementId private constructor.

Definition at line 909 of file Set.h.

◆ Intersect()

template<typename InElementType , typename KeyFuncs , typename Allocator >
TSet TSet< InElementType, KeyFuncs, Allocator >::Intersect ( const TSet< InElementType, KeyFuncs, Allocator > & OtherSet) const
inline
Returns
the intersection of two sets. (A AND B)

Definition at line 757 of file Set.h.

◆ IsValidId()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE bool TSet< InElementType, KeyFuncs, Allocator >::IsValidId ( FSetElementId Id) const
inline

Checks whether an element id is valid.

Parameters
Id- The element id to check.
Returns
true if the element identifier refers to a valid element in this set.

Definition at line 431 of file Set.h.

◆ MoveOrCopy() [1/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename SetType >
static FORCEINLINE TEnableIf< TContainerTraits< SetType >::MoveWillEmptyContainer >::Type TSet< InElementType, KeyFuncs, Allocator >::MoveOrCopy ( SetType & ToSet,
SetType & FromSet )
inlinestaticprivate

Definition at line 252 of file Set.h.

◆ MoveOrCopy() [2/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
template<typename SetType >
static FORCEINLINE TEnableIf<!TContainerTraits< SetType >::MoveWillEmptyContainer >::Type TSet< InElementType, KeyFuncs, Allocator >::MoveOrCopy ( SetType & ToSet,
SetType & FromSet )
inlinestaticprivate

Definition at line 263 of file Set.h.

◆ Num()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE int32 TSet< InElementType, KeyFuncs, Allocator >::Num ( ) const
inline
Returns
the number of elements.

Definition at line 421 of file Set.h.

◆ operator=() [1/5]

template<typename InElementType , typename KeyFuncs , typename Allocator >
TSet & TSet< InElementType, KeyFuncs, Allocator >::operator= ( const TSet< InElementType, KeyFuncs, Allocator > & Copy)
inline

Assignment operator.

Definition at line 237 of file Set.h.

◆ operator=() [2/5]

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.

◆ operator=() [3/5]

template<typename InElementType , typename KeyFuncs , typename Allocator >
TSet & TSet< InElementType, KeyFuncs, Allocator >::operator= ( std::initializer_list< ElementType > InitList)
inline

Initializer list assignment operator

Definition at line 329 of file Set.h.

◆ operator=() [4/5]

template<typename InElementType , typename KeyFuncs , typename Allocator >
TSet & TSet< InElementType, KeyFuncs, Allocator >::operator= ( TSet< InElementType, KeyFuncs, Allocator > && Other)
inline

Move assignment operator.

Definition at line 284 of file Set.h.

◆ operator=() [5/5]

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.

◆ operator[]() [1/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE ElementType & TSet< InElementType, KeyFuncs, Allocator >::operator[] ( FSetElementId Id)
inline

Accesses the identified element's value.

Definition at line 440 of file Set.h.

◆ operator[]() [2/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE const ElementType & TSet< InElementType, KeyFuncs, Allocator >::operator[] ( FSetElementId Id) const
inline

Accesses the identified element's value.

Definition at line 446 of file Set.h.

◆ Rehash()

template<typename InElementType , typename KeyFuncs , typename Allocator >
void TSet< InElementType, KeyFuncs, Allocator >::Rehash ( ) const
inlineprivate

Resizes the hash.

Definition at line 953 of file Set.h.

◆ Relax()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE void TSet< InElementType, KeyFuncs, Allocator >::Relax ( )
inline

Relaxes the set's hash to a size strictly bounded by the number of elements in the set.

Definition at line 406 of file Set.h.

◆ Remove() [1/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
void TSet< InElementType, KeyFuncs, Allocator >::Remove ( FSetElementId ElementId)
inline

Removes an element from the set.

Parameters
Element- A pointer to the element in the set, as returned by Add or Find.

Definition at line 582 of file Set.h.

◆ Remove() [2/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
int32 TSet< InElementType, KeyFuncs, Allocator >::Remove ( KeyInitType Key)
inline

Removes all elements from the set matching the specified key.

Parameters
Key- The key to match elements against.
Returns
The number of elements removed.

Definition at line 669 of file Set.h.

◆ Reserve()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE void TSet< InElementType, KeyFuncs, Allocator >::Reserve ( int32 Number)
inline

Preallocates enough memory to contain Number elements

Definition at line 395 of file Set.h.

◆ Reset()

template<typename InElementType , typename KeyFuncs , typename Allocator >
void TSet< InElementType, KeyFuncs, Allocator >::Reset ( )
inline

Efficiently empties out the set but preserves all allocations and capacities

Definition at line 357 of file Set.h.

◆ Shrink()

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE void TSet< InElementType, KeyFuncs, Allocator >::Shrink ( )
inline

Shrinks the set's element storage to avoid slack.

Definition at line 370 of file Set.h.

◆ Sort()

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.

◆ Union()

template<typename InElementType , typename KeyFuncs , typename Allocator >
TSet TSet< InElementType, KeyFuncs, Allocator >::Union ( const TSet< InElementType, KeyFuncs, Allocator > & OtherSet) const
inline
Returns
the union of two sets. (A OR B)

Definition at line 777 of file Set.h.

◆ VerifyHashElementsKey()

template<typename InElementType , typename KeyFuncs , typename Allocator >
bool TSet< InElementType, KeyFuncs, Allocator >::VerifyHashElementsKey ( KeyInitType Key)
inline

Definition at line 725 of file Set.h.

Friends And Related Symbol Documentation

◆ begin [1/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE friend TRangedForConstIterator begin ( const TSet< InElementType, KeyFuncs, Allocator > & Set)
friend

Definition at line 1193 of file Set.h.

◆ begin [2/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE friend TRangedForIterator begin ( TSet< InElementType, KeyFuncs, Allocator > & Set)
friend

DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.

Definition at line 1192 of file Set.h.

◆ end [1/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE friend TRangedForConstIterator end ( const TSet< InElementType, KeyFuncs, Allocator > & Set)
friend

Definition at line 1195 of file Set.h.

◆ end [2/2]

template<typename InElementType , typename KeyFuncs , typename Allocator >
FORCEINLINE friend TRangedForIterator end ( TSet< InElementType, KeyFuncs, Allocator > & Set)
friend

Definition at line 1194 of file Set.h.

◆ FScriptSet

template<typename InElementType , typename KeyFuncs , typename Allocator >
friend class FScriptSet
friend

Definition at line 196 of file Set.h.

◆ LegacyCompareEqual

template<typename InElementType , typename KeyFuncs , typename Allocator >
bool LegacyCompareEqual ( const TSet< InElementType, KeyFuncs, Allocator > & A,
const TSet< InElementType, KeyFuncs, Allocator > & B )
friend

Definition at line 747 of file Set.h.

◆ LegacyCompareNotEqual

template<typename InElementType , typename KeyFuncs , typename Allocator >
bool LegacyCompareNotEqual ( const TSet< InElementType, KeyFuncs, Allocator > & A,
const TSet< InElementType, KeyFuncs, Allocator > & B )
friend

Definition at line 751 of file Set.h.

◆ TContainerTraits< TSet >

template<typename InElementType , typename KeyFuncs , typename Allocator >
friend struct TContainerTraits< TSet >
friend

Definition at line 175 of file Set.h.

Member Data Documentation

◆ Elements

template<typename InElementType , typename KeyFuncs , typename Allocator >
ElementArrayType TSet< InElementType, KeyFuncs, Allocator >::Elements
private

Definition at line 882 of file Set.h.

◆ Hash

template<typename InElementType , typename KeyFuncs , typename Allocator >
HashType TSet< InElementType, KeyFuncs, Allocator >::Hash
mutableprivate

Definition at line 884 of file Set.h.

◆ HashSize

template<typename InElementType , typename KeyFuncs , typename Allocator >
int32 TSet< InElementType, KeyFuncs, Allocator >::HashSize
mutableprivate

Definition at line 885 of file Set.h.


The documentation for this class was generated from the following file: