5#include "Containers/Array.h"
7#include "Containers/Set.h"
38template <
typename BaseInterfaceType,
class HandleType>
45template <
typename BaseInterfaceType,
class HandleType>
60template<
class HandleType>
100 template <
typename BaseInterfaceType>
110 template <
typename BaseInterfaceType>
119 template <
typename BaseInterfaceType>
122 return TypedElementList_Private::GetElement<BaseInterfaceType>(Registry.
Get(),
InElementHandle);
128 template <
typename BaseInterfaceType>
137 template <
typename BaseInterfaceType>
141 for (
int32 ElementIndex = 0; ElementIndex <
Num(); ++ElementIndex)
156 template <
typename BaseInterfaceType>
161 for (
int32 ElementIndex = 0; ElementIndex <
Num(); ++ElementIndex)
177 template <
typename BaseInterfaceType>
181 for (
int32 ElementIndex =
Num() - 1; ElementIndex >= 0; --ElementIndex)
196 template <
typename BaseInterfaceType>
201 for (
int32 ElementIndex =
Num() - 1; ElementIndex >= 0; --ElementIndex)
218 template <
typename BaseInterfaceType>
259 template <
typename ArrayAllocator>
281 template <
typename BaseInterfaceType>
308 return ElementHandles.
Num();
316 ElementCombinedIds.Shrink();
325 ElementCombinedIds.Reserve(
InSize);
341 ElementCombinedIds.Empty(
InSlack);
348 NoteListChanged(EChangeType::Cleared);
361 ElementCombinedIds.Reset();
362 ElementHandles.
Reset();
364 NoteListChanged(EChangeType::Cleared);
387 template <
typename ElementDataType>
415 template <
typename ElementDataType>
456 template <
typename ElementDataType>
465 template <
typename ElementDataType>
473 AddElementImpl(ElementOwner.AcquireHandle());
499 template <
typename ElementDataType>
518 template <
typename BaseInterfaceType>
534 return ElementCounts;
544 return OnPreChangeDelegate;
554 return OnChangedDelegate;
644 int32 NumOpenBatchOperations = 0;
645 bool bBatchOperationIsDirty =
false;
696 return Registry.
Get();
700 enum class EChangeType :
uint8
766 bool bHasPendingNotify =
false;
constexpr auto MakeArrayView(OtherRangeType &&Other)
Definition ArrayView.h:873
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint8 FTypedHandleTypeId
Definition TypedElementLimits.h:29
UE_REWRITE T CopyTemp(T &Val)
Definition UnrealTemplate.h:554
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition NameTypes.h:617
Definition TypedElementCounter.h:50
TYPEDELEMENTFRAMEWORK_API void ClearCounters(const FName InCategory)
Definition TypedElementCounter.cpp:52
Definition ArrayView.h:139
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_REWRITE bool IsEmpty() const
Definition Array.h:1133
UE_NODEBUG UE_FORCEINLINE_HINT bool IsValidIndex(SizeType Index) const
Definition Array.h:1122
UE_FORCEINLINE_HINT void Shrink()
Definition Array.h:1278
void Empty(SizeType Slack=0)
Definition Array.h:2273
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition AssetRegistryState.h:50
Definition SharedPointer.h:1640
Definition SharedPointer.h:153
Definition SubclassOf.h:30
Definition TypedElementList.h:653
FLegacySyncScopedBatch & operator=(const FLegacySyncScopedBatch &)=delete
FLegacySyncScopedBatch(const FLegacySyncScopedBatch &)=delete
TYPEDELEMENTFRAMEWORK_API void ForceDirty()
Definition TypedElementList.cpp:130
TYPEDELEMENTFRAMEWORK_API ~FLegacySyncScopedBatch()
Definition TypedElementList.cpp:114
TYPEDELEMENTFRAMEWORK_API bool IsDirty() const
Definition TypedElementList.cpp:123
FLegacySyncScopedBatch(FLegacySyncScopedBatch &&)=delete
FLegacySyncScopedBatch & operator=(FLegacySyncScopedBatch &&)=delete
Definition TypedElementList.h:589
TYPEDELEMENTFRAMEWORK_API void ForceBatchOperationDirty()
Definition TypedElementList.cpp:93
TYPEDELEMENTFRAMEWORK_API bool IsRunningBatchOperation() const
Definition TypedElementList.cpp:57
TYPEDELEMENTFRAMEWORK_API void EndBatchOperation(const bool InNotify=true)
Definition TypedElementList.cpp:69
ESyncType
Definition TypedElementList.h:592
TYPEDELEMENTFRAMEWORK_API void Private_EmitSyncEvent(const ESyncType InSyncType, const HandleType &InElementHandle=HandleType())
Definition TypedElementList.cpp:49
TYPEDELEMENTFRAMEWORK_API void BeginBatchOperation()
Definition TypedElementList.cpp:63
TYPEDELEMENTFRAMEWORK_API FOnSyncEvent & OnSyncEvent()
Definition TypedElementList.cpp:43
DECLARE_EVENT_FourParams(FLegacySync, FOnSyncEvent, const TTypedElementList &, ESyncType, const HandleType &, bool)
TYPEDELEMENTFRAMEWORK_API bool IsBatchOperationDirty() const
Definition TypedElementList.cpp:87
Definition TypedElementList.h:62
TYPEDELEMENTFRAMEWORK_API FScopedClearNewPendingChange GetScopedClearNewPendingChange()
Definition TypedElementList.cpp:475
void Shrink()
Definition TypedElementList.h:314
bool Add(const HandleType &InElementHandle)
Definition TypedElementList.h:397
void GetElementAt(const int32 InIndex, TTypedElement< BaseInterfaceType > &OutElement) const
Definition TypedElementList.h:111
TTypedElement< BaseInterfaceType > GetTopElement(TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)> Predicate) const
Definition TypedElementList.h:157
int32 Num() const
Definition TypedElementList.h:306
TTypedElement< BaseInterfaceType > GetTopElement() const
Definition TypedElementList.h:138
UTypedElementRegistry * GetRegistry() const
Definition TypedElementList.h:694
BaseInterfaceType * GetElementInterface(const FTypedElementHandle &InElementHandle) const
Definition TypedElementList.h:219
TYPEDELEMENTFRAMEWORK_API FLegacySync * Legacy_GetSyncPtr() const
Definition TypedElementList.cpp:415
TYPEDELEMENTFRAMEWORK_API ~TTypedElementList()
Definition TypedElementList.cpp:156
TYPEDELEMENTFRAMEWORK_API bool HasElements(const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
Definition TypedElementList.cpp:188
TYPEDELEMENTFRAMEWORK_API int32 CountElementsOfType(const FName InElementTypeName) const
Definition TypedElementList.cpp:242
int32 RemoveAll(TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)> InPredicate)
Definition TypedElementList.h:519
bool Remove(const HandleType &InElementHandle)
Definition TypedElementList.h:490
bool Remove(const TTypedElementOwner< ElementDataType > &InElementOwner)
Definition TypedElementList.h:500
bool Contains(const FTypedElementId &InElementId) const
Definition TypedElementList.h:371
void Reserve(const int32 InSize)
Definition TypedElementList.h:323
DECLARE_EVENT_OneParam(TTypedElementList, FOnChanged, const TTypedElementList &)
void Append(TArrayView< const TTypedElementOwner< ElementDataType > > InElementOwners)
Definition TypedElementList.h:466
void GetElement(const HandleType &InElementHandle, TTypedElement< BaseInterfaceType > &OutElement) const
Definition TypedElementList.h:129
int32 RemoveAll(TFunctionRef< bool(const HandleType &)> InPredicate)
Definition TypedElementList.h:509
TTypedElement< BaseInterfaceType > GetBottomElement(TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)> Predicate) const
Definition TypedElementList.h:197
TTypedElement< BaseInterfaceType > GetElementAt(const int32 InIndex) const
Definition TypedElementList.h:101
void Empty(const int32 InSlack=0)
Definition TypedElementList.h:332
bool Add(const TTypedElementOwner< ElementDataType > &InElementOwner)
Definition TypedElementList.h:416
TYPEDELEMENTFRAMEWORK_API FLegacySync & Legacy_GetSync()
Definition TypedElementList.cpp:405
void GetElementHandles(TArray< HandleType, ArrayAllocator > &OutArray, const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
Definition TypedElementList.h:260
void Append(const TArray< TTypedElementOwner< ElementDataType > > &InElementOwners)
Definition TypedElementList.h:457
TTypedElement< BaseInterfaceType > GetElement(const HandleType &InElementHandle) const
Definition TypedElementList.h:120
const FTypedElementCounter & GetCounter() const
Definition TypedElementList.h:532
bool IsValidIndex(const int32 InIndex) const
Definition TypedElementList.h:298
HandleType FHandleType
Definition TypedElementList.h:65
HandleType GetElementHandleAt(const int32 InIndex) const
Definition TypedElementList.h:91
bool Contains(const HandleType &InElementHandle) const
Definition TypedElementList.h:379
FOnPreChange & OnPreChange()
Definition TypedElementList.h:542
void Append(TArrayView< const HandleType > InElementHandles)
Definition TypedElementList.h:442
TYPEDELEMENTFRAMEWORK_API void ForEachElementHandle(TFunctionRef< bool(const HandleType &)> InCallback, const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
Definition TypedElementList.cpp:277
TYPEDELEMENTFRAMEWORK_API TArray< HandleType > GetElementHandles(const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
Definition TypedElementList.cpp:262
bool Contains(const TTypedElementOwner< ElementDataType > &InElementOwner)
Definition TypedElementList.h:388
void Append(const TTypedElementListConstRef &InElementList)
Definition TypedElementList.h:424
TYPEDELEMENTFRAMEWORK_API TTypedElementListRef Clone() const
Definition TypedElementList.cpp:168
HandleType operator[](const int32 InIndex) const
Definition TypedElementList.h:82
void Reset()
Definition TypedElementList.h:355
bool Remove(const FTypedElementId &InElementId)
Definition TypedElementList.h:481
TTypedElement< BaseInterfaceType > GetBottomElement() const
Definition TypedElementList.h:178
static TYPEDELEMENTFRAMEWORK_API TTypedElementListRef Private_CreateElementList(UTypedElementRegistry *InRegistry)
Definition TypedElementList.cpp:139
bool Add(HandleType &&InElementHandle)
Definition TypedElementList.h:406
FOnChanged & OnChanged()
Definition TypedElementList.h:552
void ForEachElement(TFunctionRef< bool(const TTypedElement< BaseInterfaceType > &)> InCallback) const
Definition TypedElementList.h:282
TYPEDELEMENTFRAMEWORK_API bool NotifyPendingChanges()
Definition TypedElementList.cpp:421
TYPEDELEMENTFRAMEWORK_API int32 CountElements(const TSubclassOf< UInterface > &InBaseInterfaceType={}) const
Definition TypedElementList.cpp:209
DECLARE_EVENT_OneParam(TTypedElementList, FOnPreChange, const TTypedElementList &)
TYPEDELEMENTFRAMEWORK_API bool HasElementsOfType(const FName InElementTypeName) const
Definition TypedElementList.cpp:230
Definition UniquePtr.h:107
Definition Interface.h:19
Definition TypedElementRegistry.h:55
Definition TypedElementList.cpp:7
void GetElementImpl(const UTypedElementRegistry *InRegistry, const FTypedElementHandle &InElementHandle, const TSubclassOf< UInterface > &InBaseInterfaceType, FTypedElement &OutElement)
Definition TypedElementList.cpp:9
void GetElement(const UTypedElementRegistry *InRegistry, const HandleType &InElementHandle, TTypedElement< BaseInterfaceType > &OutElement)
Definition TypedElementList.h:39
Definition TypedElementList.cpp:521
FScriptTypedElementListPtr ConvertToScriptTypedElementList(const FTypedElementListConstPtr &NativeList)
Definition TypedElementList.cpp:554
FTypedElementListPtr ConvertToNativeTypedElementList(const FScriptTypedElementListConstPtr &ScriptList)
Definition TypedElementList.cpp:526
Definition TypedElementHandle.h:625
Definition TypedElementHandle.h:18
Definition TypedElementId.h:17
Definition TypedElementList.h:568
FScopedClearNewPendingChange(const FScopedClearNewPendingChange &)=delete
TYPEDELEMENTFRAMEWORK_API ~FScopedClearNewPendingChange()
Definition TypedElementList.cpp:466
FScopedClearNewPendingChange()=default
FScopedClearNewPendingChange & operator=(const FScopedClearNewPendingChange &)=delete
Definition TypedElementHandle.h:409
Definition TypedElementHandle.h:396
Definition WeakObjectPtrTemplates.h:25
FORCEINLINE T * Get(bool bEvenIfPendingKill) const
Definition WeakObjectPtrTemplates.h:132