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 TaskResult;
15namespace Bedrock::Profiler::details { struct PredeclaredAnnotation; }
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
72#ifdef LL_PLAT_C
73 MCNAPI ::Bedrock::Threading::Async<void>
74 queueAsync(::brstd::move_only_function<::TaskResult()> callback, uint taskPriority);
75
76 MCNAPI ::Bedrock::Threading::Async<void>
77 queueSync(::brstd::move_only_function<::TaskResult()> callback, uint taskPriority);
78#endif
79 // NOLINTEND
80 };
81
82public:
83 // member variables
84 // NOLINTBEGIN
93 // NOLINTEND
94
95public:
96 // prevent constructor by default
97 ResourceLoadManager& operator=(ResourceLoadManager const&);
98 ResourceLoadManager(ResourceLoadManager const&);
99 ResourceLoadManager();
100
101public:
102 // virtual functions
103 // NOLINTBEGIN
104 virtual ~ResourceLoadManager() /*override*/ = default;
105 // NOLINTEND
106
107public:
108 // member functions
109 // NOLINTBEGIN
111
112#ifdef LL_PLAT_C
113 MCNAPI bool areDependenciesLoaded(::ResourceLoadType resourceLoadType) const;
114#endif
115
116 MCNAPI bool isComplete() const;
117
118#ifdef LL_PLAT_C
119 MCNAPI bool isComplete(::ResourceLoadType resourceLoadType) const;
120
121 MCNAPI void printRunningTasks();
122#endif
123
124 MCNAPI ::Bedrock::Threading::Async<void> queue(
125 ::ResourceLoadType resourceLoadType,
126 ::brstd::move_only_function<::TaskResult()> threadedCallback,
127 ::std::function<void()> mainThreadCallback,
128 uint taskPriority
129 );
130
131#ifdef LL_PLAT_C
132 MCNAPI ::Bedrock::Threading::Async<void> queueAsync(
133 ::ResourceLoadType resourceLoadType,
135 uint taskPriority
136 );
137
138 MCNAPI ::Bedrock::Threading::Async<void> queueSync(
139 ::ResourceLoadType resourceLoadType,
141 uint taskPriority
142 );
143#endif
144
146 ::std::string_view groupName,
148 ::ResourceLoadType resourceLoadType,
149 ::std::vector<::ResourceLoadType> dependencies
150 );
151
152#ifdef LL_PLAT_C
153 MCNAPI void setAppSuspended(bool suspended);
154
155 MCNAPI void sync(::ResourceLoadType resourceLoadType);
156#endif
157
158 MCNAPI void update();
159 // NOLINTEND
160
161public:
162 // static functions
163 // NOLINTBEGIN
164 MCNAPI static ::std::function<void()> _wrapMainThreadCallback(
166 ::std::function<void()>&& mainThreadCallback
167 );
168
169 MCNAPI static void queueChild(
170 ::brstd::move_only_function<::TaskResult()> threadedCallback,
171 ::std::function<void()> mainThreadCallback,
172 uint taskPriority
173 );
174 // NOLINTEND
175
176public:
177 // constructor thunks
178 // NOLINTBEGIN
180 // NOLINTEND
181};
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 void update()
MCAPI bool isComplete() const
MCAPI void * $ctor(::ResourceLoadManagerOptions &&ops)
MCAPI ResourceLoadManager(::ResourceLoadManagerOptions &&ops)
static MCAPI void queueChild(::brstd::move_only_function<::TaskResult()> threadedCallback, ::std::function< void()> mainThreadCallback, uint taskPriority)
MCAPI void registerResourceLoadTaskGroup(::std::string_view groupName, ::Bedrock::Profiler::details::PredeclaredAnnotation &&annotation, ::ResourceLoadType resourceLoadType, ::std::vector<::ResourceLoadType > dependencies)
static MCAPI ::std::function< void()> _wrapMainThreadCallback(::ResourceLoadManager::ResourceLoadTaskGroup &resourceLoadTaskGroup, ::std::function< void()> &&mainThreadCallback)
MCAPI ::Bedrock::Threading::Async< void > queue(::ResourceLoadType resourceLoadType, ::brstd::move_only_function<::TaskResult()> threadedCallback, ::std::function< void()> mainThreadCallback, uint taskPriority)
Definition TaskResult.h:5
Definition move_only_function.h:9
Definition PredeclaredAnnotation.h:7
Definition ResourceLoadManagerOptions.h:5
Definition ResourceLoadManager.h:28
Definition Alias.h:14