15template <
typename ElementOwnerType>
30 SynchObject->Unlock();
38 : SynchObject(
InOther.SynchObject)
39 , ElementOwner(
InOther.ElementOwner)
47 inline explicit operator bool()
const
54 return ElementOwner !=
nullptr;
71 checkf(!ElementOwner,
TEXT(
"Element owner was already set!"));
79 SynchObject->Unlock();
80 SynchObject =
nullptr;
89template <
typename ElementDataType>
92template <
typename ElementDataType>
95template <
typename KeyDataType>
98 return TEXT(
"<GetTypedElementOwnerStoreKeyDebugString not implemented for key type>");
103 return InKey->GetPathName();
110template <
typename ElementDataType,
typename KeyDataType = const
void*>
114 static_assert(
TNumericLimits<int32>::Max() >=
TypedHandleMaxElementId,
"TTypedElementOwnerStore internally uses TMap so cannot store TypedHandleMaxElementId! Consider making this container 64-bit aware, or explicitly remove this compile time check.");
120 checkf(ElementOwnerMap.Num() == 0,
TEXT(
"Element owners were still registered during destruction! This will leak elements, and you should unregister and destroy all elements prior to destruction!"));
146 ElementOwnerMap.RemoveAndCopyValue(
InKey, ElementOwner);
157 for (
auto It = ElementOwnerMap.CreateIterator(); It; ++It)
213 return ElementOwnerMap.Contains(
InKey);
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
::FCriticalSection FTransactionallySafeCriticalSection
Definition TransactionallySafeCriticalSection.h:16
constexpr SIZE_T TypedHandleMaxElementId
Definition TypedElementLimits.h:24
FString GetTypedElementOwnerStoreKeyDebugString(const KeyDataType &InKey)
Definition TypedElementOwnerStore.h:96
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
FRWLock Lock
Definition UnversionedPropertySerialization.cpp:921
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition ScopeLock.h:21
Definition NumericLimits.h:41
Definition TypedElementOwnerStore.h:17
TTypedElementOwnerScopedAccessImpl(const TTypedElementOwnerScopedAccessImpl &)=delete
void Private_SetElementOwner(ElementOwnerType *InElementOwner)
Definition TypedElementOwnerStore.h:69
TTypedElementOwnerScopedAccessImpl(TTypedElementOwnerScopedAccessImpl &&InOther)
Definition TypedElementOwnerStore.h:37
TTypedElementOwnerScopedAccessImpl & operator=(const TTypedElementOwnerScopedAccessImpl &)=delete
bool IsSet() const
Definition TypedElementOwnerStore.h:52
ElementOwnerType * operator->() const
Definition TypedElementOwnerStore.h:63
TTypedElementOwnerScopedAccessImpl & operator=(TTypedElementOwnerScopedAccessImpl &&)=delete
TTypedElementOwnerScopedAccessImpl(FTransactionallySafeCriticalSection *InSynchObject)
Definition TypedElementOwnerStore.h:19
ElementOwnerType & operator*() const
Definition TypedElementOwnerStore.h:57
~TTypedElementOwnerScopedAccessImpl()
Definition TypedElementOwnerStore.h:26
Definition TypedElementOwnerStore.h:112
TTypedElementOwnerScopedAccess< ElementDataType > FindElementOwner(const KeyDataType &InKey) const
Definition TypedElementOwnerStore.h:189
TTypedElementOwnerScopedAccess< ElementDataType > FindOrRegisterElementOwner(const KeyDataType &InKey, TFunctionRef< TTypedElementOwner< ElementDataType >()> InCreateElement)
Definition TypedElementOwnerStore.h:171
bool ContainsElementOwner(const KeyDataType &InKey) const
Definition TypedElementOwnerStore.h:210
void UnregisterElementOwners(TFunctionRef< bool(const TTypedElementOwner< ElementDataType > &)> InShouldUnregisterElement, TFunctionRef< void(TTypedElementOwner< ElementDataType > &&)> InOnUnregisterElement)
Definition TypedElementOwnerStore.h:154
TTypedElementOwnerScopedAccess< ElementDataType > RegisterElementOwner(const KeyDataType &InKey, TTypedElementOwner< ElementDataType > &&InElementOwner)
Definition TypedElementOwnerStore.h:128
TTypedElementOwnerScopedMutableAccess< ElementDataType > FindMutableElementOwner(const KeyDataType &InKey)
Definition TypedElementOwnerStore.h:200
TTypedElementOwnerStore()=default
~TTypedElementOwnerStore()
Definition TypedElementOwnerStore.h:118
TTypedElementOwner< ElementDataType > UnregisterElementOwner(const KeyDataType &InKey)
Definition TypedElementOwnerStore.h:141
Definition TypedElementHandle.h:409