Navigation
API > API/Runtime > API/Runtime/EventLoop
Managed storage class which allows resource creation and removal from any thread. The owning thread may access the storage without thread safety concerns.
| Name | TManagedStorage |
| Type | class |
| Header File | /Engine/Source/Runtime/Online/Experimental/EventLoop/Public/EventLoop/EventLoopManagedStorage.h |
| Include Path | #include "EventLoop/EventLoopManagedStorage.h" |
Syntax
template<typename ElementType, typename Traits>
class TManagedStorage : public FNoncopyable
Inheritance Hierarchy
- FNoncopyable → TManagedStorage
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TManagedStorage() |
EventLoop/EventLoopManagedStorage.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TManagedStorage() |
EventLoop/EventLoopManagedStorage.h |
Classes
| Name | Remarks |
|---|---|
| TBaseRangeForIterator | DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.NOT thread safe. |
Structs
| Name | Remarks |
|---|---|
| FAddRequest | |
| FRemoveRequest | |
| FStorageEntry | |
| TManagedStorageInternalHandle | Handle which extends the external resource handle to allow O(1) access into the internal storage array. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FExternalHandle | typename Traits::FExternalHandle | EventLoop/EventLoopManagedStorage.h | |
| FInternalHandle | TManagedStorageInternalHandle< FExternalHandle > | EventLoop/EventLoopManagedStorage.h | |
| FInternalHandleArryType | TArray< FInternalHandle, typename Traits::InternalHandleArryAllocatorType > | EventLoop/EventLoopManagedStorage.h | |
| FStorageType | TSparseArray< FStorageEntry > | EventLoop/EventLoopManagedStorage.h | |
| TRangedForConstIterator | TBaseRangeForIterator< true > | EventLoop/EventLoopManagedStorage.h | |
| TRangedForIterator | TBaseRangeForIterator< false > | EventLoop/EventLoopManagedStorage.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AddRequests | TMpscQueue< FAddRequest > | Requests to add entries to storage. Processed in Update(). | EventLoop/EventLoopManagedStorage.h | |
| ManagerThreadId | TAtomic< uint32 > | The thread id set when calling Init. | EventLoop/EventLoopManagedStorage.h | |
| RemoveRequests | TMpscQueue< FRemoveRequest > | Requests to remove entries from storage. Processed in Update(). | EventLoop/EventLoopManagedStorage.h | |
| Storage | FStorageType | The internal storage of entries. | EventLoop/EventLoopManagedStorage.h | |
| StorageHandleIndex | TMap< FExternalHandle, int32 > | Mapping of external handles to the array index of the element in Storage. | EventLoop/EventLoopManagedStorage.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FExternalHandle Add
(
ElementType&& Data |
Requests to add a resource.Thread safe. | EventLoop/EventLoopManagedStorage.h | |
TRangedForIterator begin () |
EventLoop/EventLoopManagedStorage.h | ||
TRangedForConstIterator begin () |
EventLoop/EventLoopManagedStorage.h | ||
TRangedForIterator end () |
EventLoop/EventLoopManagedStorage.h | ||
TRangedForConstIterator end () |
EventLoop/EventLoopManagedStorage.h | ||
const ElementType * Find
(
FInternalHandle Handle |
EventLoop/EventLoopManagedStorage.h | ||
ElementType * Find
(
FInternalHandle Handle |
EventLoop/EventLoopManagedStorage.h | ||
const ElementType * Find
(
FExternalHandle Handle |
EventLoop/EventLoopManagedStorage.h | ||
ElementType * Find
(
FExternalHandle Handle |
EventLoop/EventLoopManagedStorage.h | ||
void Init() |
Initialize storage.NOT thread safe. | EventLoop/EventLoopManagedStorage.h | |
bool IsEmpty() |
EventLoop/EventLoopManagedStorage.h | ||
bool IsManagerThread() |
External access for checking whether the current thread is the manager thread. | EventLoop/EventLoopManagedStorage.h | |
int32 Num() |
STORAGE ACCESSNOT thread safe. | EventLoop/EventLoopManagedStorage.h | |
void Remove
(
const FExternalHandle Handle, |
Requests to remove a resource.Thread safe. | EventLoop/EventLoopManagedStorage.h | |
void Remove
(
const FInternalHandle Handle |
Removes a resource directly using its internal handle.NOT thread safe. | EventLoop/EventLoopManagedStorage.h | |
uint32 Update
(
FInternalHandleArryType* OutAddedHandles, |
Process all pending storage modifications.NOT thread safe. | EventLoop/EventLoopManagedStorage.h |