LeviLamina
Loading...
Searching...
No Matches
BackgroundTaskBase.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/threading/TaskRunResult.h"
7#include "mc/resources/TaskGroupState.h"
8
9// auto generated forward declare list
10// clang-format off
13struct TaskStartInfo;
14// clang-format on
15
16class BackgroundTaskBase {
17public:
18 // BackgroundTaskBase inner types declare
19 // clang-format off
21 class PendingComparer;
22 class PriorityComparer;
23 // clang-format on
24
25 // BackgroundTaskBase inner types define
26 class CurrentTaskAutoScope {
27 public:
28 // member variables
29 // NOLINTBEGIN
31 // NOLINTEND
32
33 public:
34 // prevent constructor by default
35 CurrentTaskAutoScope& operator=(CurrentTaskAutoScope const&);
36 CurrentTaskAutoScope(CurrentTaskAutoScope const&);
37 CurrentTaskAutoScope();
38
39 public:
40 // member functions
41 // NOLINTBEGIN
42 MCNAPI explicit CurrentTaskAutoScope(::BackgroundTaskBase* curr);
43
45 // NOLINTEND
46
47 public:
48 // constructor thunks
49 // NOLINTBEGIN
50 MCNAPI void* $ctor(::BackgroundTaskBase* curr);
51 // NOLINTEND
52
53 public:
54 // destructor thunk
55 // NOLINTBEGIN
56 MCNAPI void $dtor();
57 // NOLINTEND
58 };
59
61 public:
62 // member functions
63 // NOLINTBEGIN
64 MCNAPI bool operator()(
65 ::std::shared_ptr<::BackgroundTaskBase> const& lhs,
66 ::std::shared_ptr<::BackgroundTaskBase> const& rhs
67 ) const;
68 // NOLINTEND
69 };
70
72
73public:
74 // member variables
75 // NOLINTBEGIN
86 // NOLINTEND
87
88public:
89 // prevent constructor by default
90 BackgroundTaskBase& operator=(BackgroundTaskBase const&);
91 BackgroundTaskBase(BackgroundTaskBase const&);
92 BackgroundTaskBase();
93
94public:
95 // virtual functions
96 // NOLINTBEGIN
97 virtual ~BackgroundTaskBase();
98
99 virtual void cancel() = 0;
100
101 virtual bool isReady() const = 0;
102
103 virtual ::TaskRunResult run(::ITaskExecutionContext const* executionContext, bool isAsyncContext) = 0;
104 // NOLINTEND
105
106public:
107 // member functions
108 // NOLINTBEGIN
109 MCNAPI
110 BackgroundTaskBase(::gsl::not_null<::IBackgroundTaskOwner*> group, ::TaskStartInfo const& startInfo, bool isAsync);
111
112 MCNAPI void _makeOrphan();
113
114 MCNAPI void backDownPriority();
115
116 MCNAPI bool canBeRunBy(::std::thread::id workerId) const;
117
118 MCNAPI ::IBackgroundTaskOwner* getGroup();
119
120 MCNAPI ::TaskGroupState getGroupState() const;
121
122 MCNAPI ::std::shared_ptr<::BackgroundTaskBase> getNext();
123
124 MCNAPI ::BackgroundTaskBase* getPrev();
125
126 MCNAPI ::std::chrono::steady_clock::time_point getStartAfterTime() const;
127
128 MCNAPI bool hasAffinity() const;
129
130 MCNAPI bool isAsync() const;
131
132 MCNAPI bool isOrphaned() const;
133
134 MCNAPI bool isReadyToStart(::std::chrono::steady_clock::time_point t) const;
135
136 MCNAPI void setNext(::std::shared_ptr<::BackgroundTaskBase> next);
137
138 MCNAPI void setPrev(::BackgroundTaskBase* prev);
139
140 MCNAPI void setStartAfterTime(::std::chrono::steady_clock::time_point t);
141
142 MCNAPI void setSyncPriority();
143
144 MCNAPI void taskComplete();
145 // NOLINTEND
146
147public:
148 // static functions
149 // NOLINTBEGIN
150 MCNAPI static ::BackgroundTaskBase* getCurrent();
151 // NOLINTEND
152
153public:
154 // static variables
155 // NOLINTBEGIN
156 MCNAPI static ::BackgroundTaskBase*& gCurrentTask();
157 // NOLINTEND
158
159public:
160 // constructor thunks
161 // NOLINTBEGIN
162 MCNAPI void* $ctor(::gsl::not_null<::IBackgroundTaskOwner*> group, ::TaskStartInfo const& startInfo, bool isAsync);
163 // NOLINTEND
164
165public:
166 // destructor thunk
167 // NOLINTBEGIN
168 MCNAPI void $dtor();
169 // NOLINTEND
170
171public:
172 // virtual function thunks
173 // NOLINTBEGIN
174
175 // NOLINTEND
176
177public:
178 // vftables
179 // NOLINTBEGIN
180 MCNAPI static void** $vftable();
181 // NOLINTEND
182};
Definition BackgroundTaskBase.h:26
MCAPI void * $ctor(::BackgroundTaskBase *curr)
MCAPI CurrentTaskAutoScope(::BackgroundTaskBase *curr)
Definition BackgroundTaskBase.h:60
MCAPI bool operator()(::std::shared_ptr<::BackgroundTaskBase > const &lhs, ::std::shared_ptr<::BackgroundTaskBase > const &rhs) const
Definition BackgroundTaskBase.h:71
MCAPI::TaskGroupState getGroupState() const
MCAPI bool isReadyToStart(::std::chrono::steady_clock::time_point t) const
MCAPI void backDownPriority()
MCAPI void setStartAfterTime(::std::chrono::steady_clock::time_point t)
static MCAPI void ** $vftable()
MCAPI void * $ctor(::gsl::not_null<::IBackgroundTaskOwner * > group, ::TaskStartInfo const &startInfo, bool isAsync)
static MCAPI ::BackgroundTaskBase *& gCurrentTask()
static MCAPI ::BackgroundTaskBase * getCurrent()
MCAPI ::std::shared_ptr<::BackgroundTaskBase > getNext()
MCAPI::BackgroundTaskBase * getPrev()
MCAPI void setPrev(::BackgroundTaskBase *prev)
MCAPI bool hasAffinity() const
MCAPI BackgroundTaskBase(::gsl::not_null<::IBackgroundTaskOwner * > group, ::TaskStartInfo const &startInfo, bool isAsync)
MCAPI bool isOrphaned() const
MCAPI void $dtor()
MCAPI void _makeOrphan()
MCAPI void taskComplete()
MCAPI bool isAsync() const
MCAPI::std::chrono::steady_clock::time_point getStartAfterTime() const
MCAPI void setSyncPriority()
MCAPI void setNext(::std::shared_ptr<::BackgroundTaskBase > next)
MCAPI bool canBeRunBy(::std::thread::id workerId) const
MCAPI::IBackgroundTaskOwner * getGroup()
Definition IBackgroundTaskOwner.h:17
Definition ITaskExecutionContext.h:5
Definition TaskStartInfo.h:5
Definition Alias.h:14