XII Release 0.1.0
Loading...
Searching...
No Matches
xiiIntervalScheduler< T > Class Template Reference

#include <IntervalScheduler.h>

Inheritance diagram for xiiIntervalScheduler< T >:
[legend]

Public Types

using RunWorkCallback = xiiDelegate<void(const T&, xiiTime)>
 

Public Member Functions

XII_ALWAYS_INLINE xiiIntervalScheduler (xiiTime minInterval=xiiTime::MakeFromMilliseconds(1), xiiTime maxInterval=xiiTime::MakeFromSeconds(1))
 
void AddOrUpdateWork (const T &work, xiiTime interval)
 
void RemoveWork (const T &work)
 
xiiTime GetInterval (const T &work) const
 
void Update (xiiTime 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 xiiIntervalSchedulerBase
 xiiIntervalSchedulerBase (xiiTime minInterval, xiiTime maxInterval)
 
xiiUInt32 GetHistogramIndex (xiiTime value)
 
xiiTime GetHistogramSlotValue (xiiUInt32 uiIndex)
 
- Static Protected Member Functions inherited from xiiIntervalSchedulerBase
static float GetRandomZeroToOne (int pos, xiiUInt32 &seed)
 
static xiiTime GetRandomTimeJitter (int pos, xiiUInt32 &seed)
 
- Protected Attributes inherited from xiiIntervalSchedulerBase
xiiTime m_MinInterval
 
xiiTime m_MaxInterval
 
double m_fInvIntervalRange
 
xiiTime m_CurrentTime
 
xiiUInt32 m_uiSeed = 0
 
xiiUInt32 m_Histogram [HistogramSize] = {}
 
xiiTime m_HistogramSlotValues [HistogramSize] = {}
 
- Static Protected Attributes inherited from xiiIntervalSchedulerBase
static constexpr xiiUInt32 HistogramSize = 32
 

Detailed Description

template<typename T>
class xiiIntervalScheduler< T >
See also
xiiIntervalSchedulerBase

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