lib.sysdep.win.whrt
Class ICounter
boost::noncopyable
|
+--ICounter
in counter.h
- Direct Known Subclasses:
- CounterHPET, CounterPMT, CounterQPC, CounterTGT, CounterTSC
- class ICounter
- extends boost::noncopyable
=========================================================================
File : counter.h
Project : 0 A.D.
Description : Interface for counter implementations
=========================================================================
Method Summary |
virtual LibError |
Activate()= 0
|
virtual u64 |
Counter() const = 0
|
virtual uint |
CounterBits() const = 0
|
virtual bool |
IsSafe() const = 0
|
virtual const char* |
Name() const = 0
|
virtual double |
NominalFrequency() const = 0
initial measurement of the tick rate. |
virtual double |
Resolution() const
actual resolution [s]
(override if the timer adjustment is greater than 1 tick). |
virtual void |
Shutdown()= 0
|
~ICounter
public virtual ~ICounter();
Activate
public virtual LibError Activate()= 0;
Counter
public virtual u64 Counter() const = 0;
- Returns:
- the current value of the counter (all but the lower
CounterBits() bits must be zero)
CounterBits
public virtual uint CounterBits() const = 0;
- Returns:
- the bit width of the counter (<= 64)
WHRT uses this to ensure the counter (running at nominal frequency)
doesn't overflow more than once during CALIBRATION_INTERVAL_MS.
IsSafe
public virtual bool IsSafe() const = 0;
Name
public virtual const char* Name() const = 0;
NominalFrequency
public virtual double NominalFrequency() const = 0;
- initial measurement of the tick rate. not necessarily correct
(e.g. when using TSC: wcpu_ClockFrequency isn't exact).
Resolution
public virtual double Resolution() const;
- actual resolution [s]
(override if the timer adjustment is greater than 1 tick).
Shutdown
public virtual void Shutdown()= 0;