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