Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Plugins/Experimental/StructUtils/Source/StructUtils/Public/InstancedStructStream.h |
Include |
#include "InstancedStructStream.h" |
USTRUCT()
struct FInstancedStructStream
A stream where you can append heterogeneous structs, and iterate over them in order (no random access). The structs are stored in chunks of specified size, and reused when the stream is reset. Each chunk can hold up to MaxScriptStructsPerChunk types, on overflow new chunk is allocated. The stream can be iterated over using one of the ForEach*() methods.
If you use move assign or Append(&&), make sure to call Compact() or you may end up with large free list.
Name | Description | ||
---|---|---|---|
|
ChunkSize |
Number of items stored in the buffer |
|
|
FChunkHeader &#... |
First |
|
|
FChunkHeader &#... |
FreeList |
Pointer to the last chunk in use |
|
FChunkHeader &#... |
Head |
Pointer to the first chunk in use |
|
NumItems |
Free list of unused chunks |
Name | Description | |
---|---|---|
|
FInstancedStructStream ( |
|
|
FInstancedStructStream ( |
|
|
FInstancedStructStream ( |
Name | Description | |
---|---|---|
|
~FInstancedStructStream() |
Name | Description | ||
---|---|---|---|
|
Add ( |
Adds struct to the buffer based on ScriptStruct and pointer. |
|
|
Add ( |
Add new struct in the buffer. |
|
|
T & |
Add_GetRef ( |
Add new struct in the buffer, and return reference to it. |
|
AddStructReferencedObjects ( |
||
|
AllocateNewChunk() |
Allocates a new chunk and makes it the head of the chunk list. |
|
|
uint8 * |
AllocItem ( |
Allocates an item of specified type. |
|
Append ( |
||
|
Append ( |
||
|
Clear() |
Resets and clears all structs, and releases unused internal memory. |
|
|
Compact() |
Releases unused internal memory. |
|
|
Emplace ( |
Emplaces struct in the buffer. |
|
|
T & |
Emplace_GetRef ( |
Emplaces struct in the buffer, and returns reference to it. |
|
ForEach ( |
Iterates over all structs of specified type T and calls Function on each item. |
|
|
ForEach ( |
Iterates over all structs and calls Function on each item |
|
|
ForEachFiltered ( |
Iterates over all structs of specified types and calls Function on each item |
|
|
GetAllocatedSize() |
Helper function to return the amount of memory allocated by this container. |
|
|
GetChunkSize() |
||
|
GetNumFreeChunks() |
||
|
GetNumUsedChunks() |
||
|
GetScriptStructs ( |
Returns struct types in the buffer |
|
|
IsEmpty() |
||
|
Num() |
||
|
Reset() |
Resets and clears all structs, keeps internal memory. |
Name | Description | ||
---|---|---|---|
|
FInstancedSt... |
operator= ( |
|
|
FInstancedSt... |
operator= ( |
Name |
Description |
|
---|---|---|
|
FChunkHeader |
Header for a chunk of items. |
|
FItemHeader |
Header for each item in a chunk. Allocated before the item in tge chunk memory. |
Name |
Description |
---|---|
DefaultChunkSize |
|
MaxScriptStructsPerChunk |
Number of unique struct types that can be stored per chunk. |