UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TTypedElementList< HandleType > Class Template Referencefinal

#include <TypedElementList.h>

+ Inheritance diagram for TTypedElementList< HandleType >:

Classes

class  FLegacySync
 
class  FLegacySyncScopedBatch
 
struct  FScopedClearNewPendingChange
 

Public Types

using FHandleType = HandleType
 
using TTypedElementListRef = TSharedRef< TTypedElementList >
 
using TTypedElementListConstRef = TSharedRef< const TTypedElementList >
 

Public Member Functions

TYPEDELEMENTFRAMEWORK_API ~TTypedElementList ()
 
TYPEDELEMENTFRAMEWORK_API TTypedElementListRef Clone () const
 
HandleType operator[] (const int32 InIndex) const
 
HandleType GetElementHandleAt (const int32 InIndex) const
 
template<typename BaseInterfaceType >
TTypedElement< BaseInterfaceTypeGetElementAt (const int32 InIndex) const
 
template<typename BaseInterfaceType >
void GetElementAt (const int32 InIndex, TTypedElement< BaseInterfaceType > &OutElement) const
 
template<typename BaseInterfaceType >
TTypedElement< BaseInterfaceTypeGetElement (const HandleType &InElementHandle) const
 
template<typename BaseInterfaceType >
void GetElement (const HandleType &InElementHandle, TTypedElement< BaseInterfaceType > &OutElement) const
 
template<typename BaseInterfaceType >
TTypedElement< BaseInterfaceTypeGetTopElement () const
 
template<typename BaseInterfaceType >
TTypedElement< BaseInterfaceTypeGetTopElement (TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)> Predicate) const
 
template<typename BaseInterfaceType >
TTypedElement< BaseInterfaceTypeGetBottomElement () const
 
template<typename BaseInterfaceType >
TTypedElement< BaseInterfaceTypeGetBottomElement (TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)> Predicate) const
 
template<typename BaseInterfaceType >
BaseInterfaceTypeGetElementInterface (const FTypedElementHandle &InElementHandle) const
 
TYPEDELEMENTFRAMEWORK_API UObjectGetElementInterface (const HandleType &InElementHandle, const TSubclassOf< UInterface > &InBaseInterfaceType) const
 
TYPEDELEMENTFRAMEWORK_API bool HasElements (const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
 
TYPEDELEMENTFRAMEWORK_API int32 CountElements (const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
 
TYPEDELEMENTFRAMEWORK_API bool HasElementsOfType (const FName InElementTypeName) const
 
TYPEDELEMENTFRAMEWORK_API bool HasElementsOfType (const FTypedHandleTypeId InElementTypeId) const
 
TYPEDELEMENTFRAMEWORK_API int32 CountElementsOfType (const FName InElementTypeName) const
 
TYPEDELEMENTFRAMEWORK_API int32 CountElementsOfType (const FTypedHandleTypeId InElementTypeId) const
 
TYPEDELEMENTFRAMEWORK_API TArray< HandleType > GetElementHandles (const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
 
template<typename ArrayAllocator >
void GetElementHandles (TArray< HandleType, ArrayAllocator > &OutArray, const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
 
TYPEDELEMENTFRAMEWORK_API void ForEachElementHandle (TFunctionRef< bool(const HandleType &)> InCallback, const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
 
template<typename BaseInterfaceType >
void ForEachElement (TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)> InCallback) const
 
bool IsValidIndex (const int32 InIndex) const
 
int32 Num () const
 
void Shrink ()
 
void Reserve (const int32 InSize)
 
void Empty (const int32 InSlack=0)
 
void Reset ()
 
bool Contains (const FTypedElementId &InElementId) const
 
bool Contains (const HandleType &InElementHandle) const
 
template<typename ElementDataType >
bool Contains (const TTypedElementOwner< ElementDataType > &InElementOwner)
 
bool Add (const HandleType &InElementHandle)
 
bool Add (HandleType &&InElementHandle)
 
template<typename ElementDataType >
bool Add (const TTypedElementOwner< ElementDataType > &InElementOwner)
 
void Append (const TTypedElementListConstRef &InElementList)
 
void Append (TArrayView< const HandleType > InElementHandles)
 
template<typename ElementDataType >
void Append (const TArray< TTypedElementOwner< ElementDataType > > &InElementOwners)
 
template<typename ElementDataType >
void Append (TArrayView< const TTypedElementOwner< ElementDataType > > InElementOwners)
 
bool Remove (const FTypedElementId &InElementId)
 
bool Remove (const HandleType &InElementHandle)
 
template<typename ElementDataType >
bool Remove (const TTypedElementOwner< ElementDataType > &InElementOwner)
 
int32 RemoveAll (TFunctionRef< bool(const HandleType &)> InPredicate)
 
template<typename BaseInterfaceType >
int32 RemoveAll (TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)> InPredicate)
 
const FTypedElementCounterGetCounter () const
 
 DECLARE_EVENT_OneParam (TTypedElementList, FOnPreChange, const TTypedElementList &)
 
FOnPreChangeOnPreChange ()
 
 DECLARE_EVENT_OneParam (TTypedElementList, FOnChanged, const TTypedElementList &)
 
FOnChangedOnChanged ()
 
TYPEDELEMENTFRAMEWORK_API bool NotifyPendingChanges ()
 
TYPEDELEMENTFRAMEWORK_API FScopedClearNewPendingChange GetScopedClearNewPendingChange ()
 
TYPEDELEMENTFRAMEWORK_API FLegacySyncLegacy_GetSync ()
 
TYPEDELEMENTFRAMEWORK_API FLegacySyncLegacy_GetSyncPtr () const
 
UTypedElementRegistryGetRegistry () const
 
- Public Member Functions inherited from TSharedFromThis< TTypedElementList< HandleType > >
TSharedRef< TTypedElementList< HandleType >, Mode > AsShared ()
 
TSharedRef< TTypedElementList< HandleType > const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< TTypedElementList< HandleType >, Mode > AsWeak ()
 
TWeakPtr< TTypedElementList< HandleType > const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Static Public Member Functions

static TYPEDELEMENTFRAMEWORK_API TTypedElementListRef Private_CreateElementList (UTypedElementRegistry *InRegistry)
 

Additional Inherited Members

- Protected Member Functions inherited from TSharedFromThis< TTypedElementList< HandleType > >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 
- Static Protected Member Functions inherited from TSharedFromThis< TTypedElementList< HandleType > >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

template<class HandleType>
class TTypedElementList< HandleType >

A list of element handles. Provides high-level access to groups of elements, including accessing elements that implement specific interfaces.

Member Typedef Documentation

◆ FHandleType

template<class HandleType >
using TTypedElementList< HandleType >::FHandleType = HandleType

◆ TTypedElementListConstRef

template<class HandleType >
using TTypedElementList< HandleType >::TTypedElementListConstRef = TSharedRef<const TTypedElementList>

◆ TTypedElementListRef

template<class HandleType >
using TTypedElementList< HandleType >::TTypedElementListRef = TSharedRef<TTypedElementList>

Constructor & Destructor Documentation

◆ ~TTypedElementList()

template<class HandleType >
TTypedElementList< HandleType >::~TTypedElementList ( )

Member Function Documentation

◆ Add() [1/3]

template<class HandleType >
bool TTypedElementList< HandleType >::Add ( const HandleType &  InElementHandle)
inline

Add the given element handle to this element list, if it isn't already in the list.

Returns
True if the element handle was added, false if it is already in the list.

◆ Add() [2/3]

template<class HandleType >
template<typename ElementDataType >
bool TTypedElementList< HandleType >::Add ( const TTypedElementOwner< ElementDataType > &  InElementOwner)
inline

Add the given element owner to this element list, if it isn't already in the list.

Returns
True if the element owner was added, false if it is already in the list.

◆ Add() [3/3]

template<class HandleType >
bool TTypedElementList< HandleType >::Add ( HandleType &&  InElementHandle)
inline

Add the given element handle to this element list, if it isn't already in the list.

Returns
True if the element handle was added, false if it is already in the list.

◆ Append() [1/4]

template<class HandleType >
template<typename ElementDataType >
void TTypedElementList< HandleType >::Append ( const TArray< TTypedElementOwner< ElementDataType > > &  InElementOwners)
inline

Append the given element owners to this element list.

◆ Append() [2/4]

template<class HandleType >
void TTypedElementList< HandleType >::Append ( const TTypedElementListConstRef InElementList)
inline

Append another element list to this element list.

◆ Append() [3/4]

template<class HandleType >
void TTypedElementList< HandleType >::Append ( TArrayView< const HandleType >  InElementHandles)
inline

Append the given element handles to this element list.

◆ Append() [4/4]

template<class HandleType >
template<typename ElementDataType >
void TTypedElementList< HandleType >::Append ( TArrayView< const TTypedElementOwner< ElementDataType > >  InElementOwners)
inline

Append the given element owners to this element list.

◆ Clone()

template<class HandleType >
TTypedElementList< HandleType >::TTypedElementListRef TTypedElementList< HandleType >::Clone ( ) const

Clone this list instance.

Note
Only copies elements; does not copy any bindings!

◆ Contains() [1/3]

template<class HandleType >
bool TTypedElementList< HandleType >::Contains ( const FTypedElementId InElementId) const
inline

Does this element list contain an entry for the given element ID?

◆ Contains() [2/3]

template<class HandleType >
bool TTypedElementList< HandleType >::Contains ( const HandleType &  InElementHandle) const
inline

Does this element list contain an entry for the given element handle?

◆ Contains() [3/3]

template<class HandleType >
template<typename ElementDataType >
bool TTypedElementList< HandleType >::Contains ( const TTypedElementOwner< ElementDataType > &  InElementOwner)
inline

Does this element list contain an entry for the given element owner?

◆ CountElements()

template<class HandleType >
int32 TTypedElementList< HandleType >::CountElements ( const TSubclassOf< UInterface > &  InBaseInterfaceType = {}) const

Count the number of elements in this list, optionally filtering to elements that implement the given interface.

◆ CountElementsOfType() [1/2]

template<class HandleType >
int32 TTypedElementList< HandleType >::CountElementsOfType ( const FName  InElementTypeName) const

Count the number of elements in this list of the given type.

◆ CountElementsOfType() [2/2]

template<class HandleType >
int32 TTypedElementList< HandleType >::CountElementsOfType ( const FTypedHandleTypeId  InElementTypeId) const

◆ DECLARE_EVENT_OneParam() [1/2]

template<class HandleType >
TTypedElementList< HandleType >::DECLARE_EVENT_OneParam ( TTypedElementList< HandleType >  ,
FOnChanged  ,
const TTypedElementList< HandleType > &   
)

Access the delegate that is invoked whenever this element list has been changed.

Note
This is called automatically at the end of each frame, but can also be manually invoked by NotifyPendingChanges.

◆ DECLARE_EVENT_OneParam() [2/2]

template<class HandleType >
TTypedElementList< HandleType >::DECLARE_EVENT_OneParam ( TTypedElementList< HandleType >  ,
FOnPreChange  ,
const TTypedElementList< HandleType > &   
)

Access the delegate that is invoked whenever this element list is potentially about to change.

Note
This may be called even if no actual change happens, so may be called multiple times without a corresponding OnChanged notification.

◆ Empty()

template<class HandleType >
void TTypedElementList< HandleType >::Empty ( const int32  InSlack = 0)
inline

Remove all entries from this element list, potentially leaving space allocated for the given number of entries.

◆ ForEachElement()

template<class HandleType >
void TTypedElementList< HandleType >::ForEachElement ( TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)>  InCallback) const
inline

Enumerate the elements in this list that implement the given interface.

Note
Return true from the callback to continue enumeration.

◆ ForEachElementHandle()

template<class HandleType >
void TTypedElementList< HandleType >::ForEachElementHandle ( TFunctionRef< bool(const HandleType &)>  InCallback,
const TSubclassOf< UInterface > &  InBaseInterfaceType = {} 
) const

Enumerate the handle of every element in this list, optionally filtering to elements that implement the given interface.

Note
Return true from the callback to continue enumeration.

◆ GetBottomElement() [1/2]

template<class HandleType >
TTypedElement< BaseInterfaceType > TTypedElementList< HandleType >::GetBottomElement ( ) const
inline

Get the last element implementing the given interface.

◆ GetBottomElement() [2/2]

template<class HandleType >
TTypedElement< BaseInterfaceType > TTypedElementList< HandleType >::GetBottomElement ( TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)>  Predicate) const
inline

Get the last element that implement the given interface and pass the predicate. @Predicate A function that return should true when the element is desirable

◆ GetCounter()

template<class HandleType >
const FTypedElementCounter & TTypedElementList< HandleType >::GetCounter ( ) const
inline

Get the counter for the elements within the list.

◆ GetElement() [1/2]

template<class HandleType >
TTypedElement< BaseInterfaceType > TTypedElementList< HandleType >::GetElement ( const HandleType &  InElementHandle) const
inline

Get the element from the given handle.

◆ GetElement() [2/2]

template<class HandleType >
void TTypedElementList< HandleType >::GetElement ( const HandleType &  InElementHandle,
TTypedElement< BaseInterfaceType > &  OutElement 
) const
inline

Get the element from the given handle.

◆ GetElementAt() [1/2]

template<class HandleType >
TTypedElement< BaseInterfaceType > TTypedElementList< HandleType >::GetElementAt ( const int32  InIndex) const
inline

Get the element at the given index.

Note
Use IsValidIndex to test for validity.

◆ GetElementAt() [2/2]

template<class HandleType >
void TTypedElementList< HandleType >::GetElementAt ( const int32  InIndex,
TTypedElement< BaseInterfaceType > &  OutElement 
) const
inline

Get the element at the given index.

Note
Use IsValidIndex to test for validity.

◆ GetElementHandleAt()

template<class HandleType >
HandleType TTypedElementList< HandleType >::GetElementHandleAt ( const int32  InIndex) const
inline

Get the element handle at the given index.

Note
Use IsValidIndex to test for validity.

◆ GetElementHandles() [1/2]

template<class HandleType >
TArray< HandleType > TTypedElementList< HandleType >::GetElementHandles ( const TSubclassOf< UInterface > &  InBaseInterfaceType = {}) const

Get the handle of every element in this list, optionally filtering to elements that implement the given interface.

◆ GetElementHandles() [2/2]

template<class HandleType >
void TTypedElementList< HandleType >::GetElementHandles ( TArray< HandleType, ArrayAllocator > &  OutArray,
const TSubclassOf< UInterface > &  InBaseInterfaceType = {} 
) const
inline

Get the handle of every element in this list, optionally filtering to elements that implement the given interface.

◆ GetElementInterface() [1/2]

template<class HandleType >
BaseInterfaceType * TTypedElementList< HandleType >::GetElementInterface ( const FTypedElementHandle InElementHandle) const
inline

Get the element interface from the given handle.

◆ GetElementInterface() [2/2]

template<class HandleType >
UObject * TTypedElementList< HandleType >::GetElementInterface ( const HandleType &  InElementHandle,
const TSubclassOf< UInterface > &  InBaseInterfaceType 
) const

Get the element interface from the given handle.

◆ GetRegistry()

template<class HandleType >
UTypedElementRegistry * TTypedElementList< HandleType >::GetRegistry ( ) const
inline

◆ GetScopedClearNewPendingChange()

template<class HandleType >
TTypedElementList< HandleType >::FScopedClearNewPendingChange TTypedElementList< HandleType >::GetScopedClearNewPendingChange ( )

Get a scoped object that when destroyed it clear a pending change notification without emitting the notification if it happened during its lifecycle.

◆ GetTopElement() [1/2]

template<class HandleType >
TTypedElement< BaseInterfaceType > TTypedElementList< HandleType >::GetTopElement ( ) const
inline

Get the first element implementing the given interface.

◆ GetTopElement() [2/2]

template<class HandleType >
TTypedElement< BaseInterfaceType > TTypedElementList< HandleType >::GetTopElement ( TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)>  Predicate) const
inline

Get the first element that implement the given interface and pass the predicate @Predicate A function that should return true when the element is desirable

◆ HasElements()

template<class HandleType >
bool TTypedElementList< HandleType >::HasElements ( const TSubclassOf< UInterface > &  InBaseInterfaceType = {}) const

Test whether there are elements in this list, optionally filtering to elements that implement the given interface.

◆ HasElementsOfType() [1/2]

template<class HandleType >
bool TTypedElementList< HandleType >::HasElementsOfType ( const FName  InElementTypeName) const

Test whether there are elements in this list of the given type.

◆ HasElementsOfType() [2/2]

template<class HandleType >
bool TTypedElementList< HandleType >::HasElementsOfType ( const FTypedHandleTypeId  InElementTypeId) const

◆ IsValidIndex()

template<class HandleType >
bool TTypedElementList< HandleType >::IsValidIndex ( const int32  InIndex) const
inline

Is the given index a valid entry within this element list?

◆ Legacy_GetSync()

template<class HandleType >
TTypedElementList< HandleType >::FLegacySync & TTypedElementList< HandleType >::Legacy_GetSync ( )

Access the interface to allow external systems (such as USelection) to receive immediate sync notifications as an element list is changed. This exists purely as a bridging mechanism and shouldn't be relied on for new code. It is lazily created as needed.

◆ Legacy_GetSyncPtr()

template<class HandleType >
TTypedElementList< HandleType >::FLegacySync * TTypedElementList< HandleType >::Legacy_GetSyncPtr ( ) const

Access the interface to allow external systems (such as USelection) to receive immediate sync notifications as an element list is changed. This exists purely as a bridging mechanism and shouldn't be relied on for new code. This will return null if no legacy sync has been created for this instance.

◆ NotifyPendingChanges()

template<class HandleType >
bool TTypedElementList< HandleType >::NotifyPendingChanges ( )

Invoke the delegate called whenever this element list has been changed.

Returns
true if a change notification was emitted

◆ Num()

template<class HandleType >
int32 TTypedElementList< HandleType >::Num ( ) const
inline

Get the number of entries within this element list.

◆ OnChanged()

template<class HandleType >
FOnChanged & TTypedElementList< HandleType >::OnChanged ( )
inline

◆ OnPreChange()

template<class HandleType >
FOnPreChange & TTypedElementList< HandleType >::OnPreChange ( )
inline

◆ operator[]()

template<class HandleType >
HandleType TTypedElementList< HandleType >::operator[] ( const int32  InIndex) const
inline

Get the element handle at the given index.

Note
Use IsValidIndex to test for validity.

◆ Private_CreateElementList()

template<class HandleType >
TTypedElementList< HandleType >::TTypedElementListRef TTypedElementList< HandleType >::Private_CreateElementList ( UTypedElementRegistry InRegistry)
static

Internal function used by the element registry to create an element list instance.

◆ Remove() [1/3]

template<class HandleType >
bool TTypedElementList< HandleType >::Remove ( const FTypedElementId InElementId)
inline

Remove the given element ID from this element list, if it is in the list.

Returns
True if the element ID was removed, false if it isn't in the list.

◆ Remove() [2/3]

template<class HandleType >
bool TTypedElementList< HandleType >::Remove ( const HandleType &  InElementHandle)
inline

Remove the given element handle from this element list, if it is in the list.

Returns
True if the element handle was removed, false if it isn't in the list.

◆ Remove() [3/3]

template<class HandleType >
template<typename ElementDataType >
bool TTypedElementList< HandleType >::Remove ( const TTypedElementOwner< ElementDataType > &  InElementOwner)
inline

Remove the given element owner from this element list, if it is in the list.

Returns
True if the element owner was removed, false if it isn't in the list.

◆ RemoveAll() [1/2]

template<class HandleType >
int32 TTypedElementList< HandleType >::RemoveAll ( TFunctionRef< bool(const HandleType &)>  InPredicate)
inline

Remove any element handles that match the given predicate from this element list.

Returns
The number of element handles removed.

◆ RemoveAll() [2/2]

template<class HandleType >
int32 TTypedElementList< HandleType >::RemoveAll ( TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)>  InPredicate)
inline

Remove any elements that match the given predicate from this element list.

Returns
The number of elements removed.

◆ Reserve()

template<class HandleType >
void TTypedElementList< HandleType >::Reserve ( const int32  InSize)
inline

Pre-allocate enough memory in this element list to store the given number of entries.

◆ Reset()

template<class HandleType >
void TTypedElementList< HandleType >::Reset ( )
inline

Remove all entries from this element list, preserving existing allocations.

◆ Shrink()

template<class HandleType >
void TTypedElementList< HandleType >::Shrink ( )
inline

Shrink this element list storage to avoid slack.


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