UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BuildPatchProgress.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 BuildPatchProgress.h: Declares classes involved with tracking the patch
5 progress information.
6=============================================================================*/
7
8#pragma once
9
10#include "CoreMinimal.h"
11#include "HAL/ThreadSafeBool.h"
13#include "BuildPatchState.h"
14
15namespace BuildPatchServices
16{
21 : public IControllable
22 {
23 public:
24
29
30 // IControllable interface begin.
31 virtual void SetPaused(bool bIsPaused) override;
32 virtual void Abort() override;
33 // IControllable interface end.
34
40 virtual void SetStateProgress(const EBuildPatchState& State, const float& Value);
41
47 virtual void SetStateWeight(const EBuildPatchState& State, const float& Value);
48
53 virtual EBuildPatchState GetState() const;
54
59 virtual float GetProgress() const;
60
65 virtual float GetProgressNoMarquee() const;
66
72 virtual float GetStateProgress(const EBuildPatchState& State) const;
73
79 virtual float GetStateWeight(const EBuildPatchState& State) const;
80
85 virtual bool TogglePauseState();
86
91 virtual double WaitWhilePaused() const;
92
97 virtual bool GetPauseState() const;
98
103 virtual void SetIsDownloading(bool bIsDownloading);
104
108 virtual void CancelAbort();
109
110 private:
111
115 void UpdateProgressInfo();
116
120 void UpdateCachedValues();
121
122 private:
123
124 // Defines whether each state displays progress percent or is designed for a "please wait" or marquee style progress bar
125 // This is predefined and constant.
126 static const bool bHasProgressValue[static_cast<int32>(EBuildPatchState::NUM_PROGRESS_STATES)];
127
128 // Defines whether each state should count towards the overall progress
129 // This is predefined and constant.
130 static const bool bCountsTowardsProgress[static_cast<int32>(EBuildPatchState::NUM_PROGRESS_STATES)];
131
132 // Holds the current percentage complete for each state, this will decide the "current" state, being the first that is not complete.
133 // Range 0 to 1.
134 float StateProgressValues[static_cast<int32>(EBuildPatchState::NUM_PROGRESS_STATES)];
135
136 // Holds the weight that each stage has on overall progress.
137 // Range 0 to 1.
138 float StateProgressWeights[static_cast<int32>(EBuildPatchState::NUM_PROGRESS_STATES)];
139
140 // Cached total weight value for progress calculation
141 float TotalWeight;
142
143 // Externally set variable to say if the system is currently making download requests
144 bool bIsDownloading;
145
146 // The current state value for UI polling
147 EBuildPatchState CurrentState;
148
149 // The current progress value for UI polling
150 float CurrentProgress;
151
152 // Thread safe bool for whether the process should abort
153 FThreadSafeBool bShouldAbort;
154
155 // Critical section to protect variable access
156 mutable FCriticalSection ThreadLock;
157
158 };
159}
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
Definition Controllable.h:10
Definition ThreadSafeBool.h:17
Definition BuildPatchFileConstructor.h:28
Definition BuildPatchProgress.h:22
virtual bool GetPauseState() const
Definition BuildPatchProgress.cpp:128
virtual void Abort() override
Definition BuildPatchProgress.cpp:47
virtual void SetStateProgress(const EBuildPatchState &State, const float &Value)
Definition BuildPatchProgress.cpp:52
virtual void SetPaused(bool bIsPaused) override
Definition BuildPatchProgress.cpp:38
virtual double WaitWhilePaused() const
Definition BuildPatchProgress.cpp:134
FBuildPatchProgress()
Definition BuildPatchProgress.cpp:18
virtual float GetStateProgress(const EBuildPatchState &State) const
Definition BuildPatchProgress.cpp:97
virtual float GetProgress() const
Definition BuildPatchProgress.cpp:80
virtual float GetStateWeight(const EBuildPatchState &State) const
Definition BuildPatchProgress.cpp:103
virtual void SetStateWeight(const EBuildPatchState &State, const float &Value)
Definition BuildPatchProgress.cpp:63
virtual void SetIsDownloading(bool bIsDownloading)
Definition BuildPatchProgress.cpp:148
virtual void CancelAbort()
Definition BuildPatchProgress.cpp:158
virtual EBuildPatchState GetState() const
Definition BuildPatchProgress.cpp:74
virtual bool TogglePauseState()
Definition BuildPatchProgress.cpp:109
virtual float GetProgressNoMarquee() const
Definition BuildPatchProgress.cpp:91