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/threading/IAsyncResult.h"
7#include "mc/deps/core/threading/IBackgroundTaskOwner.h"
8#include "mc/deps/core/threading/TaskGroupState.h"
9#include "mc/deps/core/threading/TaskStartInfoEx.h"
10#include "mc/platform/brstd/move_only_function.h"
11#include "mc/platform/threading/UniqueLock.h"
12
13// auto generated forward declare list
14// clang-format off
16class Scheduler;
17class TaskResult;
18class WorkerPool;
19namespace Bedrock::Threading { class Mutex; }
20// clang-format on
21
23public:
24 // member variables
25 // NOLINTBEGIN
38 // NOLINTEND
39
40public:
41 // prevent constructor by default
42 TaskGroup& operator=(TaskGroup const&);
43 TaskGroup(TaskGroup const&);
44 TaskGroup();
45
46public:
47 // virtual functions
48 // NOLINTBEGIN
49 // vIndex: 0
50 virtual ~TaskGroup() /*override*/;
51
52 // vIndex: 1
53 virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>> queue(
54 ::TaskStartInfoEx<void> const& startInfo,
56 ::std::function<void()>&& callback
57 ) /*override*/;
58
59 // vIndex: 2
60 virtual ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>> queueSync(
61 ::TaskStartInfoEx<void> const& startInfo,
63 ) /*override*/;
64
65 // vIndex: 3
66 virtual void taskRegister(::std::shared_ptr<::BackgroundTaskBase> task) /*override*/;
67
68 // vIndex: 4
69 virtual void requeueTask(::std::shared_ptr<::BackgroundTaskBase> task, bool queueImmediate) /*override*/;
70
71 // vIndex: 5
72 virtual ::TaskGroupState getState() const /*override*/;
73
74 // vIndex: 6
75 virtual void processCoroutines() /*override*/;
76
77 // vIndex: 7
78 virtual void taskComplete(::gsl::not_null<::BackgroundTaskBase*> task) /*override*/;
79 // NOLINTEND
80
81public:
82 // member functions
83 // NOLINTBEGIN
84 MCAPI TaskGroup(::WorkerPool& workers, ::Scheduler& context, ::std::string name);
85
86 MCAPI void _forAllTasks(
88 ::std::function<void(::std::shared_ptr<::BackgroundTaskBase> const&)> callback
89 );
90
91 MCAPI void _queueInternal(::std::shared_ptr<::BackgroundTaskBase> bgtask);
92
93 MCAPI void flush(::std::function<void()> waitFn);
94
95 MCAPI bool isEmpty() const;
96
97 MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>> queue(
98 ::std::string_view name,
100 ::std::function<void()>&& callback
101 );
102
103 MCAPI void sync_DEPRECATED_ASK_TOMMO(::std::function<void()> waitFn);
104 // NOLINTEND
105
106public:
107 // static functions
108 // NOLINTBEGIN
109 MCAPI static ::IBackgroundTaskOwner* getCurrentTaskGroup();
110
111 MCAPI static ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>> queueChild_DEPRECATED(
112 ::TaskStartInfoEx<void> const& startInfo,
114 ::std::function<void()>&& callback
115 );
116 // NOLINTEND
117
118public:
119 // constructor thunks
120 // NOLINTBEGIN
121 MCAPI void* $ctor(::WorkerPool& workers, ::Scheduler& context, ::std::string name);
122 // NOLINTEND
123
124public:
125 // destructor thunk
126 // NOLINTBEGIN
127 MCAPI void $dtor();
128 // NOLINTEND
129
130public:
131 // virtual function thunks
132 // NOLINTBEGIN
133 MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>> $queue(
134 ::TaskStartInfoEx<void> const& startInfo,
136 ::std::function<void()>&& callback
137 );
138
139 MCAPI ::std::shared_ptr<::Bedrock::Threading::IAsyncResult<void>>
140 $queueSync(::TaskStartInfoEx<void> const& startInfo, ::brstd::move_only_function<::TaskResult()>&& task);
141
142 MCAPI void $taskRegister(::std::shared_ptr<::BackgroundTaskBase> task);
143
144 MCAPI void $requeueTask(::std::shared_ptr<::BackgroundTaskBase> task, bool queueImmediate);
145
146 MCFOLD ::TaskGroupState $getState() const;
147
148 MCAPI void $processCoroutines();
149
150 MCAPI void $taskComplete(::gsl::not_null<::BackgroundTaskBase*> task);
151 // NOLINTEND
152
153public:
154 // vftables
155 // NOLINTBEGIN
156 MCAPI static void** $vftable();
157 // NOLINTEND
158};
Definition BackgroundTaskBase.h:13
Definition UniqueLock.h:8
Definition IBackgroundTaskOwner.h:17
Definition Scheduler.h:13
Definition TaskGroup.h:22
Definition TaskResult.h:8
Definition WorkerPool.h:19
Definition move_only_function.h:9
Definition TaskStartInfoEx.h:8
Definition context.h:5
Definition Alias.h:14