载入中...
搜索中...
未找到
eve::timer::Timer类 参考

High-resolution frame/elapsed timer backed by SDL_GetPerformanceCounter(). Script: timer <- eve.Timer(); 更多...

#include <Timer.h>

类 eve::timer::Timer 继承关系图:
eve::Module eve::service::ITimer eve::ITimeSource

Public 成员函数

 Module_REG (Timer)
 
 Timer ()
 Timer.
 
 ~Timer () override
 Timer.
 
float getTime () const
 Seconds since the Timer was created (0 if the timer is unavailable). Returns float (not double): SimpleSquirrel only pushes double when SQUSEDOUBLE is defined.
 
float getDelta () const
 Seconds between the last two step() calls (0 until the first step).
 
float step ()
 Advances the frame clock and returns the new delta in seconds.
 
eve::MonotonicTimestamp monotonicNow () const override
 Read the monotonic timestamp used by this timer.
 
eve::WallClockTimestamp wallClockNow () const override
 Read wall-clock metadata from the system clock.
 
eve::Result< std::vector< eve::SimulationStep > > stepSimulation ()
 Advance the injected fixed-step clock and return emitted simulation steps.
 
eve::SimulationClock & simulationClock ()
 Return the current deterministic simulation clock. Borrowed for Timer lifetime.
 
eve::Duration getDeltaDuration () const
 Return the last source duration observed by step().
 
eve::FrameIndex getFrameIndex () const
 Return the presentation frame ordinal maintained by the simulation clock.
 
double elapsedSeconds () override
 Elapsed seconds.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 Module.
 
virtual std::string getName () const =0
 Returns the name.
 
- Public 成员函数 继承自 eve::service::ITimer
virtual ~ITimer ()=default
 Releases ITimer resources.
 
- Public 成员函数 继承自 eve::ITimeSource
virtual ~ITimeSource ()=default
 I time source.
 

额外继承的成员函数

- 静态 Public 属性 继承自 eve::service::ITimer
static constexpr const char * capabilityName = "ITimer"
 
- 静态 Public 属性 继承自 eve::ITimeSource
static constexpr const char * capabilityName = "ITimeSource"
 

详细描述

High-resolution frame/elapsed timer backed by SDL_GetPerformanceCounter(). Script: timer <- eve.Timer();

在文件 Timer.h 第 20 行定义.

构造及析构函数说明

◆ Timer()

eve::timer::Timer::Timer ( )

Timer.

在文件 Timer.cpp 第 18 行定义.

引用了 eve::Duration::fromNanoseconds() , 以及 monotonicNow().

◆ ~Timer()

eve::timer::Timer::~Timer ( )
override

Timer.

在文件 Timer.cpp 第 27 行定义.

成员函数说明

◆ elapsedSeconds()

double eve::timer::Timer::elapsedSeconds ( )
inlineoverridevirtual

Elapsed seconds.

实现了 eve::service::ITimer.

在文件 Timer.h 第 59 行定义.

◆ getDelta()

float eve::timer::Timer::getDelta ( ) const

Seconds between the last two step() calls (0 until the first step).

在文件 Timer.cpp 第 38 行定义.

引用了 getDeltaDuration() , 以及 eve::Duration::seconds().

被这些函数引用 step().

◆ getDeltaDuration()

eve::Duration eve::timer::Timer::getDeltaDuration ( ) const

Return the last source duration observed by step().

在文件 Timer.cpp 第 69 行定义.

引用了 eve::Duration::zero().

被这些函数引用 getDelta().

◆ getFrameIndex()

eve::FrameIndex eve::timer::Timer::getFrameIndex ( ) const

Return the presentation frame ordinal maintained by the simulation clock.

在文件 Timer.cpp 第 73 行定义.

引用了 eve::detail::StrongUint64< detail::FrameIndexTag >::zero().

◆ getTime()

float eve::timer::Timer::getTime ( ) const

Seconds since the Timer was created (0 if the timer is unavailable). Returns float (not double): SimpleSquirrel only pushes double when SQUSEDOUBLE is defined.

在文件 Timer.cpp 第 32 行定义.

引用了 monotonicNow() , 以及 eve::MonotonicTimestamp::since().

◆ Module_REG()

eve::timer::Timer::Module_REG ( Timer  )

◆ monotonicNow()

eve::MonotonicTimestamp eve::timer::Timer::monotonicNow ( ) const
overridevirtual

Read the monotonic timestamp used by this timer.

备注
Owner-thread only; this timestamp is not persistent simulation state.

实现了 eve::ITimeSource.

在文件 Timer.cpp 第 50 行定义.

引用了 eve::MonotonicTimestamp::zero().

被这些函数引用 getTime() , 以及 Timer().

◆ simulationClock()

eve::SimulationClock & eve::timer::Timer::simulationClock ( )

Return the current deterministic simulation clock. Borrowed for Timer lifetime.

在文件 Timer.cpp 第 67 行定义.

◆ step()

float eve::timer::Timer::step ( )

Advances the frame clock and returns the new delta in seconds.

在文件 Timer.cpp 第 40 行定义.

引用了 getDelta() , 以及 stepSimulation().

◆ stepSimulation()

eve::Result< std::vector< eve::SimulationStep > > eve::timer::Timer::stepSimulation ( )

Advance the injected fixed-step clock and return emitted simulation steps.

在文件 Timer.cpp 第 65 行定义.

被这些函数引用 step().

◆ wallClockNow()

eve::WallClockTimestamp eve::timer::Timer::wallClockNow ( ) const
overridevirtual

Read wall-clock metadata from the system clock.

备注
Owner-thread only and never used to advance simulation state.

实现了 eve::ITimeSource.

在文件 Timer.cpp 第 59 行定义.


该类的文档由以下文件生成: