diff options
author | Andrew <47818697+Nyeriah@users.noreply.github.com> | 2024-11-24 12:02:56 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-24 12:02:56 -0300 |
commit | ab7f49b220f9dd3cc62fbeb7015df2d76e53301b (patch) | |
tree | c56d355c3025a76d08839f83d8b1e3c83f8002ef /src/common/Utilities/TaskScheduler.h | |
parent | 735a5a5037cd685e0c5246c793fe7159745d836e (diff) |
feat(Core/Scripting): Implement TaskScheduler GetNextGroupOccurrence() (#20714)
Diffstat (limited to 'src/common/Utilities/TaskScheduler.h')
-rw-r--r-- | src/common/Utilities/TaskScheduler.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/Utilities/TaskScheduler.h b/src/common/Utilities/TaskScheduler.h index 145489e086..b85ad54978 100644 --- a/src/common/Utilities/TaskScheduler.h +++ b/src/common/Utilities/TaskScheduler.h @@ -148,6 +148,9 @@ class TaskScheduler /// Check if the group exists and is currently scheduled. bool IsGroupQueued(group_t const group); + // Returns the next group occurrence. + TaskScheduler::timepoint_t GetNextGroupOcurrence(group_t const group) const; + bool IsEmpty() const; }; @@ -373,6 +376,9 @@ public: return RescheduleGroup(group, RandomDurationBetween(min, max)); } + // Returns the next group occurrence. + Milliseconds GetNextGroupOcurrence(group_t const group) const; + private: /// Insert a new task to the enqueued tasks. TaskScheduler& InsertTask(TaskContainer task); @@ -477,6 +483,8 @@ public: /// Returns the repeat counter which increases every time the task is repeated. TaskScheduler::repeated_t GetRepeatCounter() const; + TaskScheduler::timepoint_t GetNextOcurrence() const; + /// Repeats the event and sets a new duration. /// std::chrono::seconds(5) for example. /// This will consume the task context, its not possible to repeat the task again |