Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FOutputDeviceMemory Class Reference

#include <OutputDeviceMemory.h>

+ Inheritance diagram for FOutputDeviceMemory:
+ Collaboration diagram for FOutputDeviceMemory:

Classes

class  FOutputDeviceMemoryProxyArchive
 

Public Member Functions

 FOutputDeviceMemory (int32 InPreserveSize=256 *1024, int32 InBufferSize=2048 *1024, bool bInSuppressEventTag=false)
 
virtual void Dump (FArchive &Ar) override
 
virtual void TearDown () override
 
virtual void Flush () override
 
virtual void Serialize (const TCHAR *Data, ELogVerbosity::Type Verbosity, const class FName &Category, const double Time) override
 
virtual void Serialize (const TCHAR *Data, ELogVerbosity::Type Verbosity, const class FName &Category) override
 
virtual bool CanBeUsedOnAnyThread () const override
 
virtual bool CanBeUsedOnPanicThread () const override
 
virtual bool IsMemoryOnly () const override
 
- Public Member Functions inherited from FOutputDevice
 FOutputDevice ()
 
 FOutputDevice (FOutputDevice &&)=default
 
 FOutputDevice (const FOutputDevice &)=default
 
FOutputDeviceoperator= (FOutputDevice &&)=default
 
FOutputDeviceoperator= (const FOutputDevice &)=default
 
virtual ~FOutputDevice ()=default
 
virtual void Serialize (const TCHAR *V, ELogVerbosity::Type Verbosity, const FName &Category)=0
 
virtual void Serialize (const TCHAR *V, ELogVerbosity::Type Verbosity, const FName &Category, const double Time)
 
virtual void SerializeRecord (const UE::FLogRecord &Record)
 
void SetSuppressEventTag (bool bInSuppressEventTag)
 
FORCEINLINE bool GetSuppressEventTag () const
 
void SetAutoEmitLineTerminator (bool bInAutoEmitLineTerminator)
 
FORCEINLINE bool GetAutoEmitLineTerminator () const
 
virtual bool CanBeUsedOnMultipleThreads () const
 
void Log (const TCHAR *S)
 
void Log (ELogVerbosity::Type Verbosity, const TCHAR *S)
 
void Log (const FName &Category, ELogVerbosity::Type Verbosity, const TCHAR *Str)
 
void Log (const FString &S)
 
void Log (const FText &S)
 
void Log (ELogVerbosity::Type Verbosity, const FString &S)
 
void Log (const FName &Category, ELogVerbosity::Type Verbosity, const FString &S)
 
template<typename FmtType >
void Logf (const FmtType &Fmt)
 
template<typename FmtType , typename... Types>
FORCEINLINE void Logf (const FmtType &Fmt, Types... Args)
 
template<typename FmtType , typename... Types>
FORCEINLINE void Logf (ELogVerbosity::Type Verbosity, const FmtType &Fmt, Types... Args)
 
template<typename FmtType , typename... Types>
FORCEINLINE void CategorizedLogf (const FName &Category, ELogVerbosity::Type Verbosity, const FmtType &Fmt, Types... Args)
 

Private Member Functions

void SerializeToBuffer (ANSICHAR *Data, int32 Length)
 

Private Attributes

FOutputDeviceMemory::FOutputDeviceMemoryProxyArchive ArchiveProxy
 
TArray< ANSICHAR > Buffer
 
int32 BufferStartPos
 
int32 BufferLength
 
int32 PreserveSize
 
FCriticalSection BufferPosCritical
 

Additional Inherited Members

- Protected Attributes inherited from FOutputDevice
bool bSuppressEventTag
 
bool bAutoEmitLineTerminator
 

Detailed Description

Memory output device. Logs only into pre-allocated memory buffer.

Definition at line 16 of file OutputDeviceMemory.h.

Constructor & Destructor Documentation

◆ FOutputDeviceMemory()

FOutputDeviceMemory::FOutputDeviceMemory ( int32 InPreserveSize = 256 *1024,
int32 InBufferSize = 2048 *1024,
bool bInSuppressEventTag = false )

Constructor, initializing member variables.

Parameters
InPreserveSizeBytes of the rung buffer not to overwrite (startup info etc)
InBufferSizeMaximum size of the memory ring buffer

Member Function Documentation

◆ CanBeUsedOnAnyThread()

virtual bool FOutputDeviceMemory::CanBeUsedOnAnyThread ( ) const
inlineoverridevirtual
Returns
whether this output device can be used on any thread.

Reimplemented from FOutputDevice.

Definition at line 59 of file OutputDeviceMemory.h.

◆ CanBeUsedOnPanicThread()

virtual bool FOutputDeviceMemory::CanBeUsedOnPanicThread ( ) const
inlineoverridevirtual
Returns
whether this output device can be used after a panic (crash or fatal error) has been flagged.
Note
The return value is cached by AddOutputDevice because calling this during a panic may fail.

Reimplemented from FOutputDevice.

Definition at line 63 of file OutputDeviceMemory.h.

◆ Dump()

virtual void FOutputDeviceMemory::Dump ( FArchive & Ar)
overridevirtual

Dumps the contents of the buffer to an archive

Reimplemented from FOutputDevice.

◆ Flush()

virtual void FOutputDeviceMemory::Flush ( )
overridevirtual

Flush the write cache so the file isn't truncated in case we crash right after calling this function.

Reimplemented from FOutputDevice.

◆ IsMemoryOnly()

virtual bool FOutputDeviceMemory::IsMemoryOnly ( ) const
inlineoverridevirtual
Returns
whether this output device is a memory-only device

Reimplemented from FOutputDevice.

Definition at line 67 of file OutputDeviceMemory.h.

◆ Serialize() [1/2]

virtual void FOutputDeviceMemory::Serialize ( const TCHAR * Data,
ELogVerbosity::Type Verbosity,
const class FName & Category )
overridevirtual

◆ Serialize() [2/2]

virtual void FOutputDeviceMemory::Serialize ( const TCHAR * Data,
ELogVerbosity::Type Verbosity,
const class FName & Category,
const double Time )
overridevirtual

◆ SerializeToBuffer()

void FOutputDeviceMemory::SerializeToBuffer ( ANSICHAR * Data,
int32 Length )
private

Serialize cast data to the actual memory buffer

+ Here is the caller graph for this function:

◆ TearDown()

virtual void FOutputDeviceMemory::TearDown ( )
overridevirtual

Closes output device and cleans up. This can't happen in the destructor as we have to call "delete" which cannot be done for static/ global objects.

Reimplemented from FOutputDevice.

Member Data Documentation

◆ ArchiveProxy

FOutputDeviceMemory::FOutputDeviceMemoryProxyArchive FOutputDeviceMemory::ArchiveProxy
private

◆ Buffer

TArray<ANSICHAR> FOutputDeviceMemory::Buffer
private

Ring buffer

Definition at line 79 of file OutputDeviceMemory.h.

◆ BufferLength

int32 FOutputDeviceMemory::BufferLength
private

Used data size

Definition at line 83 of file OutputDeviceMemory.h.

◆ BufferPosCritical

FCriticalSection FOutputDeviceMemory::BufferPosCritical
private

Sync object for the buffer pos

Definition at line 87 of file OutputDeviceMemory.h.

◆ BufferStartPos

int32 FOutputDeviceMemory::BufferStartPos
private

Position where data starts in the buffer

Definition at line 81 of file OutputDeviceMemory.h.

◆ PreserveSize

int32 FOutputDeviceMemory::PreserveSize
private

Amount of data not to overwrite

Definition at line 85 of file OutputDeviceMemory.h.


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