UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CompressedGrowableBuffer.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Containers/Array.h"
7#include "UObject/NameTypes.h"
8
14{
15public:
22 CORE_API FCompressedGrowableBuffer(int32 MaxPendingBufferSize, FName CompressionFormat, ECompressionFlags CompressionFlags=COMPRESS_None);
23
28 CORE_API void Lock();
32 CORE_API void Unlock();
33
42 CORE_API int32 Append( void* Data, int32 Size );
43
51 CORE_API void* Access( int32 Offset );
52
56 int32 Num() const
57 {
58 return NumEntries;
59 }
60
67 {
68 return CompressedBuffer.GetAllocatedSize()
69 + PendingCompressionBuffer.GetAllocatedSize()
70 + DecompressedBuffer.GetAllocatedSize()
71 + BookKeepingInfo.GetAllocatedSize();
72 }
73
74private:
75
77 struct FBufferBookKeeping
78 {
80 int32 CompressedOffset;
82 int32 CompressedSize;
84 int32 UncompressedOffset;
87 };
88
90 int32 MaxPendingBufferSize;
92 FName CompressionFormat;
94 ECompressionFlags CompressionFlags;
96 int32 CurrentOffset;
98 int32 NumEntries;
100 TArray<uint8> CompressedBuffer;
102 TArray<uint8> PendingCompressionBuffer;
104 TArray<uint8> DecompressedBuffer;
106 int32 DecompressedBufferBookKeepingInfoIndex;
108 TArray<FBufferBookKeeping> BookKeepingInfo;
109};
ECompressionFlags
Definition CompressionFlags.h:13
@ COMPRESS_None
Definition CompressionFlags.h:15
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32 Offset
Definition VulkanMemory.cpp:4033
uint32 Size
Definition VulkanMemory.cpp:4034
Definition NameTypes.h:617
Definition Array.h:670
UE_NODEBUG UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize(void) const
Definition Array.h:1059
Definition CompressedGrowableBuffer.h:14
CORE_API void * Access(int32 Offset)
Definition Compression.cpp:1142
SIZE_T GetAllocatedSize() const
Definition CompressedGrowableBuffer.h:66
CORE_API void Unlock()
Definition Compression.cpp:1073
int32 Num() const
Definition CompressedGrowableBuffer.h:56
CORE_API void Lock()
Definition Compression.cpp:1065