UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
uLang::TSPtrSetG< InElementType, AllowNull, InKeyType, InElementAllocatorType, RawAllocatorArgsType > Class Template Reference

#include <SharedPointerSet.h>

+ Inheritance diagram for uLang::TSPtrSetG< InElementType, AllowNull, InKeyType, InElementAllocatorType, RawAllocatorArgsType >:

Public Types

using KeyType = InKeyType
 

Public Member Functions

ULANG_FORCEINLINE TSPtrSetG (RawAllocatorArgsType &&... RawAllocatorArgs)
 
ULANG_FORCEINLINE TSPtrSetG (const TSPtrSetG &Other)
 
ULANG_FORCEINLINE TSPtrSetG (const TSPtrSetG &Other, int32_t ExtraSlack)
 
ULANG_FORCEINLINE TSPtrSetG (TSPtrSetG &&Other)
 
 TSPtrSetG (TSPtrSetG &&Other, int32_t ExtraSlack)
 
TSPtrSetGoperator= (const TSPtrSetG &Other)
 
TSPtrSetGoperator= (TSPtrSetG &&Other)
 
int32_t IndexOf (const KeyType &Key) const
 
ULANG_FORCEINLINE TOptional< PointerTypeFind (const KeyType &Key) const
 
bool Contains (const KeyType &Key) const
 
void Append (const TSPtrSetG &Other)
 
void Append (TSPtrSetG &&Other)
 
TSPtrSetGoperator+= (TSPtrSetG &&Other)
 
TSPtrSetGoperator+= (const TSPtrSetG &Other)
 
template<typename... CtorArgsType>
ULANG_FORCEINLINE int32_t AddNew (CtorArgsType &&... CtorArgs)
 
ULANG_FORCEINLINE int32_t Add (const PointerType &Item)
 
int32_t Remove (const KeyType &Key)
 

Friends

template<typename OtherElementType , bool OtherAllowNull, typename OtherKeyType , typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
class TSPtrSetG
 

Additional Inherited Members

- Protected Types inherited from uLang::TSPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType... >
using DereferenceFuncType = void(*)(ElementType *, const typename ElementAllocatorType::RawAllocatorType &)
 
using ElementType = InElementType
 
using ElementAllocatorType = InElementAllocatorType
 
using PointerType = TSPtrG< ElementType, AllowNull, typename InElementAllocatorType::RawAllocatorType, RawAllocatorArgsType... >
 
using PointerStorageType = TArrayG< ElementType *, InElementAllocatorType, RawAllocatorArgsType... >
 
- Protected Member Functions inherited from uLang::TSPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType... >
ULANG_FORCEINLINE void EnableDereference ()
 
ULANG_FORCEINLINE void Dereference (int32_t Index)
 
ULANG_FORCEINLINE void ReferenceRange (int32_t BeginIndex, int32_t EndIndex)
 
ULANG_FORCEINLINE void DereferenceRange (int32_t BeginIndex, int32_t EndIndex)
 
ULANG_FORCEINLINE void ReferenceAll ()
 
ULANG_FORCEINLINE void DereferenceAll ()
 
ULANG_FORCEINLINE TSPtrArrayG (RawAllocatorArgsType &&... RawAllocatorArgs)
 
ULANG_FORCEINLINE TSPtrArrayG (std::initializer_list< TSPtrG< OtherElementType, OtherAllowNull, typename InElementAllocatorType::RawAllocatorType, RawAllocatorArgsType... > > InitList, RawAllocatorArgsType &&... RawAllocatorArgs)
 
ULANG_FORCEINLINE TSPtrArrayG (const TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... > &Other)
 
ULANG_FORCEINLINE TSPtrArrayG (const TSPtrArrayG &Other)
 
ULANG_FORCEINLINE TSPtrArrayG (const TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... > &Other, int32_t ExtraSlack)
 
ULANG_FORCEINLINE TSPtrArrayG (TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... > &&Other)
 
ULANG_FORCEINLINE TSPtrArrayG (TSPtrArrayG &&Other)
 
 TSPtrArrayG (TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... > &&Other, int32_t ExtraSlack)
 
TSPtrArrayGoperator= (const TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... > &Other)
 
TSPtrArrayGoperator= (const TSPtrArrayG &Other)
 
TSPtrArrayGoperator= (TSPtrArrayG< OtherElementType, OtherAllowNull, InElementAllocatorType, RawAllocatorArgsType... > &&Other)
 
TSPtrArrayGoperator= (TSPtrArrayG &&Other)
 
 ~TSPtrArrayG ()
 
ULANG_FORCEINLINE int32_t GetSlack () const
 
ULANG_FORCEINLINE bool IsValidIndex (int32_t Index) const
 
ULANG_FORCEINLINE int32_t Num () const
 
ULANG_FORCEINLINE int32_t Max () const
 
ULANG_FORCEINLINE bool IsEmpty () const
 
ULANG_FORCEINLINE bool IsFilled () const
 
ULANG_FORCEINLINE PointerType operator[] (int32_t Index) const
 
ULANG_FORCEINLINE PointerType Pop (bool bAllowShrinking=true)
 
ULANG_FORCEINLINE void Push (const PointerType &Item)
 
ULANG_FORCEINLINE PointerType First () const
 
ULANG_FORCEINLINE PointerType Top () const
 
ULANG_FORCEINLINE PointerType Last (int32_t IndexFromTheEnd=0) const
 
ULANG_FORCEINLINE void Shrink ()
 
ULANG_FORCEINLINE bool Find (const ElementType *Item, int32_t &Index) const
 
ULANG_FORCEINLINE bool Find (const PointerType &Item, int32_t &Index) const
 
ULANG_FORCEINLINE int32_t Find (const ElementType *Item) const
 
ULANG_FORCEINLINE int32_t Find (const PointerType &Item) const
 
ULANG_FORCEINLINE bool FindLast (const PointerType &Item, int32_t &Index) const
 
ULANG_FORCEINLINE int32_t FindLast (const PointerType &Item) const
 
ULANG_FORCEINLINE int32_t FindLastByPredicate (Predicate Pred, int32_t Count) const
 
ULANG_FORCEINLINE int32_t FindLastByPredicate (Predicate Pred) const
 
int32_t IndexOfByKey (const KeyType &Key) const
 
int32_t IndexOfByPredicate (Predicate Pred) const
 
ULANG_FORCEINLINE TOptional< PointerTypeFindByKey (const KeyType &Key) const
 
ULANG_FORCEINLINE TOptional< PointerTypeFindByPredicate (Predicate Pred) const
 
bool Contains (const PointerType &Pointer) const
 
bool ContainsByKey (const ComparisonType &Key) const
 
ULANG_FORCEINLINE bool ContainsByPredicate (Predicate Pred) const
 
void InsertZeroed (int32_t Index, int32_t Count=1)
 
int32_t Insert (const TSPtrArrayG &Items, const int32_t InIndex)
 
int32_t Insert (TSPtrArrayG &&Items, const int32_t InIndex)
 
int32_t Insert (const PointerType &Item, int32_t Index)
 
ULANG_FORCEINLINE PointerType RemoveAt (int32_t Index)
 
ULANG_FORCEINLINE void RemoveAt (int32_t Index, CountType Count, bool bAllowShrinking=true)
 
ULANG_FORCEINLINE void RemoveAtSwap (int32_t Index)
 
ULANG_FORCEINLINE void RemoveAtSwap (int32_t Index, CountType Count, bool bAllowShrinking=true)
 
int32_t ReplaceAt (const PointerType &Item, int32_t Index)
 
void Reset (int32_t NewSize=0)
 
void Empty (int32_t Slack=0)
 
void SetNumZeroed (int32_t NewNum, bool bAllowShrinking=true)
 
void Append (TSPtrArrayG &Source)
 
void Append (TSPtrArrayG &&Source)
 
TSPtrArrayGoperator+= (TSPtrArrayG &&Other)
 
TSPtrArrayGoperator+= (const TSPtrArrayG &Other)
 
ULANG_FORCEINLINE int32_t AddNew (CtorArgsType &&... CtorArgs)
 
ULANG_FORCEINLINE void InsertNew (int32_t Index, CtorArgsType &&... CtorArgs)
 
ULANG_FORCEINLINE int32_t Add (const PointerType &Item)
 
int32_t AddZeroed (int32_t Count=1)
 
ULANG_FORCEINLINE int32_t AddUnique (const PointerType &Item)
 
ULANG_FORCEINLINE void Reserve (int32_t Number)
 
int32_t RemoveSingle (const PointerType &Item)
 
int32_t Remove (const PointerType &Item)
 
int32_t RemoveAll (const Predicate &Pred)
 
void RemoveAllSwap (const Predicate &Pred, bool bAllowShrinking=true)
 
int32_t RemoveSingleSwap (const PointerType &Item, bool bAllowShrinking=true)
 
int32_t RemoveSwap (const PointerType &Item)
 
void Sort ()
 
void Sort (const PredicateType &Predicate)
 
ULANG_FORCEINLINE TSPtrArrayG< OtherElementType, OtherAllowNull, ElementAllocatorType, RawAllocatorArgsType... > & As ()
 
ULANG_FORCEINLINE const TSPtrArrayG< OtherElementType, OtherAllowNull, ElementAllocatorType, RawAllocatorArgsType... > & As () const
 
ULANG_FORCEINLINE Iterator begin ()
 
ULANG_FORCEINLINE Iterator begin () const
 
ULANG_FORCEINLINE Iterator end ()
 
ULANG_FORCEINLINE Iterator end () const
 
- Protected Attributes inherited from uLang::TSPtrArrayG< InElementType, AllowNull, InElementAllocatorType, RawAllocatorArgsType... >
PointerStorageType _PointerStorage
 
DereferenceFuncType _DereferenceFunc
 

Detailed Description

template<typename InElementType, bool AllowNull, typename InKeyType, typename InElementAllocatorType, typename... RawAllocatorArgsType>
class uLang::TSPtrSetG< InElementType, AllowNull, InKeyType, InElementAllocatorType, RawAllocatorArgsType >

Templated dynamic set of shared pointers to elements This is similar to TSPtrArrayG, plus elements are always kept in sorted order and looked up via binary search

Member Typedef Documentation

◆ KeyType

Constructor & Destructor Documentation

◆ TSPtrSetG() [1/5]

Constructor

◆ TSPtrSetG() [2/5]

Copy constructor.

Parameters
OtherThe source array to copy.

◆ TSPtrSetG() [3/5]

Copy constructor.

Parameters
OtherThe source array to copy.
ExtraSlackTells how much extra memory should be preallocated at the end of the array in the number of elements.

◆ TSPtrSetG() [4/5]

Move constructor.

Parameters
OtherArray to move from.

◆ TSPtrSetG() [5/5]

Move constructor.

Parameters
OtherArray to move from.
ExtraSlackTells how much extra pointer memory should be preallocated at the end of the array in the number of elements.

Member Function Documentation

◆ Add()

Adds a new item. Must not exist yet.

Move semantics version.

Parameters
ItemThe item to add
Returns
Index to the new item
See also
AddDefaulted, AddUnique, AddZeroed, Append, Insert

◆ AddNew()

template<typename InElementType , bool AllowNull, typename InKeyType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename... CtorArgsType>
ULANG_FORCEINLINE int32_t uLang::TSPtrSetG< InElementType, AllowNull, InKeyType, InElementAllocatorType, RawAllocatorArgsType >::AddNew ( CtorArgsType &&...  CtorArgs)
inline

Constructs a new item at the end of the array, possibly reallocating the whole array to fit.

Parameters
ArgsThe arguments to forward to the constructor of the new item.
Returns
Index to the new item

◆ Append() [1/2]

Appends the specified array to this array.

Allocator changing version.

Parameters
SourceThe array to append.
See also
Add, Insert

◆ Append() [2/2]

Appends the specified array to this array.

Parameters
SourceThe array to append.
See also
Add, Insert

◆ Contains()

template<typename InElementType , bool AllowNull, typename InKeyType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
bool uLang::TSPtrSetG< InElementType, AllowNull, InKeyType, InElementAllocatorType, RawAllocatorArgsType >::Contains ( const KeyType Key) const
inline

Checks if this array contains the element.

Returns
True if found. False otherwise.
See also
ContainsByPredicate, FilterByPredicate, FindByPredicate

◆ Find()

Finds an item by key (assuming the ElementType overloads operator== for the comparison).

Parameters
KeyThe key to search by.
Returns
Pointer to the first matching element, or nullptr if none is found.
See also
Find

◆ IndexOf()

template<typename InElementType , bool AllowNull, typename InKeyType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
int32_t uLang::TSPtrSetG< InElementType, AllowNull, InKeyType, InElementAllocatorType, RawAllocatorArgsType >::IndexOf ( const KeyType Key) const
inline

Finds an item by key (assuming the ElementType overloads operator< and operator== for the comparison).

Parameters
KeyThe key to search by.
Returns
Index to the first matching element, or IndexNone if none is found.

◆ operator+=() [1/2]

Appends the specified array to this array. Cannot append to self.

Parameters
OtherThe array to append.

◆ operator+=() [2/2]

Appends the specified array to this array. Cannot append to self.

Move semantics version.

Parameters
OtherThe array to append.

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ Remove()

Removes as many instances of Item as there are in the array, maintaining order but not indices.

Parameters
ItemItem to remove from array.
Returns
Number of removed elements.
See also
Add, Insert, RemoveAll, RemoveAllSwap, RemoveSingle, RemoveSwap

Friends And Related Symbol Documentation

◆ TSPtrSetG

template<typename InElementType , bool AllowNull, typename InKeyType , typename InElementAllocatorType , typename... RawAllocatorArgsType>
template<typename OtherElementType , bool OtherAllowNull, typename OtherKeyType , typename OtherElementAllocatorType , typename... OtherRawAllocatorArgsType>
friend class TSPtrSetG
friend

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