LeviLamina
Loading...
Searching...
No Matches
Scheduler.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
7#include "mc/platform/brstd/move_only_function.h"
8
9// auto generated forward declare list
10// clang-format off
11class WorkerPool;
12// clang-format on
13
14class Scheduler : public ::Bedrock::EnableNonOwnerReferences {
15public:
16 // Scheduler inner types declare
17 // clang-format off
18 struct CoroutinePolicy;
20 // clang-format on
21
22 // Scheduler inner types define
23 enum class MaximumTimeBudget : int {
24 Yes = 0,
25 No = 1,
26 };
27
28 enum class MinimumTimeBudget : int {
29 Yes = 0,
30 No = 1,
31 };
32
33 struct CoroutinePolicy {
34 public:
35 // member variables
36 // NOLINTBEGIN
39 // NOLINTEND
40
41 public:
42 // prevent constructor by default
43 CoroutinePolicy& operator=(CoroutinePolicy const&);
44 CoroutinePolicy(CoroutinePolicy const&);
45 CoroutinePolicy();
46 };
47
48 class ScopedChangeScheduler {
49 public:
50 // member variables
51 // NOLINTBEGIN
53 // NOLINTEND
54
55 public:
56 // prevent constructor by default
57 ScopedChangeScheduler& operator=(ScopedChangeScheduler const&);
58 ScopedChangeScheduler(ScopedChangeScheduler const&);
59 ScopedChangeScheduler();
60 };
61
62public:
63 // member variables
64 // NOLINTBEGIN
65 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::Scheduler::CoroutinePolicy>> mCoroutinePolicy;
66 ::ll::TypedStorage<4, 4, uint> mTotalFrames;
67 ::ll::TypedStorage<4, 4, uint> mStarvedFrames;
68 ::ll::TypedStorage<4, 4, uint> mPromotionFrames;
69 ::ll::TypedStorage<4, 4, uint> mTargetFPS;
70 ::ll::TypedStorage<4, 4, uint> mEffectiveFPS;
71 ::ll::TypedStorage<4, 4, uint> mTotalRunCoroutines;
72 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mPredictedCoroutineDuration;
73 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mTotalCoroutineDuration;
74 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorkerPool>> mCoroutinePool;
75 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNextStarveCheckTime;
76 ::ll::TypedStorage<4, 4, ::std::thread::id> mThreadID;
77 // NOLINTEND
78
79public:
80 // prevent constructor by default
81 Scheduler();
82
83public:
84 // virtual functions
85 // NOLINTBEGIN
86#ifdef LL_PLAT_S
87 virtual ~Scheduler() /*override*/ = default;
88#else // LL_PLAT_C
89 virtual ~Scheduler() /*override*/;
90#endif
91
92 // NOLINTEND
93
94public:
95 // member functions
96 // NOLINTBEGIN
97 MCAPI Scheduler(::std::string_view name, uint FPS);
98
99 MCAPI void processCoroutines(
100 ::std::chrono::nanoseconds timeSinceSwap,
101 ::Scheduler::MinimumTimeBudget ensureNonZeroRunTime,
102 ::Scheduler::MaximumTimeBudget limitMaxRunTime
103 );
104
105#ifdef LL_PLAT_C
106 MCAPI ::std::shared_ptr<void> setCoroutinePolicy(::brstd::move_only_function<bool() const> policy);
107#endif
108 // NOLINTEND
109
110public:
111 // constructor thunks
112 // NOLINTBEGIN
113 MCAPI void* $ctor(::std::string_view name, uint FPS);
114 // NOLINTEND
115
116public:
117 // destructor thunk
118 // NOLINTBEGIN
119#ifdef LL_PLAT_C
120 MCAPI void $dtor();
121#endif
122 // NOLINTEND
123
124public:
125 // vftables
126 // NOLINTBEGIN
127 MCNAPI static void** $vftable();
128 // NOLINTEND
129};
Definition EnableNonOwnerReferences.h:7
Definition Scheduler.h:48
static MCAPI void ** $vftable()
Definition WorkerPool.h:16
Definition move_only_function.h:9
Definition Scheduler.h:33
Definition Alias.h:14