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 // NOLINTEND
84
85 public:
86 // constructor thunks
87 // NOLINTBEGIN
88#ifdef LL_PLAT_C
89 MCNAPI void* $ctor(
90 ::std::string_view groupName,
92 ::ResourceLoadType loadType,
93 ::std::vector<::ResourceLoadType> dependencies,
94 ::Scheduler& scheduler,
95 ::WorkerPool& workerPool
96 );
97#endif
98 // NOLINTEND
99 };
100
101public:
102 // member variables
103 // NOLINTBEGIN
110 // NOLINTEND
111
112public:
113 // prevent constructor by default
114 ResourceLoadManager& operator=(ResourceLoadManager const&);
115 ResourceLoadManager(ResourceLoadManager const&);
116 ResourceLoadManager();
117
118public:
119 // virtual functions
120 // NOLINTBEGIN
121#ifdef LL_PLAT_S
122 virtual ~ResourceLoadManager() /*override*/ = default;
123#else // LL_PLAT_C
124 virtual ~ResourceLoadManager() /*override*/;
125#endif
126
127 // NOLINTEND
128
129public:
130 // member functions
131 // NOLINTBEGIN
132#ifdef LL_PLAT_C
133 MCNAPI void _cancel();
134
135 MCNAPI void _initializeResourceLoadTaskGroups();
136#endif
137
138 MCNAPI void
139 _prepareTaskGroupToRunAgain(::gsl::not_null<::ResourceLoadManager::ResourceLoadTaskGroup*> resourceLoadTaskGroup);
140
141#ifdef LL_PLAT_C
142 MCNAPI bool isComplete() const;
143
144 MCNAPI bool isComplete(::ResourceLoadType resourceLoadType) const;
145
146 MCNAPI void printRunningTasks();
147#endif
148
149 MCNAPI ::Bedrock::Threading::Async<void> queue(
150 ::ResourceLoadType resourceLoadType,
151 ::brstd::move_only_function<::TaskResult()> threadedCallback,
152 ::std::function<void()> mainThreadCallback,
153 uint taskPriority
154 );
155
156#ifdef LL_PLAT_C
157 MCNAPI ::Bedrock::Threading::Async<void> queueAsync(
158 ::ResourceLoadType resourceLoadType,
160 uint taskPriority
161 );
162
163 MCNAPI ::Bedrock::Threading::Async<void> queueSync(
164 ::ResourceLoadType resourceLoadType,
166 uint taskPriority
167 );
168
169 MCNAPI void registerResourceLoadTaskGroup(
170 ::std::string_view groupName,
172 ::ResourceLoadType resourceLoadType,
173 ::std::vector<::ResourceLoadType> dependencies
174 );
175#endif
176
177 MCNAPI bool softCancel(::ResourceLoadType resourceLoadType);
178
179#ifdef LL_PLAT_C
180 MCNAPI void sync(::ResourceLoadType resourceLoadType);
181
182 MCNAPI void update();
183#endif
184 // NOLINTEND
185
186public:
187 // static functions
188 // NOLINTBEGIN
189 MCNAPI static ::std::function<void()> _wrapMainThreadCallback(
191 ::std::function<void()>&& mainThreadCallback
192 );
193
194 MCNAPI static ::brstd::move_only_function<::TaskResult()> _wrapTaskCallback(
196 ::brstd::move_only_function<::TaskResult()>&& threadedCallback
197 );
198
199 MCNAPI static void queueChild(
200 ::brstd::move_only_function<::TaskResult()> threadedCallback,
201 ::std::function<void()> mainThreadCallback,
202 uint taskPriority
203 );
204 // NOLINTEND
205
206public:
207 // destructor thunk
208 // NOLINTBEGIN
209 MCNAPI void $dtor();
210 // NOLINTEND
211
212public:
213 // vftables
214 // NOLINTBEGIN
215 MCNAPI static void** $vftable();
216 // NOLINTEND
217};
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)
MCAPI void _prepareTaskGroupToRunAgain(::gsl::not_null<::ResourceLoadManager::ResourceLoadTaskGroup * > resourceLoadTaskGroup)
static MCAPI ::std::function< void()> _wrapMainThreadCallback(::ResourceLoadManager::ResourceLoadTaskGroup &resourceLoadTaskGroup, ::std::function< void()> &&mainThreadCallback)
MCAPI void $dtor()
static MCAPI ::brstd::move_only_function<::TaskResult()> _wrapTaskCallback(::ResourceLoadManager::ResourceLoadTaskGroup &resourceLoadTaskGroup, ::brstd::move_only_function<::TaskResult()> &&threadedCallback)
MCAPI ::Bedrock::Threading::Async< void > queue(::ResourceLoadType resourceLoadType, ::brstd::move_only_function<::TaskResult()> threadedCallback, ::std::function< void()> mainThreadCallback, uint taskPriority)
Definition Scheduler.h:14
Definition TaskResult.h:5
Definition WorkerPool.h:19
Definition move_only_function.h:9
Definition PredeclaredAnnotation.h:7
Definition ResourceLoadManager.h:29
Definition Alias.h:14