Ark Server API (ASA) - Wiki
|
#include <CompressedGrowableBuffer.h>
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) |
void * | Access (int32 Offset) |
int32 | Num () const |
SIZE_T | GetAllocatedSize () const |
Private Types | |
enum | EVS2015Redirector { Redirect } |
Private Member Functions | |
FCompressedGrowableBuffer (EVS2015Redirector, int32 MaxPendingBufferSize, ECompressionFlags CompressionFlags) | |
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.
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.
|
private |
|
inline |
Constructor
MaxPendingBufferSize | Max chunk size to compress in uncompressed bytes |
CompressionFlags | Compression flags to compress memory with |
Definition at line 33 of file CompressedGrowableBuffer.h.
FCompressedGrowableBuffer::FCompressedGrowableBuffer | ( | int32 | MaxPendingBufferSize, |
FName | COmpressionFormat, | ||
ECompressionFlags | CompressionFlags = COMPRESS_None ) |
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
Offset | Offset to return corresponding data for |
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.
Data | Data to append |
Size | Size of data in bytes. |
|
inline |
Helper function to return the amount of memory allocated by this buffer
Definition at line 81 of file CompressedGrowableBuffer.h.
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.
|
inline |
Definition at line 71 of file CompressedGrowableBuffer.h.
void FCompressedGrowableBuffer::Unlock | ( | ) |
Unlocks the buffer and frees temporary resources used for accessing.
|
private |
Book keeping information for decompression/ access.
Definition at line 123 of file CompressedGrowableBuffer.h.
Compressed data.
Definition at line 115 of file CompressedGrowableBuffer.h.
|
private |
Compression flags used to compress the data.
Definition at line 109 of file CompressedGrowableBuffer.h.
|
private |
Compression format used to compress the data.
Definition at line 107 of file CompressedGrowableBuffer.h.
|
private |
Current offset in uncompressed data.
Definition at line 111 of file CompressedGrowableBuffer.h.
Temporary decompression buffer used between Lock/ Unlock.
Definition at line 119 of file CompressedGrowableBuffer.h.
|
private |
Index into book keeping info associated with decompressed buffer.
Definition at line 121 of file CompressedGrowableBuffer.h.
|
private |
Maximum chunk size to compress in uncompressed bytes.
Definition at line 105 of file CompressedGrowableBuffer.h.
|
private |
Number of entries in buffer.
Definition at line 113 of file CompressedGrowableBuffer.h.
Data pending compression once size limit is reached.
Definition at line 117 of file CompressedGrowableBuffer.h.