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;
16// clang-format on
17
18class ResourceLoadManager : public ::Bedrock::EnableNonOwnerReferences {
19public:
20 // ResourceLoadManager inner types declare
21 // clang-format off
22 struct LoadOrder;
23 class TaskGroupState;
25 // clang-format on
26
27 // ResourceLoadManager inner types define
28 struct LoadOrder {};
29
30 class TaskGroupState {
31 public:
32 // member variables
33 // NOLINTBEGIN
36 // NOLINTEND
37
38 public:
39 // prevent constructor by default
40 TaskGroupState& operator=(TaskGroupState const&);
41 TaskGroupState(TaskGroupState const&);
42 TaskGroupState();
43 };
44
45 class ResourceLoadTaskGroup {
46 public:
47 // member variables
48 // NOLINTBEGIN
55 // NOLINTEND
56
57 public:
58 // prevent constructor by default
59 ResourceLoadTaskGroup& operator=(ResourceLoadTaskGroup const&);
60 ResourceLoadTaskGroup(ResourceLoadTaskGroup const&);
61 ResourceLoadTaskGroup();
62
63 public:
64 // member functions
65 // NOLINTBEGIN
66 MCNAPI ::Bedrock::Threading::Async<void> queue(
67 ::brstd::move_only_function<::TaskResult()> threadedCallback,
68 ::std::function<void()> mainThreadCallback,
69 uint taskPriority
70 );
71 // NOLINTEND
72
73 public:
74 // constructor thunks
75 // NOLINTBEGIN
76 MCNAPI_C void* $ctor(
77 ::std::string_view groupName,
78 ::ResourceLoadType loadType,
79 ::std::vector<::ResourceLoadType> dependencies,
80 ::Scheduler& scheduler,
81 ::WorkerPool& workerPool
82 );
83 // NOLINTEND
84 };
85
86public:
87 // member variables
88 // NOLINTBEGIN
95 // NOLINTEND
96
97public:
98 // prevent constructor by default
99 ResourceLoadManager& operator=(ResourceLoadManager const&);
100 ResourceLoadManager(ResourceLoadManager const&);
101 ResourceLoadManager();
102
103public:
104 // virtual functions
105 // NOLINTBEGIN
106#ifdef LL_PLAT_S
107 virtual ~ResourceLoadManager() /*override*/ = default;
108#else // LL_PLAT_C
109 virtual ~ResourceLoadManager() /*override*/;
110#endif
111
112 // NOLINTEND
113
114public:
115 // member functions
116 // NOLINTBEGIN
117 MCNAPI_C void _cancel();
118
119 MCNAPI_C void _initializeResourceLoadTaskGroups();
120
121 MCNAPI void
122 _prepareTaskGroupToRunAgain(::gsl::not_null<::ResourceLoadManager::ResourceLoadTaskGroup*> resourceLoadTaskGroup);
123
124 MCNAPI_C bool isComplete() const;
125
126 MCNAPI_C bool isComplete(::ResourceLoadType resourceLoadType) const;
127
128 MCNAPI_C void printRunningTasks();
129
130 MCNAPI ::Bedrock::Threading::Async<void> queue(
131 ::ResourceLoadType resourceLoadType,
132 ::brstd::move_only_function<::TaskResult()> threadedCallback,
133 ::std::function<void()> mainThreadCallback,
134 uint taskPriority
135 );
136
137 MCNAPI_C ::Bedrock::Threading::Async<void> queueAsync(
138 ::ResourceLoadType resourceLoadType,
140 uint taskPriority
141 );
142
143 MCNAPI_C ::Bedrock::Threading::Async<void> queueSync(
144 ::ResourceLoadType resourceLoadType,
146 uint taskPriority
147 );
148
149 MCNAPI_C void registerResourceLoadTaskGroup(
150 ::std::string_view groupName,
151 ::ResourceLoadType resourceLoadType,
152 ::std::vector<::ResourceLoadType> dependencies
153 );
154
155 MCNAPI bool softCancel(::ResourceLoadType resourceLoadType);
156
157 MCNAPI_C void sync(::ResourceLoadType resourceLoadType);
158
159 MCNAPI_C void update();
160 // NOLINTEND
161
162public:
163 // static functions
164 // NOLINTBEGIN
165 MCNAPI static ::std::function<void()> _wrapMainThreadCallback(
167 ::std::function<void()>&& mainThreadCallback
168 );
169
170 MCNAPI static ::brstd::move_only_function<::TaskResult()> _wrapTaskCallback(
172 ::brstd::move_only_function<::TaskResult()>&& threadedCallback
173 );
174
175 MCNAPI static void queueChild(
176 ::brstd::move_only_function<::TaskResult()> threadedCallback,
177 ::std::function<void()> mainThreadCallback,
178 uint taskPriority
179 );
180 // NOLINTEND
181
182public:
183 // destructor thunk
184 // NOLINTBEGIN
185 MCNAPI void $dtor();
186 // NOLINTEND
187
188public:
189 // vftables
190 // NOLINTBEGIN
191 MCNAPI static void** $vftable();
192 // NOLINTEND
193};
Definition EnableNonOwnerReferences.h:7
Definition ResourceLoadManager.h:45
MCAPI ::Bedrock::Threading::Async< void > queue(::brstd::move_only_function<::TaskResult()> threadedCallback, ::std::function< void()> mainThreadCallback, uint taskPriority)
Definition ResourceLoadManager.h:30
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 ResourceLoadManager.h:28
Definition Alias.h:14