Navigation
API > API/Runtime > API/Runtime/Core
Provides a thread-safe serialization interface with a background thread doing the actual writes. [] tags identify which thread owns a variable or function
| Name | FAsyncWriter |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/OutputDeviceFile.h |
| Include Path | #include "Misc/OutputDeviceFile.h" |
Syntax
class FAsyncWriter :
public FRunnable ,
public FSingleThreadRunnable ,
public FArchive
Inheritance Hierarchy
- FArchiveState → FArchive → FAsyncWriter
- FRunnable → FAsyncWriter
- FSingleThreadRunnable → FAsyncWriter
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FAsyncWriter
(
FArchive& InAr, |
Misc/OutputDeviceFile.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FAsyncWriter() |
Misc/OutputDeviceFile.h |
Enums
Public
| Name | Remarks |
|---|---|
| EThreadNameOption |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Ar | FArchive & | Writer archive | Misc/OutputDeviceFile.h | |
| Buffer | TArray< uint8 > | Data ring buffer | Misc/OutputDeviceFile.h | |
| BufferEndPos | TAtomic< int32 > | [CLIENT THREAD] Position where the unserialized data ends in the buffer (such as if (BufferEndPos > BufferStartPos) Length = BufferEndPos - BufferStartPos; | Misc/OutputDeviceFile.h | |
| BufferPosCritical | FCriticalSection | [CLIENT THREAD] Sync object for the buffer pos | Misc/OutputDeviceFile.h | |
| BufferStartPos | TAtomic< int32 > | [WRITER THREAD] Position where the unserialized data starts in the buffer | Misc/OutputDeviceFile.h | |
| LastArchiveFlushTime | double | [WRITER THREAD] Last time the archive was flushed. | Misc/OutputDeviceFile.h | |
| RunCritical | FCriticalSection | Sync object for buffer flushes in forkable mode, when forking hasn't occurred yet. | Misc/OutputDeviceFile.h | |
| SerializeRequestCounter | FThreadSafeCounter | [CLIENT/WRITER THREAD] Outstanding serialize request counter. | Misc/OutputDeviceFile.h | |
| StopTaskCounter | FThreadSafeCounter | Stops this thread | Misc/OutputDeviceFile.h | |
| Thread | volatile FRunnableThread * | Thread to run the worker FRunnable on. | Misc/OutputDeviceFile.h | |
| WantsArchiveFlush | FThreadSafeCounter | [CLIENT/WRITER THREAD] Tells the writer thread, the client requested flush. | Misc/OutputDeviceFile.h |
Functions
Public
Overridden from FRunnable
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FSingleThreadRunnable * GetSingleThreadInterface () |
Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. | Misc/OutputDeviceFile.h | |
virtual bool Init () |
Initializes the runnable object. | Misc/OutputDeviceFile.h | |
virtual uint32 Run () |
Runs the runnable object. | Misc/OutputDeviceFile.h | |
virtual void Stop () |
Stops the runnable object.This is called if a thread is requested to terminate early. | Misc/OutputDeviceFile.h |
Overridden from FArchive
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Flush() |
Flush all buffers to disk | Misc/OutputDeviceFile.h | |
virtual void Serialize
(
void* InData, |
[CLIENT THREAD] Serialize data to buffer that will later be saved to disk by the async thread | Misc/OutputDeviceFile.h |
Protected
Overridden from FSingleThreadRunnable
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Tick() |
[CLIENT THREAD] A substitute for Run() for when threading is disabled. | Misc/OutputDeviceFile.h |