UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InstallBundleManagerReporting.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6
8
10{
11 // State that represents an updatable bundle, where a choice can be made to update in the background,
12 // or without.
14 {
15 // The total amount of bytes to download for the bundle
17
19 JSON_SERIALIZE("DownloadSize", reinterpret_cast<int64&>(DownloadSize));
21 };
22
23 // State that represents a bundle that is updating
25 {
26 // The total amount of bytes that needs to be downloaded for the bundle
28
29 // Indicates if this bundle is being updated with background downloads or not
31
32 // Indicates, in a value 0 <= x <= 1 the progress of the downloads. If this value reaches 1, the bundle
33 // can be assumed to be installed.
35
36 // Indicates how many bytes were downloaded in the background
38
40 JSON_SERIALIZE("DownloadSize", reinterpret_cast<int64&>(DownloadSize));
41 JSON_SERIALIZE("bUsesBackgroundDownloads", bUsesBackgroundDownloads);
42 JSON_SERIALIZE("DownloadProgress", DownloadProgress);
43 JSON_SERIALIZE("BackgroundDownloadedBytes", reinterpret_cast<int64&>(BackgroundDownloadedBytes));
45 };
46
48 {
49 // The total amount of bytes that have been downloaded for the bundle
51
52 // The progress of the installation, if available, otherwise probably always 0; once the bundle switches to
53 // updated state, the InstallProgress is essentially 1
54 float InstallProgress = 0;
55
57 JSON_SERIALIZE("DownloadedSize", reinterpret_cast<int64&>(DownloadedSize));
58 JSON_SERIALIZE("InstallProgress", InstallProgress);
60 };
61
62 // State that represents a fully updated bundle that no longer needs to be updated
64 {
65 // The total amount of bytes that have been downloaded for the bundle
67
69 JSON_SERIALIZE("DownloadedSize", reinterpret_cast<int64&>(DownloadedSize));
71 };
72
74
75 // The name of the bundle
77
78 // A string specifying what content version is being upgraded FROM. The format of this string is specific for the source.
79 // NOTE: if there is no known source version, this value should not be set.
81
82 // The state of the bundle
84
95
96 // Returns the total amount of bytes that will or has been downloaded for this bundle.
98
99 // Returns the amount of downloaded bytes for this bundle, should always be 0 <= x <= TotalDownloadSize()
101
102 // Returns a value 0 <= x <= 1 to indicate the installation progress.
103 // If the source doesn't support gradual installation progress, this will pop from 0 to 1.
105
106 // Adds missing bytes to content size and download progress
108
109 bool IsUnknown() const { return !State.IsSet(); }
110 bool IsUpdatable() const { return State.IsSet() && State->IsType<FStateUpdatable>(); }
111 bool IsUpdating() const { return State.IsSet() && State->IsType<FStateUpdating>(); }
112 bool IsInstalling() const { return State.IsSet() && State->IsType<FStateInstalling>(); }
113 bool IsUpdated() const { return State.IsSet() && State->IsType<FStateUpdated>(); }
114};
115
117{
118 // The bundle source's type string
120
121 // A string specifying what content version is being upgrade TO. The format of this string is specific for the source.
122 // NOTE: if there is no known target version, this value should not be set.
124
125 // Array containing a single bundle report for every bundle this source is handling.
127
133
134 // Returns pointer to bundle report that's valid as long as Bundles is not modified.
135 // Returns nullptr if there is no report yet for the given type.
137
138 // Returns a reference to the bundle source report for the given type. It adds one if it doesn't exist yet.
139 // The reference is valid as long as SourceReports is not modified.
141
142 // Returns the total amount of bytes that will or has been downloaded for this bundle source for all bundles
144
145 // Returns the amount of downloaded bytes for this bundle source for all bundles, should always be 0 <= x <= TotalDownloadSize()
147
148 // Returns the total amount of bundles being updated, regardless of their state
150
151 // Returns the amount of bundles that has being updated
153};
154
156{
158 {
159 Unknown, // if there are no bundle sources, or no bundles, or if at least one bundle is set to unknown
160 Updatable, // if none of the above, if all bundles are set to updatable
161 Updating, // if none of the above, if at least one bundle is still updating
162 Finishing, // if none of the above, if at least one bundle is still installing
163 Finished, // if none of the above, all bundles have been updated
164 };
165
166 // the context name for this bundle report
168
169 // Semi-unique session string, changes every time any bundle source decides to start updating to a new version; generated using UUID
170 FString SessionId;
171
172 // Indicates, if set, how many times the application was backgrounded during the update process for this bundle.
173 // If not set, the bundle source does not keep track of this.
175
176 // Indicates how many times this report has been loaded from disk; in other words, indicates how many times the update process was restarted.
178
179 // Array containing a single source report for every unique source bundle the manager knows.
181
189
190 // Returns pointer to bundle source report that's valid as long as SourceReports is not modified.
191 // Returns nullptr if there is no report yet for the given type.
193
194 // Returns a reference to the bundle source report for the given type. It adds one if it doesn't exist yet.
195 // The reference is valid as long as SourceReports is not modified.
197
198 // Returns the download progress.
199 // This returns a value 0 <= x <= 1.
201
202 // Returns the overall installation progress, which is separate from the download progress
203 // This returns a value 0 <= x <= 1.
205
206 // Returns the total amount of bytes that will or has been downloaded.
208
209 // Returns the amount of downloaded bytes, should always be 0 <= x <= TotalDownloadSize()
211
212 // Returns the total amount of bundles being updated, regardless of their state
214
215 // Returns the amount of bundles that has being updated
217
218 // Returns a progress string
220
221 // Returns a longer progress string with more information
223
224 // Returns a combined status of all bundles
226
227 // Returns the lowest current versions of any bundle. If any bundle has no such version (in other words, nothing is installed),
228 // or if there are no bundles, this returns an empty optional.
230
231 // Returns the highest current versions of any bundle. If not a single bundle has a version set, this returns an empty optional.
233};
234
236
238{
239public:
241
242 // Attempts to load the cached bundle report from disk; calls the delegate when it's done loading.
244
245 // Returns the current report as cached on disk (or last Set)
246 const FInstallManagerBundleReport& GetReport() const { return Report; }
247
248 // Sets the new report, both in memory, as well as flushing it to disk on a separate thread automatically.
250
251private:
254 FString ReportFilename;
255};
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
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 DECLARE_DELEGATE(DelegateName)
Definition DelegateCombinations.h:20
#define BEGIN_JSON_SERIALIZER
Definition JsonSerializerMacros.h:21
#define END_JSON_SERIALIZER
Definition JsonSerializerMacros.h:26
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition InstallBundleTypes.h:47
Definition InstallBundleManagerReporting.h:238
const FInstallManagerBundleReport & GetReport() const
Definition InstallBundleManagerReporting.h:246
INSTALLBUNDLEMANAGER_API void SetReport(FInstallManagerBundleReport NewReport)
Definition InstallBundleManagerReporting.cpp:431
Definition NameTypes.h:617
Definition InstallBundleSourceInterface.h:30
Definition Array.h:670
Definition UniquePtr.h:107
Definition TVariant.h:48
Definition InstallBundleManagerReporting.h:48
BEGIN_JSON_SERIALIZER JSON_SERIALIZE("DownloadedSize", reinterpret_cast< int64 & >(DownloadedSize))
float InstallProgress
Definition InstallBundleManagerReporting.h:54
JSON_SERIALIZE("InstallProgress", InstallProgress)
uint64 DownloadedSize
Definition InstallBundleManagerReporting.h:50
Definition InstallBundleManagerReporting.h:14
uint64 DownloadSize
Definition InstallBundleManagerReporting.h:16
BEGIN_JSON_SERIALIZER JSON_SERIALIZE("DownloadSize", reinterpret_cast< int64 & >(DownloadSize))
Definition InstallBundleManagerReporting.h:64
BEGIN_JSON_SERIALIZER JSON_SERIALIZE("DownloadedSize", reinterpret_cast< int64 & >(DownloadedSize))
uint64 DownloadedSize
Definition InstallBundleManagerReporting.h:66
Definition InstallBundleManagerReporting.h:25
uint64 DownloadSize
Definition InstallBundleManagerReporting.h:27
BEGIN_JSON_SERIALIZER JSON_SERIALIZE("DownloadSize", reinterpret_cast< int64 & >(DownloadSize))
JSON_SERIALIZE("bUsesBackgroundDownloads", bUsesBackgroundDownloads)
float DownloadProgress
Definition InstallBundleManagerReporting.h:34
JSON_SERIALIZE("BackgroundDownloadedBytes", reinterpret_cast< int64 & >(BackgroundDownloadedBytes))
bool bUsesBackgroundDownloads
Definition InstallBundleManagerReporting.h:30
uint64 BackgroundDownloadedBytes
Definition InstallBundleManagerReporting.h:37
JSON_SERIALIZE("DownloadProgress", DownloadProgress)
Definition InstallBundleManagerReporting.h:10
JSON_SERIALIZE_VARIANT_IFTYPE_SERIALIZABLE("StateUpdated", FStateUpdated)
bool IsUnknown() const
Definition InstallBundleManagerReporting.h:109
INSTALLBUNDLEMANAGER_API float InstallationProgress() const
Definition InstallBundleManagerReporting.cpp:57
JSON_SERIALIZE_OPTIONAL_VARIANT_BEGIN("State", State)
JSON_SERIALIZE_OPTIONAL("SourceVersion", SourceVersion)
bool IsInstalling() const
Definition InstallBundleManagerReporting.h:112
bool IsUpdated() const
Definition InstallBundleManagerReporting.h:113
TOptional< FState > State
Definition InstallBundleManagerReporting.h:83
FName BundleName
Definition InstallBundleManagerReporting.h:76
JSON_SERIALIZE_VARIANT_IFTYPE_SERIALIZABLE("StateUpdatable", FStateUpdatable)
bool IsUpdatable() const
Definition InstallBundleManagerReporting.h:110
JSON_SERIALIZE_VARIANT_IFTYPE_SERIALIZABLE("StateUpdating", FStateUpdating)
TOptional< FString > SourceVersion
Definition InstallBundleManagerReporting.h:80
bool IsUpdating() const
Definition InstallBundleManagerReporting.h:111
END_JSON_SERIALIZER INSTALLBUNDLEMANAGER_API uint64 TotalDownloadSize() const
Definition InstallBundleManagerReporting.cpp:9
JSON_SERIALIZE_VARIANT_IFTYPE_SERIALIZABLE("StateInstalling", FStateInstalling)
BEGIN_JSON_SERIALIZER JSON_SERIALIZE_NAME("Name", BundleName)
INSTALLBUNDLEMANAGER_API uint64 DownloadedBytes() const
Definition InstallBundleManagerReporting.cpp:35
INSTALLBUNDLEMANAGER_API void AddDiscrepancy(uint64 Bytes)
Definition InstallBundleManagerReporting.cpp:76
Definition InstallBundleManagerReporting.h:117
INSTALLBUNDLEMANAGER_API uint64 TotalDownloadSize() const
Definition InstallBundleManagerReporting.cpp:125
INSTALLBUNDLEMANAGER_API uint64 DownloadedBytes() const
Definition InstallBundleManagerReporting.cpp:135
JSON_SERIALIZE_OPTIONAL("TargetVersion", TargetVersion)
TOptional< FString > TargetVersion
Definition InstallBundleManagerReporting.h:123
BEGIN_JSON_SERIALIZER JSON_SERIALIZE_NAME("SourceType", SourceType)
INSTALLBUNDLEMANAGER_API FInstallBundleReport & FindOrAddBundleReport(FName BundleName)
Definition InstallBundleManagerReporting.cpp:113
FName SourceType
Definition InstallBundleManagerReporting.h:119
INSTALLBUNDLEMANAGER_API int TotalBundleCount() const
Definition InstallBundleManagerReporting.cpp:145
END_JSON_SERIALIZER INSTALLBUNDLEMANAGER_API FInstallBundleReport * TryFindBundleReport(FName BundleName)
Definition InstallBundleManagerReporting.cpp:106
INSTALLBUNDLEMANAGER_API int UpdatedBundleCount() const
Definition InstallBundleManagerReporting.cpp:150
TArray< FInstallBundleReport > Bundles
Definition InstallBundleManagerReporting.h:126
JSON_SERIALIZE_ARRAY_SERIALIZABLE("Bundles", Bundles, FInstallBundleReport)
Definition InstallBundleManagerReporting.h:156
BEGIN_JSON_SERIALIZER JSON_SERIALIZE_NAME("ContextName", ContextName)
FName ContextName
Definition InstallBundleManagerReporting.h:167
INSTALLBUNDLEMANAGER_API FInstallBundleSourceReport & FindOrAddBundleSourceReport(const FInstallBundleSourceType &Type)
Definition InstallBundleManagerReporting.cpp:170
uint32 LoadedCount
Definition InstallBundleManagerReporting.h:177
INSTALLBUNDLEMANAGER_API TOptional< FString > GetHighestCurrentBundleVersion() const
Definition InstallBundleManagerReporting.cpp:377
TArray< FInstallBundleSourceReport > SourceReports
Definition InstallBundleManagerReporting.h:180
INSTALLBUNDLEMANAGER_API float GetDownloadProgress() const
Definition InstallBundleManagerReporting.cpp:182
INSTALLBUNDLEMANAGER_API TOptional< FString > GetLowestCurrentBundleVersion() const
Definition InstallBundleManagerReporting.cpp:357
JSON_SERIALIZE("LoadedCount", LoadedCount)
INSTALLBUNDLEMANAGER_API ECombinedStatus GetCombinedStatus() const
Definition InstallBundleManagerReporting.cpp:297
TOptional< uint32 > BackgroundedCount
Definition InstallBundleManagerReporting.h:174
END_JSON_SERIALIZER INSTALLBUNDLEMANAGER_API FInstallBundleSourceReport * TryFindBundleSourceReport(const FInstallBundleSourceType &Type)
Definition InstallBundleManagerReporting.cpp:163
INSTALLBUNDLEMANAGER_API uint64 TotalDownloadSize() const
Definition InstallBundleManagerReporting.cpp:215
INSTALLBUNDLEMANAGER_API FString GetLongProgressString() const
Definition InstallBundleManagerReporting.cpp:272
JSON_SERIALIZE("SessionId", SessionId)
INSTALLBUNDLEMANAGER_API float GetInstallationProgress() const
Definition InstallBundleManagerReporting.cpp:194
JSON_SERIALIZE_ARRAY_SERIALIZABLE("SourceReports", SourceReports, FInstallBundleSourceReport)
INSTALLBUNDLEMANAGER_API uint64 DownloadedBytes() const
Definition InstallBundleManagerReporting.cpp:225
ECombinedStatus
Definition InstallBundleManagerReporting.h:158
FString SessionId
Definition InstallBundleManagerReporting.h:170
JSON_SERIALIZE_OPTIONAL("BackgroundedCount", BackgroundedCount)
INSTALLBUNDLEMANAGER_API int TotalBundleCount() const
Definition InstallBundleManagerReporting.cpp:235
INSTALLBUNDLEMANAGER_API int UpdatedBundleCount() const
Definition InstallBundleManagerReporting.cpp:245
INSTALLBUNDLEMANAGER_API FString GetProgressString() const
Definition InstallBundleManagerReporting.cpp:255
Definition JsonSerializable.h:17
Definition Optional.h:131