3#include <Core/CoreDLL.h>
4#include <Foundation/Reflection/Reflection.h>
8 using StorageType = plUInt8;
24 static plTime GetInterval(Enum updateRate);
41 plUInt32 GetHistogramIndex(
plTime value);
42 plTime GetHistogramSlotValue(plUInt32 uiIndex);
44 static float GetRandomZeroToOne(
int pos, plUInt32& seed);
45 static plTime GetRandomTimeJitter(
int pos, plUInt32& seed);
49 double m_fInvIntervalRange;
53 plUInt32 m_uiSeed = 0;
55 static constexpr plUInt32 HistogramSize = 32;
56 plUInt32 m_Histogram[HistogramSize] = {};
57 plTime m_HistogramSlotValues[HistogramSize] = {};
70 :
SUPER(minInterval, maxInterval)
74 void AddOrUpdateWork(
const T& work,
plTime interval);
75 void RemoveWork(
const T& work);
77 plTime GetInterval(
const T& work)
const;
94 plTime m_LastScheduledTime;
108#include <Core/Utils/Implementation/IntervalScheduler_inl.h>
Definition DynamicArray.h:81
Definition HashTable.h:333
Helper class to schedule work in intervals typically larger than the duration of one frame.
Definition IntervalScheduler.h:36
Definition IntervalScheduler.h:65
void Update(plTime deltaTime, RunWorkCallback runWorkCallback)
Advances the scheduler by deltaTime and triggers runWorkCallback for each work that should be run dur...
Definition IntervalScheduler_inl.h:109
A generic delegate class which supports static functions and member functions.
Definition Delegate.h:76
Forward Iterator to iterate over all elements in sorted order.
Definition Map.h:103
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12
PL_ALWAYS_INLINE static constexpr plTime MakeFromMilliseconds(double fMilliseconds)
Creates an instance of plTime that was initialized from milliseconds.
Definition Time.h:26
PL_ALWAYS_INLINE static constexpr plTime MakeFromSeconds(double fSeconds)
Creates an instance of plTime that was initialized from seconds.
Definition Time.h:30
Definition IntervalScheduler.h:7