LeviLamina
Loading...
Searching...
No Matches
TaskGroup.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/threading/Async.h"
8#include "mc/deps/core/threading/IBackgroundTaskOwner.h"
9#include "mc/deps/core/threading/SharedAsync.h"
10#include "mc/deps/core/threading/TaskGroupState.h"
11#include "mc/network/services/signaling/ISignalingServiceConfigProvider.h"
12#include "mc/platform/Copyable.h"
13#include "mc/platform/ErrorInfo.h"
14#include "mc/platform/Result.h"
15#include "mc/platform/brstd/move_only_function.h"
16#include "mc/platform/threading/UniqueLock.h"
17#include "mc/server/commands/edu/make_code_fileio/MakeCodeFileResult.h"
18#include "mc/world/level/FileArchiver.h"
19
20// auto generated forward declare list
21// clang-format off
23class Pack;
24class ResourcePack;
25class Scheduler;
26class TaskResult;
27class WorkerPool;
29struct AsyncJoinError;
33struct TaskStartInfo;
34namespace Bedrock::Http { class HeaderCollection; }
35namespace Bedrock::Http { class Request; }
36namespace Bedrock::Http { class Response; }
37namespace Bedrock::Http { struct Url; }
38namespace Bedrock::Services { struct AzureGetTokenHttpResponse; }
39namespace Bedrock::Services { struct EnvironmentQueryResponse; }
40namespace Bedrock::Threading { class Mutex; }
41namespace Bedrock::Threading { struct CachedAsyncRetry; }
42namespace Json { class Value; }
43namespace MakeCodeFileIO { struct MakeCodeFileIOReadResult; }
44namespace PackCommand { struct PackCommandResult; }
45namespace RepositoryLoading { struct PackModifications; }
46// clang-format on
47
49public:
50 // member variables
51 // NOLINTBEGIN
64 // NOLINTEND
65
66public:
67 // prevent constructor by default
68 TaskGroup& operator=(TaskGroup const&);
69 TaskGroup(TaskGroup const&);
70 TaskGroup();
71
72public:
73 // virtual functions
74 // NOLINTBEGIN
75 // vIndex: 1
76 virtual ::Bedrock::Threading::Async<void> queue_DEPRECATED(
77 ::TaskStartInfo const& startInfo,
79 ::std::function<void()>&& callback
80 ) /*override*/;
81
82 // vIndex: 2
83 virtual ::Bedrock::Threading::Async<void> queueSync_DEPRECATED(
84 ::TaskStartInfo const& startInfo,
86 ) /*override*/;
87
88 // vIndex: 0
89 virtual ~TaskGroup() /*override*/;
90
91 // vIndex: 3
92 virtual void taskRegister(::std::shared_ptr<::BackgroundTaskBase> task) /*override*/;
93
94 // vIndex: 4
95 virtual void requeueTask(::std::shared_ptr<::BackgroundTaskBase> task, bool queueImmediate) /*override*/;
96
97 // vIndex: 5
98 virtual ::TaskGroupState getState() const /*override*/;
99
100 // vIndex: 6
101 virtual void processCoroutines() /*override*/;
102
103 // vIndex: 7
104 virtual void taskComplete(::gsl::not_null<::BackgroundTaskBase*> task) /*override*/;
105
106 // vIndex: 8
107 virtual bool _workerPoolIsAsync() const;
108 // NOLINTEND
109
110public:
111 // member functions
112 // NOLINTBEGIN
113 MCNAPI TaskGroup(::WorkerPool& workers, ::Scheduler& context, ::std::string name);
114
115 MCNAPI void _doWorkUntil(::Bedrock::Threading::SharedAsync<void> task, ::std::promise<void>* workStarted);
116
117 MCNAPI void _forAllTasks(
119 ::std::function<void(::std::shared_ptr<::BackgroundTaskBase> const&)> callback
120 );
121
122 MCNAPI void _queueInternal(::std::shared_ptr<::BackgroundTaskBase> bgtask);
123
124 MCNAPI void flush(::std::function<void()> waitFn);
125
126 MCNAPI bool isEmpty() const;
127
128 MCNAPI void sync_DEPRECATED_ASK_TOMMO(::std::function<void()> waitFn);
129 // NOLINTEND
130
131public:
132 // static functions
133 // NOLINTBEGIN
134 MCNAPI static ::IBackgroundTaskOwner* getCurrentTaskGroup();
135 // NOLINTEND
136
137public:
138 // constructor thunks
139 // NOLINTBEGIN
140 MCNAPI void* $ctor(::WorkerPool& workers, ::Scheduler& context, ::std::string name);
141 // NOLINTEND
142
143public:
144 // destructor thunk
145 // NOLINTBEGIN
146 MCNAPI void $dtor();
147 // NOLINTEND
148
149public:
150 // virtual function thunks
151 // NOLINTBEGIN
152 MCNAPI ::Bedrock::Threading::Async<void> $queue_DEPRECATED(
153 ::TaskStartInfo const& startInfo,
155 ::std::function<void()>&& callback
156 );
157
158 MCNAPI ::Bedrock::Threading::Async<void>
160
161 MCNAPI void $taskRegister(::std::shared_ptr<::BackgroundTaskBase> task);
162
163 MCNAPI void $requeueTask(::std::shared_ptr<::BackgroundTaskBase> task, bool queueImmediate);
164
165 MCNAPI ::TaskGroupState $getState() const;
166
167 MCNAPI void $processCoroutines();
168
169 MCNAPI void $taskComplete(::gsl::not_null<::BackgroundTaskBase*> task);
170
171 MCNAPI bool $_workerPoolIsAsync() const;
172 // NOLINTEND
173
174public:
175 // vftables
176 // NOLINTBEGIN
177 MCNAPI static void** $vftable();
178 // NOLINTEND
179};
Definition BackgroundTaskBase.h:13
Definition SharedAsync.h:8
Definition UniqueLock.h:8
Definition IBackgroundTaskOwner.h:17
Definition Pack.h:27
Definition ResourcePack.h:18
Definition Scheduler.h:13
Definition TaskGroup.h:48
MCAPI void _queueInternal(::std::shared_ptr<::BackgroundTaskBase > bgtask)
MCAPI void sync_DEPRECATED_ASK_TOMMO(::std::function< void()> waitFn)
MCAPI ::Bedrock::Threading::Async< void > $queueSync_DEPRECATED(::TaskStartInfo const &startInfo, ::brstd::move_only_function<::TaskResult()> &&task)
static MCAPI void ** $vftable()
MCAPI void $taskRegister(::std::shared_ptr<::BackgroundTaskBase > task)
MCAPI void $taskComplete(::gsl::not_null<::BackgroundTaskBase * > task)
static MCAPI ::IBackgroundTaskOwner * getCurrentTaskGroup()
MCAPI::TaskGroupState $getState() const
MCAPI void _doWorkUntil(::Bedrock::Threading::SharedAsync< void > task, ::std::promise< void > *workStarted)
MCAPI bool isEmpty() const
MCAPI void _forAllTasks(::Bedrock::Threading::UniqueLock<::Bedrock::Threading::Mutex > &lock, ::std::function< void(::std::shared_ptr<::BackgroundTaskBase > const &)> callback)
MCAPI void $requeueTask(::std::shared_ptr<::BackgroundTaskBase > task, bool queueImmediate)
MCAPI void flush(::std::function< void()> waitFn)
MCAPI TaskGroup(::WorkerPool &workers, ::Scheduler &context, ::std::string name)
MCAPI ::Bedrock::Threading::Async< void > $queue_DEPRECATED(::TaskStartInfo const &startInfo, ::brstd::move_only_function<::TaskResult()> &&task, ::std::function< void()> &&callback)
MCAPI void $dtor()
MCAPI void $processCoroutines()
MCAPI void * $ctor(::WorkerPool &workers, ::Scheduler &context, ::std::string name)
MCAPI bool $_workerPoolIsAsync() const
Definition TaskResult.h:5
Definition WorkerPool.h:19
Definition WorldPacksHistoryFile.h:10
Definition move_only_function.h:9
Definition AsyncJoinError.h:5
Definition MinecraftServiceKeyInfo.h:5
Definition MinecraftServiceKeysMetadata.h:5
Definition PackSourceLoadResult.h:5
Definition TaskStartInfo.h:5
Definition context.h:5
Definition Alias.h:14