UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IoDispatcherChunkDecoder.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Async/Mutex.h"
6#include "IO/IoAllocators.h"
7#include "IO/IoContainers.h"
9#include "Tasks/Task.h"
10
11namespace UE
12{
13
16{
17 struct FDecodeContext
18 {
20 FDecodeContext* Next = nullptr;
21 };
22
23 struct FQueueEntry
24 : public TIntrusiveListElement<FQueueEntry>
25 {
27 : Request(MoveTemp(InRequest))
28 { }
29
31 FQueueEntry* Next = nullptr;
32 };
33
36
37public:
40
41 // IIoChunkBlockDecoder
42 virtual void Enqueue(FIoChunkBlockDecodeRequest&& DecodeRequest) override;
43
44 void Initialize(uint32 MaxWorkerCount, uint32 MaxConsecutiveDecodeJobs, UE::Tasks::ETaskPriority TaskPriority);
48
49private:
50 void LaunchDecodeTask(FDecodeContext& Ctx, FIoChunkBlockDecodeRequest&& DecodeRequest);
52
53
54 TArray<FDecodeContext> DecodeContexts;
55 FDecodeContext* NextFreeContext = nullptr;
56 FQueueEntryAllocator QueueEntryAllocator;
57 FQueue QueueEntries;
58 uint32 MaxWorkerCount = 0;
59 uint32 MaxConsecutiveDecodeJobs = 0;
60 UE::FMutex Mutex;
61 UE::Tasks::ETaskPriority TaskPriority = UE::Tasks::ETaskPriority::BackgroundNormal;
62};
63
64} // namespace UE
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition IoChunkEncoding.h:150
Definition Array.h:670
Definition IoDispatcherChunkDecoder.h:16
bool TryRetractAndExecuteDecodeTasks()
Definition IoDispatcherChunkDecoder.cpp:56
bool TryExecuteDecodeRequest()
Definition IoDispatcherChunkDecoder.cpp:83
virtual ~FIoDispatcherChunkBlockDecoder()=default
virtual void Enqueue(FIoChunkBlockDecodeRequest &&DecodeRequest) override
Definition IoDispatcherChunkDecoder.cpp:12
void TryDequeueAndLaunchDecodeTasks()
Definition IoDispatcherChunkDecoder.cpp:129
Definition Mutex.h:18
Definition AdvancedWidgetsModule.cpp:13
Definition IoChunkEncoding.h:139
Definition IoContainers.h:52