LeviLamina
Loading...
Searching...
No Matches
ResourceLoadManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/threading/Async.h"
7#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
8#include "mc/platform/brstd/move_only_function.h"
9#include "mc/resources/ResourceLoadType.h"
10
11// auto generated forward declare list
12// clang-format off
13class Scheduler;
14class TaskResult;
15class WorkerPool;
16namespace Bedrock::Profiler::details { struct PredeclaredAnnotation; }
17// clang-format on
18
19class ResourceLoadManager : public ::Bedrock::EnableNonOwnerReferences {
20public:
21 // ResourceLoadManager inner types declare
22 // clang-format off
23 struct LoadOrder;
24 class TaskGroupState;
26 // clang-format on
27
28 // ResourceLoadManager inner types define
29 struct LoadOrder {};
30
31 class TaskGroupState {
32 public:
33 // member variables
34 // NOLINTBEGIN
37 // NOLINTEND
38
39 public:
40 // prevent constructor by default
41 TaskGroupState& operator=(TaskGroupState const&);
42 TaskGroupState(TaskGroupState const&);
43 TaskGroupState();
44 };
45
46 class ResourceLoadTaskGroup {
47 public:
48 // member variables
49 // NOLINTBEGIN
56 // NOLINTEND
57
58 public:
59 // prevent constructor by default
60 ResourceLoadTaskGroup& operator=(ResourceLoadTaskGroup const&);
61 ResourceLoadTaskGroup(ResourceLoadTaskGroup const&);
62 ResourceLoadTaskGroup();
63
64 public:
65 // member functions
66 // NOLINTBEGIN
67#ifdef LL_PLAT_C
68 MCNAPI ResourceLoadTaskGroup(
69 ::std::string_view groupName,
71 ::ResourceLoadType loadType,
72 ::std::vector<::ResourceLoadType> dependencies,
73 ::Scheduler& scheduler,
74 ::WorkerPool& workerPool
75 );
76#endif
77
78 MCNAPI ::Bedrock::Threading::Async<void> queue(
79 ::brstd::move_only_function<::TaskResult()> threadedCallback,
80 ::std::function<void()> mainThreadCallback,
81 uint taskPriority
82 );
83
84#ifdef LL_PLAT_C
85 MCNAPI ::Bedrock::Threading::Async<void>
86 queueAsync(::brstd::move_only_function<::TaskResult()> callback, uint taskPriority);
87
88 MCNAPI ::Bedrock::Threading::Async<void>
89 queueSync(::brstd::move_only_function<::TaskResult()> callback, uint taskPriority);
90
91 MCNAPI ~ResourceLoadTaskGroup();
92#endif
93 // NOLINTEND
94
95 public:
96 // constructor thunks
97 // NOLINTBEGIN
98#ifdef LL_PLAT_C
99 MCNAPI void* $ctor(
100 ::std::string_view groupName,
102 ::ResourceLoadType loadType,
103 ::std::vector<::ResourceLoadType> dependencies,
104 ::Scheduler& scheduler,
105 ::WorkerPool& workerPool
106 );
107#endif
108 // NOLINTEND
109
110 public:
111 // destructor thunk
112 // NOLINTBEGIN
113#ifdef LL_PLAT_C
114 MCNAPI void $dtor();
115#endif
116 // NOLINTEND
117 };
118
119public:
120 // member variables
121 // NOLINTBEGIN
128 // NOLINTEND
129
130#ifdef LL_PLAT_S
131public:
132 // prevent constructor by default
133 ResourceLoadManager& operator=(ResourceLoadManager const&);
134 ResourceLoadManager(ResourceLoadManager const&);
135 ResourceLoadManager();
136
137#else // LL_PLAT_C
138public:
139 // prevent constructor by default
140 ResourceLoadManager& operator=(ResourceLoadManager const&);
141 ResourceLoadManager(ResourceLoadManager const&);
142
143#endif
144public:
145 // virtual functions
146 // NOLINTBEGIN
147#ifdef LL_PLAT_S
148 virtual ~ResourceLoadManager() /*override*/ = default;
149#else // LL_PLAT_C
150 virtual ~ResourceLoadManager() /*override*/;
151#endif
152
153 // NOLINTEND
154
155public:
156 // member functions
157 // NOLINTBEGIN
158#ifdef LL_PLAT_C
159 MCNAPI ResourceLoadManager();
160
161 MCNAPI void _initializeResourceLoadTaskGroups();
162
163 MCNAPI bool areDependenciesLoaded(::ResourceLoadType resourceLoadType) const;
164
165 MCNAPI void hardCancel();
166
167 MCNAPI bool isComplete() const;
168
169 MCNAPI bool isComplete(::ResourceLoadType resourceLoadType) const;
170
171 MCNAPI bool isSuspended();
172
173 MCNAPI void printRunningTasks();
174#endif
175
176 MCNAPI ::Bedrock::Threading::Async<void> queue(
177 ::ResourceLoadType resourceLoadType,
178 ::brstd::move_only_function<::TaskResult()> threadedCallback,
179 ::std::function<void()> mainThreadCallback,
180 uint taskPriority
181 );
182
183#ifdef LL_PLAT_C
184 MCNAPI ::Bedrock::Threading::Async<void> queueAsync(
185 ::ResourceLoadType resourceLoadType,
187 uint taskPriority
188 );
189
190 MCNAPI ::Bedrock::Threading::Async<void> queueSync(
191 ::ResourceLoadType resourceLoadType,
193 uint taskPriority
194 );
195
196 MCNAPI void registerResourceLoadTaskGroup(
197 ::std::string_view groupName,
199 ::ResourceLoadType resourceLoadType,
200 ::std::vector<::ResourceLoadType> dependencies
201 );
202
203 MCNAPI void setAppSuspended(bool suspended);
204
205 MCNAPI void setCannotBeCanceled();
206
207 MCNAPI bool softCancel();
208#endif
209
210 MCNAPI bool softCancel(::ResourceLoadType resourceLoadType);
211
212#ifdef LL_PLAT_C
213 MCNAPI void sync(::ResourceLoadType resourceLoadType);
214
215 MCNAPI void update();
216#endif
217 // NOLINTEND
218
219public:
220 // static functions
221 // NOLINTBEGIN
222 MCNAPI static ::std::function<void()> _wrapMainThreadCallback(
224 ::std::function<void()>&& mainThreadCallback
225 );
226
227 MCNAPI static void queueChild(
228 ::brstd::move_only_function<::TaskResult()> threadedCallback,
229 ::std::function<void()> mainThreadCallback,
230 uint taskPriority
231 );
232 // NOLINTEND
233
234public:
235 // constructor thunks
236 // NOLINTBEGIN
237#ifdef LL_PLAT_C
238 MCNAPI void* $ctor();
239#endif
240 // NOLINTEND
241
242public:
243 // destructor thunk
244 // NOLINTBEGIN
245 MCNAPI void $dtor();
246 // NOLINTEND
247
248public:
249 // vftables
250 // NOLINTBEGIN
251 MCNAPI static void** $vftable();
252 // NOLINTEND
253};
Definition EnableNonOwnerReferences.h:7
Definition ResourceLoadManager.h:46
MCAPI ::Bedrock::Threading::Async< void > queue(::brstd::move_only_function<::TaskResult()> threadedCallback, ::std::function< void()> mainThreadCallback, uint taskPriority)
Definition ResourceLoadManager.h:31
MCAPI bool softCancel(::ResourceLoadType resourceLoadType)
static MCAPI void ** $vftable()
static MCAPI void queueChild(::brstd::move_only_function<::TaskResult()> threadedCallback, ::std::function< void()> mainThreadCallback, uint taskPriority)
static MCAPI ::std::function< void()> _wrapMainThreadCallback(::ResourceLoadManager::ResourceLoadTaskGroup &resourceLoadTaskGroup, ::std::function< void()> &&mainThreadCallback)
MCAPI void $dtor()
MCAPI ::Bedrock::Threading::Async< void > queue(::ResourceLoadType resourceLoadType, ::brstd::move_only_function<::TaskResult()> threadedCallback, ::std::function< void()> mainThreadCallback, uint taskPriority)
Definition Scheduler.h:15
Definition TaskResult.h:5
Definition WorkerPool.h:20
Definition move_only_function.h:9
Definition PredeclaredAnnotation.h:7
Definition ResourceLoadManager.h:29
Definition Alias.h:14