Plasma Engine  2.0
Loading...
Searching...
No Matches
plIntervalScheduler< T > Class Template Reference

#include <IntervalScheduler.h>

Inheritance diagram for plIntervalScheduler< T >:

Public Types

using RunWorkCallback = plDelegate<void(const T&, plTime)>
 

Public Member Functions

PL_ALWAYS_INLINE plIntervalScheduler (plTime minInterval=plTime::MakeFromMilliseconds(1), plTime maxInterval=plTime::MakeFromSeconds(1))
 
void AddOrUpdateWork (const T &work, plTime interval)
 
void RemoveWork (const T &work)
 
plTime GetInterval (const T &work) const
 
void Update (plTime deltaTime, RunWorkCallback runWorkCallback)
 Advances the scheduler by deltaTime and triggers runWorkCallback for each work that should be run during this update step. Since it is not possible to maintain the exact interval all the time the actual delta time for the work is also passed to runWorkCallback.
 
void Clear ()
 

Additional Inherited Members

- Protected Member Functions inherited from plIntervalSchedulerBase
 plIntervalSchedulerBase (plTime minInterval, plTime maxInterval)
 
plUInt32 GetHistogramIndex (plTime value)
 
plTime GetHistogramSlotValue (plUInt32 uiIndex)
 
- Static Protected Member Functions inherited from plIntervalSchedulerBase
static float GetRandomZeroToOne (int pos, plUInt32 &seed)
 
static plTime GetRandomTimeJitter (int pos, plUInt32 &seed)
 
- Protected Attributes inherited from plIntervalSchedulerBase
plTime m_MinInterval
 
plTime m_MaxInterval
 
double m_fInvIntervalRange
 
plTime m_CurrentTime
 
plUInt32 m_uiSeed = 0
 
plUInt32 m_Histogram [HistogramSize] = {}
 
plTime m_HistogramSlotValues [HistogramSize] = {}
 
- Static Protected Attributes inherited from plIntervalSchedulerBase
static constexpr plUInt32 HistogramSize = 32
 

Detailed Description

template<typename T>
class plIntervalScheduler< T >
See also
plIntervalSchedulerBase

The documentation for this class was generated from the following files: