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
8// auto generated forward declare list
9// clang-format off
10class WorkerPool;
11// clang-format on
12
14public:
15 // Scheduler inner types declare
16 // clang-format off
18 // clang-format on
19
20 // Scheduler inner types define
22 public:
23 // member variables
24 // NOLINTBEGIN
26 // NOLINTEND
27
28 public:
29 // prevent constructor by default
33 };
34
35 enum class MinimumTimeBudget : int {
36 Yes = 0,
37 No = 1,
38 };
39
40 enum class MaximumTimeBudget : int {
41 Yes = 0,
42 No = 1,
43 };
44
45public:
46 // member variables
47 // NOLINTBEGIN
48 ::ll::TypedStorage<4, 4, uint> mTotalFrames;
49 ::ll::TypedStorage<4, 4, uint> mStarvedFrames;
50 ::ll::TypedStorage<4, 4, uint> mPromotionFrames;
51 ::ll::TypedStorage<4, 4, uint> mTargetFPS;
52 ::ll::TypedStorage<4, 4, uint> mEffectiveFPS;
53 ::ll::TypedStorage<4, 4, uint> mTotalRunCoroutines;
54 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mPredictedCoroutineDuration;
55 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mTotalCoroutineDuration;
56 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::WorkerPool>> mCoroutinePool;
57 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNextStarveCheckTime;
58 ::ll::TypedStorage<4, 4, ::std::thread::id> mThreadID;
59 // NOLINTEND
60
61public:
62 // prevent constructor by default
63 Scheduler();
64
65public:
66 // virtual functions
67 // NOLINTBEGIN
68 // vIndex: 0
69 virtual ~Scheduler() /*override*/ = default;
70 // NOLINTEND
71
72public:
73 // member functions
74 // NOLINTBEGIN
75 MCNAPI Scheduler(::std::string name, uint FPS);
76
77 MCNAPI ::std::chrono::nanoseconds _calcBaseTimeBudget(
78 uint forFps,
79 ::std::chrono::nanoseconds frameTimeSoFar,
80 ::Scheduler::MinimumTimeBudget ensureNonZeroRunTime,
81 ::Scheduler::MaximumTimeBudget limitMaxRunTime
82 );
83
84 MCNAPI bool _runCoroutines(::std::chrono::nanoseconds timeCap, ::std::function<bool()> const& earlyExit);
85
86 MCNAPI void processCoroutines(
87 ::std::chrono::nanoseconds timeSinceSwap,
88 ::Scheduler::MinimumTimeBudget ensureNonZeroRunTime,
89 ::Scheduler::MaximumTimeBudget limitMaxRunTime,
90 ::std::function<bool()> const& earlyExit
91 );
92
93 MCNAPI void setTargetFPS(uint FPS);
94
95 MCNAPI void updateTargetFPS();
96 // NOLINTEND
97
98public:
99 // constructor thunks
100 // NOLINTBEGIN
101 MCNAPI void* $ctor(::std::string name, uint FPS);
102 // NOLINTEND
103
104public:
105 // vftables
106 // NOLINTBEGIN
107 MCNAPI static void** $vftable();
108 // NOLINTEND
109};
Definition EnableNonOwnerReferences.h:7
Definition Scheduler.h:21
Definition Scheduler.h:13
MCAPI void setTargetFPS(uint FPS)
static MCAPI void ** $vftable()
MCAPI::std::chrono::nanoseconds _calcBaseTimeBudget(uint forFps, ::std::chrono::nanoseconds frameTimeSoFar, ::Scheduler::MinimumTimeBudget ensureNonZeroRunTime, ::Scheduler::MaximumTimeBudget limitMaxRunTime)
MCAPI void processCoroutines(::std::chrono::nanoseconds timeSinceSwap, ::Scheduler::MinimumTimeBudget ensureNonZeroRunTime, ::Scheduler::MaximumTimeBudget limitMaxRunTime, ::std::function< bool()> const &earlyExit)
MCAPI void updateTargetFPS()
MCAPI bool _runCoroutines(::std::chrono::nanoseconds timeCap, ::std::function< bool()> const &earlyExit)
MCAPI void * $ctor(::std::string name, uint FPS)
MCAPI Scheduler(::std::string name, uint FPS)
Definition WorkerPool.h:19
Definition Alias.h:14