Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FCompressedGrowableBuffer Struct Reference

#include <CompressedGrowableBuffer.h>

+ Collaboration diagram for FCompressedGrowableBuffer:

Classes

struct  FBufferBookKeeping
 

Public Member Functions

 FCompressedGrowableBuffer (int32 MaxPendingBufferSize, ECompressionFlags CompressionFlags)
 
 FCompressedGrowableBuffer (int32 MaxPendingBufferSize, FName COmpressionFormat, ECompressionFlags CompressionFlags=COMPRESS_None)
 
void Lock ()
 
void Unlock ()
 
int32 Append (void *Data, int32 Size)
 
voidAccess (int32 Offset)
 
int32 Num () const
 
SIZE_T GetAllocatedSize () const
 

Private Types

enum  EVS2015Redirector { Redirect }
 

Private Member Functions

 FCompressedGrowableBuffer (EVS2015Redirector, int32 MaxPendingBufferSize, ECompressionFlags CompressionFlags)
 

Private Attributes

int32 MaxPendingBufferSize
 
FName CompressionFormat
 
ECompressionFlags CompressionFlags
 
int32 CurrentOffset
 
int32 NumEntries
 
TArray< uint8CompressedBuffer
 
TArray< uint8PendingCompressionBuffer
 
TArray< uint8DecompressedBuffer
 
int32 DecompressedBufferBookKeepingInfoIndex
 
TArray< FBufferBookKeepingBookKeepingInfo
 

Detailed Description

Growable compressed buffer. Usage is to append frequently but only request and therefore decompress very infrequently. The prime usage case is the memory profiler keeping track of full call stacks.

Definition at line 13 of file CompressedGrowableBuffer.h.

Member Enumeration Documentation

◆ EVS2015Redirector

This enum and the following constructor is a workaround for VC compiler bug that prevents using attributes on constructors without inline implementation. This should be removed when the deprecated ctor is removed.

Enumerator
Redirect 

Definition at line 20 of file CompressedGrowableBuffer.h.

Constructor & Destructor Documentation

◆ FCompressedGrowableBuffer() [1/3]

FCompressedGrowableBuffer::FCompressedGrowableBuffer ( EVS2015Redirector ,
int32 MaxPendingBufferSize,
ECompressionFlags CompressionFlags )
private
+ Here is the caller graph for this function:

◆ FCompressedGrowableBuffer() [2/3]

FCompressedGrowableBuffer::FCompressedGrowableBuffer ( int32 MaxPendingBufferSize,
ECompressionFlags CompressionFlags )
inline

Constructor

Parameters
MaxPendingBufferSizeMax chunk size to compress in uncompressed bytes
CompressionFlagsCompression flags to compress memory with

Definition at line 33 of file CompressedGrowableBuffer.h.

+ Here is the call graph for this function:

◆ FCompressedGrowableBuffer() [3/3]

FCompressedGrowableBuffer::FCompressedGrowableBuffer ( int32 MaxPendingBufferSize,
FName COmpressionFormat,
ECompressionFlags CompressionFlags = COMPRESS_None )

Member Function Documentation

◆ Access()

void * FCompressedGrowableBuffer::Access ( int32 Offset)

Accesses the data at passed in offset and returns it. The memory is read-only and memory will be freed in call to unlock. The lifetime of the data is till the next call to Unlock, Append or Access

Parameters
OffsetOffset to return corresponding data for

◆ Append()

int32 FCompressedGrowableBuffer::Append ( void * Data,
int32 Size )

Appends passed in data to the buffer. The data needs to be less than the max pending buffer size. The code will assert on this assumption.

Parameters
DataData to append
SizeSize of data in bytes.
Returns
Offset of data, used for retrieval later on

◆ GetAllocatedSize()

SIZE_T FCompressedGrowableBuffer::GetAllocatedSize ( ) const
inline

Helper function to return the amount of memory allocated by this buffer

Returns
number of bytes allocated by this buffer

Definition at line 81 of file CompressedGrowableBuffer.h.

◆ Lock()

void FCompressedGrowableBuffer::Lock ( )

Locks the buffer for reading. Needs to be called before calls to Access and needs to be matched up with Unlock call.

◆ Num()

int32 FCompressedGrowableBuffer::Num ( ) const
inline
Returns
Number of entries appended.

Definition at line 71 of file CompressedGrowableBuffer.h.

◆ Unlock()

void FCompressedGrowableBuffer::Unlock ( )

Unlocks the buffer and frees temporary resources used for accessing.

Member Data Documentation

◆ BookKeepingInfo

TArray<FBufferBookKeeping> FCompressedGrowableBuffer::BookKeepingInfo
private

Book keeping information for decompression/ access.

Definition at line 123 of file CompressedGrowableBuffer.h.

◆ CompressedBuffer

TArray<uint8> FCompressedGrowableBuffer::CompressedBuffer
private

Compressed data.

Definition at line 115 of file CompressedGrowableBuffer.h.

◆ CompressionFlags

ECompressionFlags FCompressedGrowableBuffer::CompressionFlags
private

Compression flags used to compress the data.

Definition at line 109 of file CompressedGrowableBuffer.h.

◆ CompressionFormat

FName FCompressedGrowableBuffer::CompressionFormat
private

Compression format used to compress the data.

Definition at line 107 of file CompressedGrowableBuffer.h.

◆ CurrentOffset

int32 FCompressedGrowableBuffer::CurrentOffset
private

Current offset in uncompressed data.

Definition at line 111 of file CompressedGrowableBuffer.h.

◆ DecompressedBuffer

TArray<uint8> FCompressedGrowableBuffer::DecompressedBuffer
private

Temporary decompression buffer used between Lock/ Unlock.

Definition at line 119 of file CompressedGrowableBuffer.h.

◆ DecompressedBufferBookKeepingInfoIndex

int32 FCompressedGrowableBuffer::DecompressedBufferBookKeepingInfoIndex
private

Index into book keeping info associated with decompressed buffer.

Definition at line 121 of file CompressedGrowableBuffer.h.

◆ MaxPendingBufferSize

int32 FCompressedGrowableBuffer::MaxPendingBufferSize
private

Maximum chunk size to compress in uncompressed bytes.

Definition at line 105 of file CompressedGrowableBuffer.h.

◆ NumEntries

int32 FCompressedGrowableBuffer::NumEntries
private

Number of entries in buffer.

Definition at line 113 of file CompressedGrowableBuffer.h.

◆ PendingCompressionBuffer

TArray<uint8> FCompressedGrowableBuffer::PendingCompressionBuffer
private

Data pending compression once size limit is reached.

Definition at line 117 of file CompressedGrowableBuffer.h.


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