UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BufferArchive.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"
8#include "UObject/NameTypes.h"
10
14template <int IndexSize>
15class TBufferArchive : public TMemoryWriter<IndexSize>, public TArray<uint8, TSizedDefaultAllocator<IndexSize>>
16{
17 static_assert(IndexSize == 32 || IndexSize == 64, "Only 32-bit and 64-bit index sizes supported");
18
19public:
21
22 TBufferArchive( bool bIsPersistent = false, const FName InArchiveName = NAME_None )
23 : TMemoryWriter<IndexSize>( *static_cast<ArrayType*>(this), bIsPersistent, false, InArchiveName )
24 {}
31 virtual FString GetArchiveName() const
32 {
33 if constexpr (IndexSize == 64)
34 {
35 return TEXT("FBufferArchive64 ") + this->ArchiveName.ToString();
36 }
37 else
38 {
39 return TEXT("FBufferArchive ") + this->ArchiveName.ToString();
40 }
41 }
42};
43
44// FBufferArchive and FBufferArchive64 are implemented as derived classes rather than aliases
45// so that forward declarations will work.
46
48{
50
51public:
52 using Super::Super;
53};
54
56{
58
59public:
60 using Super::Super;
61};
62
63
64template <>
69
70template <>
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition BufferArchive.h:56
Definition BufferArchive.h:48
Definition NameTypes.h:617
CORE_API FString ToString() const
Definition UnrealNames.cpp:3537
Definition Array.h:670
Definition BufferArchive.h:16
TBufferArchive(bool bIsPersistent=false, const FName InArchiveName=NAME_None)
Definition BufferArchive.h:22
virtual FString GetArchiveName() const
Definition BufferArchive.h:31
Definition MemoryWriter.h:21
const FName ArchiveName
Definition MemoryWriter.h:91
@ false
Definition radaudio_common.h:23
Definition IsContiguousContainer.h:16
static constexpr bool Value
Definition IsContiguousContainer.h:20