Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
BackgroundTaskBase.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/common/Globals.h"
5#include "mc/deps/core/threading/InternalTaskGroup.h"
6
7// auto generated inclusion list
8#include "mc/deps/core/memory/MemoryCategory.h"
9#include "mc/deps/core/threading/TaskRunResult.h"
10
11// auto generated forward declare list
12// clang-format off
15struct TaskStartInfo;
16// clang-format on
17
18class BackgroundTaskBase {
19public:
20 // BackgroundTaskBase inner types declare
21 // clang-format off
23 struct DiagnosticInfo;
24 class PendingComparer;
25 class PriorityComparer;
26 // clang-format on
27
28 // BackgroundTaskBase inner types define
30 public:
31 // member variables
32 // NOLINTBEGIN
33 ::ll::TypedStorage<8, 8, ::BackgroundTaskBase*> mPrev;
34 // NOLINTEND
35 };
36
38 public:
39 // member variables
40 // NOLINTBEGIN
41 ::ll::TypedStorage<8, 8, uint64> mTaskId;
42 ::ll::TypedStorage<8, 8, void const*> mAsync;
43 ::ll::TypedStorage<8, 8, void const*> mPredecessor;
44 ::ll::TypedStorage<8, 32, ::std::string> mName;
45 ::ll::TypedStorage<8, 16, ::std::string_view> mSourceFile;
46 ::ll::TypedStorage<4, 4, uint> mSourceLine;
47 ::ll::TypedStorage<8, 8, uint64> mPredecessorPendingCount;
48 ::ll::TypedStorage<8, 8, uint64> mPredecessorTotalCount;
49 ::ll::TypedStorage<1, 1, bool> mPredecessorHasPendingCount;
50 ::ll::TypedStorage<1, 1, bool> mPredecessorCancellationLinked;
51 ::ll::TypedStorage<8, 8, uint64> mSuccessorCount;
52 ::ll::TypedStorage<1, 1, bool> mWaitingForPredecessor;
53 ::ll::TypedStorage<4, 4, float> mWaitDurationSeconds;
54 // NOLINTEND
55
56 public:
57 // member functions
58 // NOLINTBEGIN
60 // NOLINTEND
61
62 public:
63 // destructor thunk
64 // NOLINTBEGIN
65 MCNAPI void $dtor();
66 // NOLINTEND
67 };
68
70
72
73public:
74 // member variables
75 // NOLINTBEGIN
76 ::ll::TypedStorage<1, 1, bool const> mIsAsync;
77 ::ll::TypedStorage<8, 8, ::IBackgroundTaskOwner*> mGroup;
78 ::ll::TypedStorage<8, 8, ::BackgroundTaskBase*> mPrevTask;
79 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::BackgroundTaskBase>> mNextTask;
80 ::ll::TypedStorage<4, 4, int> mPriority;
81 ::ll::TypedStorage<4, 4, ::std::thread::id> mAffinity;
82 ::ll::TypedStorage<4, 4, int const> mBackDownPriorityAmount;
83 ::ll::TypedStorage<8, 32, ::std::string> mTaskName;
84 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mStartAfterTime;
85 ::ll::TypedStorage<8, 16, ::std::string_view> mSourceFile;
86 ::ll::TypedStorage<4, 4, uint> mSourceLine;
87 ::ll::TypedStorage<8, 8, uint64> mDiagnosticId;
88 ::ll::TypedStorage<1, 1, ::Memory::MemoryCategory> mMemoryCategory;
89 // NOLINTEND
90
91public:
92 [[nodiscard]] bool isOrphaned() const { return mGroup == &gInternalTaskGroup(); }
93
94public:
95 // prevent constructor by default
97
98public:
99 // virtual functions
100 // NOLINTBEGIN
101 virtual ~BackgroundTaskBase();
102
103 virtual void cancel() = 0;
104
105 virtual bool isReady() const = 0;
106
107 virtual ::TaskRunResult run(::ITaskExecutionContext const* executionContext, bool isAsyncContext) = 0;
108
109 virtual ::BackgroundTaskBase::DiagnosticInfo getDiagnosticInfo() const = 0;
110 // NOLINTEND
111
112public:
113 // member functions
114 // NOLINTBEGIN
115 MCNAPI
116 BackgroundTaskBase(::gsl::not_null<::IBackgroundTaskOwner*> group, ::TaskStartInfo const& startInfo, bool isAsync);
117 // NOLINTEND
118
119public:
120 // static variables
121 // NOLINTBEGIN
122 MCAPI static ::BackgroundTaskBase*& gCurrentTask();
123 // NOLINTEND
124
125public:
126 // constructor thunks
127 // NOLINTBEGIN
128 MCNAPI void* $ctor(::gsl::not_null<::IBackgroundTaskOwner*> group, ::TaskStartInfo const& startInfo, bool isAsync);
129 // NOLINTEND
130
131public:
132 // destructor thunk
133 // NOLINTBEGIN
134 MCNAPI void $dtor();
135 // NOLINTEND
136
137public:
138 // vftables
139 // NOLINTBEGIN
140 MCNAPI static void** $vftable();
141 // NOLINTEND
142};
Definition BackgroundTaskBase.h:29
Definition BackgroundTaskBase.h:69
Definition BackgroundTaskBase.h:71
Definition BackgroundTaskBase.h:18
static MCAPI void ** $vftable()
MCAPI void * $ctor(::gsl::not_null<::IBackgroundTaskOwner * > group, ::TaskStartInfo const &startInfo, bool isAsync)
MCAPI BackgroundTaskBase(::gsl::not_null<::IBackgroundTaskOwner * > group, ::TaskStartInfo const &startInfo, bool isAsync)
MCAPI void $dtor()
Definition IBackgroundTaskOwner.h:17
Definition ITaskExecutionContext.h:5
Definition BackgroundTaskBase.h:37
Definition TaskStartInfo.h:5