UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::EventLoop::TManagedStorage< ElementType, Traits > Class Template Referencefinal

#include <EventLoopManagedStorage.h>

+ Inheritance diagram for UE::EventLoop::TManagedStorage< ElementType, Traits >:

Classes

class  TBaseRangeForIterator
 
struct  TManagedStorageInternalHandle
 

Public Types

using FExternalHandle = typename Traits::FExternalHandle
 
using FInternalHandle = TManagedStorageInternalHandle< FExternalHandle >
 
using FInternalHandleArryType = TArray< FInternalHandle, typename Traits::InternalHandleArryAllocatorType >
 
using TRangedForIterator = TBaseRangeForIterator< false >
 
using TRangedForConstIterator = TBaseRangeForIterator< true >
 

Public Member Functions

 TManagedStorage ()
 
 ~TManagedStorage ()
 
bool IsManagerThread () const
 
void Init ()
 
uint32 Update (FInternalHandleArryType *OutAddedHandles=nullptr, FInternalHandleArryType *OutRemovedHandles=nullptr)
 
FExternalHandle Add (ElementType &&Data)
 
void Remove (const FExternalHandle Handle, FManagedStorageOnRemoveComplete &&OnRemoveComplete=FManagedStorageOnRemoveComplete())
 
void Remove (const FInternalHandle Handle)
 
int32 Num () const
 
bool IsEmpty () const
 
ElementType * Find (FExternalHandle Handle)
 
const ElementType * Find (FExternalHandle Handle) const
 
ElementType * Find (FInternalHandle Handle)
 
const ElementType * Find (FInternalHandle Handle) const
 
TRangedForIterator begin ()
 
TRangedForConstIterator begin () const
 
TRangedForIterator end ()
 
TRangedForConstIterator end () const
 

Additional Inherited Members

- Protected Member Functions inherited from FNoncopyable
 FNoncopyable ()
 
 ~FNoncopyable ()
 

Detailed Description

template<typename ElementType, typename Traits = FManagedStorageDefaultTraits>
class UE::EventLoop::TManagedStorage< ElementType, Traits >

Managed storage class which allows resource creation and removal from any thread. The owning thread may access the storage without thread safety concerns.

Member Typedef Documentation

◆ FExternalHandle

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
using UE::EventLoop::TManagedStorage< ElementType, Traits >::FExternalHandle = typename Traits::FExternalHandle

◆ FInternalHandle

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
using UE::EventLoop::TManagedStorage< ElementType, Traits >::FInternalHandle = TManagedStorageInternalHandle<FExternalHandle>

◆ FInternalHandleArryType

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
using UE::EventLoop::TManagedStorage< ElementType, Traits >::FInternalHandleArryType = TArray<FInternalHandle, typename Traits::InternalHandleArryAllocatorType>

◆ TRangedForConstIterator

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
using UE::EventLoop::TManagedStorage< ElementType, Traits >::TRangedForConstIterator = TBaseRangeForIterator<true>

◆ TRangedForIterator

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
using UE::EventLoop::TManagedStorage< ElementType, Traits >::TRangedForIterator = TBaseRangeForIterator<false>

Constructor & Destructor Documentation

◆ TManagedStorage()

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
UE::EventLoop::TManagedStorage< ElementType, Traits >::TManagedStorage ( )
inline

◆ ~TManagedStorage()

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
UE::EventLoop::TManagedStorage< ElementType, Traits >::~TManagedStorage ( )
inline

Member Function Documentation

◆ Add()

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
FExternalHandle UE::EventLoop::TManagedStorage< ElementType, Traits >::Add ( ElementType &&  Data)
inline

Requests to add a resource.

Thread safe.

Parameters
DataThe data to be added and managed.
Returns
A new handle for the added resource.

◆ begin() [1/2]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
TRangedForIterator UE::EventLoop::TManagedStorage< ElementType, Traits >::begin ( )
inline

◆ begin() [2/2]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
TRangedForConstIterator UE::EventLoop::TManagedStorage< ElementType, Traits >::begin ( ) const
inline

◆ end() [1/2]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
TRangedForIterator UE::EventLoop::TManagedStorage< ElementType, Traits >::end ( )
inline

◆ end() [2/2]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
TRangedForConstIterator UE::EventLoop::TManagedStorage< ElementType, Traits >::end ( ) const
inline

◆ Find() [1/4]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
ElementType * UE::EventLoop::TManagedStorage< ElementType, Traits >::Find ( FExternalHandle  Handle)
inline

◆ Find() [2/4]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
const ElementType * UE::EventLoop::TManagedStorage< ElementType, Traits >::Find ( FExternalHandle  Handle) const
inline

◆ Find() [3/4]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
ElementType * UE::EventLoop::TManagedStorage< ElementType, Traits >::Find ( FInternalHandle  Handle)
inline

◆ Find() [4/4]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
const ElementType * UE::EventLoop::TManagedStorage< ElementType, Traits >::Find ( FInternalHandle  Handle) const
inline

◆ Init()

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
void UE::EventLoop::TManagedStorage< ElementType, Traits >::Init ( )
inline

Initialize storage.

NOT thread safe.

◆ IsEmpty()

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
bool UE::EventLoop::TManagedStorage< ElementType, Traits >::IsEmpty ( ) const
inline

◆ IsManagerThread()

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
bool UE::EventLoop::TManagedStorage< ElementType, Traits >::IsManagerThread ( ) const
inline

External access for checking whether the current thread is the manager thread.

◆ Num()

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
int32 UE::EventLoop::TManagedStorage< ElementType, Traits >::Num ( ) const
inline

◆ Remove() [1/2]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
void UE::EventLoop::TManagedStorage< ElementType, Traits >::Remove ( const FExternalHandle  Handle,
FManagedStorageOnRemoveComplete &&  OnRemoveComplete = FManagedStorageOnRemoveComplete() 
)
inline

Requests to remove a resource.

Thread safe.

Parameters
HandleThe handle for the resource to be removed.
OnCompleteA callback to be signaled once the resource has been destroyed.

◆ Remove() [2/2]

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
void UE::EventLoop::TManagedStorage< ElementType, Traits >::Remove ( const FInternalHandle  Handle)
inline

Removes a resource directly using its internal handle.

NOT thread safe.

Parameters
HandleThe handle for the resource to be removed.

◆ Update()

template<typename ElementType , typename Traits = FManagedStorageDefaultTraits>
uint32 UE::EventLoop::TManagedStorage< ElementType, Traits >::Update ( FInternalHandleArryType OutAddedHandles = nullptr,
FInternalHandleArryType OutRemovedHandles = nullptr 
)
inline

Process all pending storage modifications.

NOT thread safe.

Parameters
OutAddedHandlesHandles which were added since the last call to Update. Element may not be present in the internal storage if element was also removed since the last call to update.
OutRemovedHandlesHandles which were removed since the last update.
Returns
The number of changes which occurred.

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