20template<
typename ItemType>
87 if (
Index >= ItemCount)
149 const int32 DependencyCount = 0;
199 for (
int32 ItemIndex = 0; ItemIndex < ItemCount; ++ItemIndex)
214 Handle.Set(ItemCount - 1);
257 if (!HandleCount.IsValid())
261 HandleCount.Get(ItemCount);
270 HandleCount.Set(ItemCount);
279 ensure(!KeyCount.
Key.IsEmpty());
return KeyCount;
292template<
typename KeyType,
typename ValueType>
368 FAttributeKey IndexKey = GetKeyAttribute(CachedKeysAndValues.Num());
372 CachedKeysAndValues.AddByHash(
379 KeyCountHandle.Set(CachedKeysAndValues.Num());
440 CachedKeysAndValues.Reserve(
Number);
450 return CachedKeysAndValues.Num();
462 EmptyInternal(
InMap.Num());
464 KeyCountHandle.Set(
InMap.Num());
477 Map.Reserve(CachedKeysAndValues.Num());
482 Pair.Value.Key.Get(Key);
484 Pair.Value.Value.Get(
Value);
502 CachedKeysAndValues.Empty(KeyCount);
516 if (!
ensure(ValueAttribute.IsValid()))
530 static const FString KeyIndex =
TEXT(
"_KeyIndex_");
531 FString
IndexedKey = KeyCountHandle.GetKey().ToString();
541 FString ValueAttribute = KeyCountHandle.GetKey().ToString();
543 ValueAttribute.Reserve(
KeyChars.Len() + Key.Len());
545 ValueAttribute.Append(Key);
556 return AttributesPtr->GetAttributeHandle<KeyType>(GetKeyAttribute(CachedKeysAndValues.Num() - 1));
570 CachedKeysAndValues[LastKey].Key =
CachedPair.Key;
575 CachedKeysAndValues.RemoveByHash(
Hash,
InKey);
576 KeyCountHandle.Set(CachedKeysAndValues.Num());
598 KeyCountHandle.Set(0);
602 TAttributeHandle<int32> KeyCountHandle;
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define LLM_SCOPE_BYNAME(...)
Definition LowLevelMemTracker.h:1098
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
UE_FORCEINLINE_HINT TSharedPtr< ObjectType, Mode > Pin() const &
Definition SharedPointer.h:1512
UE_FORCEINLINE_HINT void Reset()
Definition SharedPointer.h:1544
Definition AttributeStorage.h:497
Definition InterchangeBaseNodeUtilities.h:22
static const FString & IndexKey()
Definition InterchangeBaseNodeUtilities.h:41
void Initialize(const TSharedPtr< FAttributeStorage, ESPMode::ThreadSafe > &InAttributes, const FString &BaseKeyName)
Definition InterchangeBaseNodeUtilities.h:32
bool RemoveItem(const ItemType &ItemToDelete)
Definition InterchangeBaseNodeUtilities.h:178
int32 GetCount() const
Definition InterchangeBaseNodeUtilities.h:47
~TArrayAttributeHelper()
Definition InterchangeBaseNodeUtilities.h:24
bool RemoveAllItems()
Definition InterchangeBaseNodeUtilities.h:242
void GetItems(TArray< ItemType > &OutItems) const
Definition InterchangeBaseNodeUtilities.h:100
void GetItem(const int32 Index, ItemType &OutItem) const
Definition InterchangeBaseNodeUtilities.h:67
bool AddItem(const ItemType &Item)
Definition InterchangeBaseNodeUtilities.h:138
Definition InterchangeBaseNodeUtilities.h:294
void Empty(int32 NumOfExpectedElements=0)
Definition InterchangeBaseNodeUtilities.h:443
TMapAttributeHelper(TMapAttributeHelper &&)=default
bool SetKeyValueByHash(uint32 Hash, const KeyType &InKey, const ValueType &InValue)
Definition InterchangeBaseNodeUtilities.h:354
TMapAttributeHelper & operator=(const TMap< KeyType, ValueType > &InMap)
Definition InterchangeBaseNodeUtilities.h:453
~TMapAttributeHelper()
Definition InterchangeBaseNodeUtilities.h:325
bool RemoveKey(const KeyType &InKey)
Definition InterchangeBaseNodeUtilities.h:342
TMap< KeyType, ValueType > ToMap() const
Definition InterchangeBaseNodeUtilities.h:474
TMapAttributeHelper(const TMapAttributeHelper &)=default
void RebuildCache()
Definition InterchangeBaseNodeUtilities.h:492
bool RemoveKeyAndGetValue(const KeyType &InKey, ValueType &OutValue)
Definition InterchangeBaseNodeUtilities.h:348
bool RemoveKeyByHash(uint32 Hash, const KeyType &InKey)
Definition InterchangeBaseNodeUtilities.h:403
TMapAttributeHelper & operator=(TMapAttributeHelper &&)=default
bool GetValue(const KeyType &InKey, ValueType &OutValue) const
Definition InterchangeBaseNodeUtilities.h:336
void Initialize(const TSharedRef< FAttributeStorage, ESPMode::ThreadSafe > &InAttributes, const FString &BaseKeyName)
Definition InterchangeBaseNodeUtilities.h:299
int32 GetCount() const
Definition InterchangeBaseNodeUtilities.h:448
TMapAttributeHelper()=default
bool GetValueByHash(uint32 Hash, const KeyType &InKey, ValueType &OutValue) const
Definition InterchangeBaseNodeUtilities.h:386
bool SetKeyValue(const KeyType &InKey, const ValueType &InValue)
Definition InterchangeBaseNodeUtilities.h:330
void Reserve(int32 Number)
Definition InterchangeBaseNodeUtilities.h:438
bool RemoveKeyAndGetValueByHash(uint32 Hash, const KeyType &InKey, ValueType &OutValue)
Definition InterchangeBaseNodeUtilities.h:419
TMapAttributeHelper & operator=(const TMapAttributeHelper &)=default
bool IsAttributeStorageResultSuccess(const EAttributeStorageResult Result)
Definition AttributeStorage.h:392
void LogAttributeStorageErrors(const EAttributeStorageResult Result, const FString OperationName, const FAttributeKey AttributeKey)
Definition AttributeStorage.cpp:1038
uint32 GetTypeHash(const FAttributeKey &AttributeKey)
Definition AttributeStorage.h:185
EAttributeStorageResult
Definition AttributeStorage.h:351
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
Definition AttributeCurve.h:23
FWrappedAttribute Value
Definition AttributeCurve.h:54
static StringType ToString(const T &Value)
Definition UnrealString.h:204
Definition AttributeStorage.h:67
const FString & ToString() const
Definition AttributeStorage.h:173
FString Key
Definition AttributeStorage.h:68