UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PlatformIoDispatcher.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "IO/IoStatus.h"
7#include "IO/IoBuffer.h"
8#include "Logging/LogMacros.h"
10#include "Memory/MemoryFwd.h"
11#include "Misc/EnumClassFlags.h"
12#include "Templates/Function.h"
13#include "UObject/NameTypes.h"
14
15#if !defined(PLATFORM_IMPLEMENTS_IO)
16#define PLATFORM_IMPLEMENTS_IO 0
17#endif
18
20
21namespace UE
22{
23
26{
27 FIoFileHandle() = default;
29 : Handle(InHandle)
30 { }
31
32 uint64 Value() const { return Handle; }
33 bool IsValid() const { return Handle != 0; }
34
35 friend uint32 GetTypeHash(FIoFileHandle FileHandle) { return GetTypeHash(FileHandle.Handle); }
36 friend bool operator==(FIoFileHandle LHS, FIoFileHandle RHS) { return LHS.Handle == RHS.Handle; }
37 friend bool operator!=(FIoFileHandle LHS, FIoFileHandle RHS) { return LHS.Handle != RHS.Handle; }
38 friend bool operator<(FIoFileHandle LHS, FIoFileHandle RHS) { return LHS.Handle < RHS.Handle; }
39
40private:
41 uint64 Handle = 0;
42};
43
46{
48};
49
52{
53 None = 0,
54 Encrypted = (1 << 0),
55 Signed = (1 << 1)
56};
58
70
75{
76 FIoFileReadRequest() = default;
78 : Handle(InHandle)
79 { }
80
81 uint64 Value() const { return Handle; }
82 bool IsValid() const { return Handle != 0; }
83
84private:
85 uint64 Handle = 0;
86};
87
95{
96public:
110
112
134
150 uint64 BlockFileOffset,
152 uint32 BlockCompressedSize,
153 uint32 BlockUncompresedSize,
154 uint64 ScatterOffset,
155 uint64 ScatterSize,
156 uint64 DestinationOffset,
157 FName CompressionMethod,
158 FMemoryView EncryptionKey,
159 FMemoryView BlockHash)
160 {
162 {
163 .BlockFileOffset = BlockFileOffset,
164 .BlockCompressedSize = BlockCompressedSize,
165 .BlockUncompresedSize = BlockUncompresedSize,
166 .ScatterOffset = ScatterOffset,
167 .ScatterSize = ScatterSize,
168 .DestinationOffset = DestinationOffset,
169 .BlockIndex = BlockIndex,
170 .CompressionMethod = CompressionMethod,
171 .EncryptionKey = EncryptionKey,
172 .BlockHash = BlockHash
173 });
174 }
175
179 void* UserData;
182};
183
191
193
203
206{
207 bool bMultithreaded = true;
208 bool bForceGeneric = false;
209};
210
213{
214public:
215 virtual ~IPlatformIoDispatcher() = default;
217 virtual FIoStatus Initialize() = 0;
221 virtual FIoStatus CloseFile(FIoFileHandle FileHandle) = 0;
227 virtual bool Tick() = 0;
231 virtual void CancelRequest(FIoFileReadRequest Request) = 0;
233 virtual void CancelAllRequests(FIoFileHandle FileHandle) = 0;
235 virtual void DeleteRequest(FIoFileReadRequest Request) = 0;
236};
237
239{
240public:
242 CORE_API static void Initialize();
243 CORE_API static void Shutdown();
246};
247
248} // namespace UE
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
EIoErrorCode
Definition IoStatus.h:19
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
#define MAX_uint32
Definition NumericLimits.h:21
#define MAX_uint64
Definition NumericLimits.h:22
int BlockIndex
Definition binka_ue_decode_test.cpp:38
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition IoBuffer.h:15
Definition IoStatus.h:60
Definition NameTypes.h:617
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition IoStatus.h:101
Definition PlatformIoDispatcher.h:95
int32 Priority
Definition PlatformIoDispatcher.h:180
FIoBuffer & Destination
Definition PlatformIoDispatcher.h:177
void * UserData
Definition PlatformIoDispatcher.h:179
uint64 DestinationSize
Definition PlatformIoDispatcher.h:178
FIoScatterGatherRequestParams(FIoFileHandle InFileHandle, FIoBuffer &InDestination, uint64 InDestinationSize, void *InUserData, int32 InPriority)
Definition PlatformIoDispatcher.h:122
FIoFileHandle FileHandle
Definition PlatformIoDispatcher.h:176
FScatterParamsArray Params
Definition PlatformIoDispatcher.h:181
void Scatter(uint64 BlockFileOffset, uint32 BlockIndex, uint32 BlockCompressedSize, uint32 BlockUncompresedSize, uint64 ScatterOffset, uint64 ScatterSize, uint64 DestinationOffset, FName CompressionMethod, FMemoryView EncryptionKey, FMemoryView BlockHash)
Definition PlatformIoDispatcher.h:149
Definition PlatformIoDispatcher.h:239
static CORE_API void Initialize()
Definition PlatformIoDispatcher.cpp:33
static CORE_API void Shutdown()
Definition PlatformIoDispatcher.cpp:41
static CORE_API IPlatformIoDispatcher * TryGet()
Definition PlatformIoDispatcher.cpp:51
static CORE_API IPlatformIoDispatcher & Get()
Definition PlatformIoDispatcher.cpp:46
Definition PlatformIoDispatcher.h:213
virtual void DeleteRequest(FIoFileReadRequest Request)=0
virtual void CancelAllRequests(FIoFileHandle FileHandle)=0
virtual void CancelRequest(FIoFileReadRequest Request)=0
virtual bool Tick()=0
virtual FIoStatus Initialize()=0
virtual TIoStatusOr< FIoFileHandle > OpenFile(const TCHAR *Filename, const FIoFileProperties &FileProperties, FIoFileStat *OutStat=nullptr)=0
virtual FIoFileReadRequest ScatterGather(FIoScatterGatherRequestParams &&Params, FIoFileReadRequestCompleted &&OnCompleted)=0
virtual FIoStatus CloseFile(FIoFileHandle FileHandle)=0
virtual ~IPlatformIoDispatcher()=default
virtual void UpdatePriority(FIoFileReadRequest Request, int32 NewPriority)=0
virtual FIoFileReadRequest ReadDirect(FIoDirectReadRequestParams &&Params, FIoFileReadRequestCompleted &&OnCompleted)=0
Definition AdvancedWidgetsModule.cpp:13
EIoFilePropertyFlags
Definition PlatformIoDispatcher.h:52
Definition PlatformIoDispatcher.h:196
uint64 Size
Definition PlatformIoDispatcher.h:200
FIoFileHandle FileHandle
Definition PlatformIoDispatcher.h:197
FIoBuffer & Dst
Definition PlatformIoDispatcher.h:198
void * UserData
Definition PlatformIoDispatcher.h:201
uint64 Offset
Definition PlatformIoDispatcher.h:199
Definition PlatformIoDispatcher.h:26
FIoFileHandle(uint64 InHandle)
Definition PlatformIoDispatcher.h:28
friend bool operator==(FIoFileHandle LHS, FIoFileHandle RHS)
Definition PlatformIoDispatcher.h:36
bool IsValid() const
Definition PlatformIoDispatcher.h:33
friend bool operator!=(FIoFileHandle LHS, FIoFileHandle RHS)
Definition PlatformIoDispatcher.h:37
friend uint32 GetTypeHash(FIoFileHandle FileHandle)
Definition PlatformIoDispatcher.h:35
friend bool operator<(FIoFileHandle LHS, FIoFileHandle RHS)
Definition PlatformIoDispatcher.h:38
FIoFileHandle()=default
uint64 Value() const
Definition PlatformIoDispatcher.h:32
Definition PlatformIoDispatcher.h:65
TConstArrayView< FName > CompressionMethods
Definition PlatformIoDispatcher.h:66
uint32 CompressionBlockSize
Definition PlatformIoDispatcher.h:67
EIoFilePropertyFlags Flags
Definition PlatformIoDispatcher.h:68
Definition PlatformIoDispatcher.h:75
uint64 Value() const
Definition PlatformIoDispatcher.h:81
FIoFileReadRequest(uint64 InHandle)
Definition PlatformIoDispatcher.h:77
FIoFileReadRequest()=default
bool IsValid() const
Definition PlatformIoDispatcher.h:82
Definition PlatformIoDispatcher.h:186
EIoErrorCode ErrorCode
Definition PlatformIoDispatcher.h:189
void * UserData
Definition PlatformIoDispatcher.h:187
uint32 FailedBlockId
Definition PlatformIoDispatcher.h:188
Definition PlatformIoDispatcher.h:46
uint64 FileSize
Definition PlatformIoDispatcher.h:47
Definition PlatformIoDispatcher.h:98
uint32 BlockIndex
Definition PlatformIoDispatcher.h:105
FName CompressionMethod
Definition PlatformIoDispatcher.h:106
uint32 BlockUncompresedSize
Definition PlatformIoDispatcher.h:101
FMemoryView EncryptionKey
Definition PlatformIoDispatcher.h:107
uint32 BlockCompressedSize
Definition PlatformIoDispatcher.h:100
FMemoryView BlockHash
Definition PlatformIoDispatcher.h:108
uint64 ScatterOffset
Definition PlatformIoDispatcher.h:102
uint64 BlockFileOffset
Definition PlatformIoDispatcher.h:99
uint64 DestinationOffset
Definition PlatformIoDispatcher.h:104
uint64 ScatterSize
Definition PlatformIoDispatcher.h:103
Definition PlatformIoDispatcher.h:206
bool bMultithreaded
Definition PlatformIoDispatcher.h:207
bool bForceGeneric
Definition PlatformIoDispatcher.h:208