YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::Timers::Timer类 参考

计时器。 更多...

#include <ytimer.h>

类 YSLib::Timers::Timer 继承关系图:
YSLib::Timers::Timer 的协作图:

Public 类型

typedef map< u32, Timer * > TimerMap
 计时器组。
 

Public 成员函数

 Timer (const Duration &={}, bool=false)
 构造:使用时间间隔和激活状态。
 
 ~Timer ()
 析构:自动停用。
 
bool IsActive () const
 判断 Timer 是否处于激活状态。
 
TimePoint GetBaseTick () const ynothrow
 
Duration GetInterval () const ynothrow
 
void SetInterval (const TimeSpan &i)
 设置时间间隔。
 
void SetInterval (const Duration &)
 设置时间间隔。
 
void Delay (const Duration &d)
 延迟。
 
bool Refresh ()
 刷新。
 
void Reset ()
 复位。
 

静态 Public 成员函数

static bool RefreshAll ()
 刷新计时器组中的所有计时器。
 
static void ResetAll ()
 复位计时器组中的所有计时器。
 

Protected 属性

TimePoint nBase
 
Duration nInterval
 

静态 Protected 属性

static TimerMap mTimers
 

友元

YF_API friend void Activate (Timer &)
 激活。
 
YF_API friend void Deactivate (Timer &)
 停用。
 

额外继承的成员函数

- Protected 成员函数 继承自 YSLib::GMCounter< Timer >
 GMCounter () ynothrow
 构造。
 
 GMCounter (const GMCounter &) ynothrow
 复制构造。
 
 GMCounter (GMCounter &&)=default
 转移构造。
 
yconstfn u32 GetObjectID () const ynothrow
 
 ~GMCounter () ynothrow
 析构。
 
void ResetID () ynothrow
 复位实例标识序列号。
 
- 静态 Protected 成员函数 继承自 YSLib::GMCounter< Timer >
static u32 GetCount () ynothrow
 
static u32 GetTotal () ynothrow
 
static void ResetCount () ynothrow
 复位实例生成计数。
 
static void ResetTotal () ynothrow
 复位实例计数。
 
- Private 成员函数 继承自 ystdex::noncopyable
 noncopyable (const noncopyable &)=delete
 禁止复制构造。
 
noncopyableoperator= (const noncopyable &)=delete
 禁止赋值复制。
 
 noncopyable ()=default
 protected 构造:默认实现。
 
 ~noncopyable ()=default
 protected 析构:默认实现。
 

详细描述

计时器。

警告
非虚析构。
自从
build 243

在文件 ytimer.h105 行定义.

成员类型定义说明

计时器组。

在文件 ytimer.h108 行定义.

构造及析构函数说明

Timer::Timer ( const Duration i = {},
bool  b = false 
)
explicit

构造:使用时间间隔和激活状态。

自从
build 293

在文件 ytimer.cpp71 行定义.

参考 YSL_BEGIN::Init().

函数调用图:

YSLib::Timers::Timer::~Timer ( )
inline

析构:自动停用。

自从
build 289

在文件 ytimer.h206 行定义.

参考 Deactivate().

函数调用图:

成员函数说明

void YSLib::Timers::Timer::Delay ( const Duration d)
inline

延迟。

自从
build 303

在文件 ytimer.h160 行定义.

TimePoint YSLib::Timers::Timer::GetBaseTick ( ) const
inline

在文件 ytimer.h136 行定义.

Duration YSLib::Timers::Timer::GetInterval ( ) const
inline

在文件 ytimer.h137 行定义.

bool Timer::IsActive ( ) const

判断 Timer 是否处于激活状态。

自从
build 289

在文件 ytimer.cpp79 行定义.

参考 YSLib::GMCounter< Timer >::GetObjectID() , 以及 mTimers.

参考自 ShlTextReader::OnKeyDown() , 以及 ShlTextReader::Scroll().

函数调用图:

这是这个函数的调用关系图:

bool Timer::Refresh ( )

刷新。

在文件 ytimer.cpp100 行定义.

参考 nBase,nInterval,YSLib::Timers::HighResolutionClock::now() , 以及 YB_LIKELY.

参考自 YSLib::UI::InputTimer::Refresh() , 以及 ShlTextReader::Scroll().

函数调用图:

这是这个函数的调用关系图:

bool Timer::RefreshAll ( )
static

刷新计时器组中的所有计时器。

在文件 ytimer.cpp111 行定义.

参考 ystdex::get_value,mTimers , 以及 YB_LIKELY.

void YSLib::Timers::Timer::Reset ( )
inline

复位。

在文件 ytimer.h181 行定义.

参考自 ShlTextReader::OnKeyDown().

这是这个函数的调用关系图:

void Timer::ResetAll ( )
static

复位计时器组中的所有计时器。

在文件 ytimer.cpp126 行定义.

参考 ystdex::get_value,mTimers , 以及 YB_LIKELY.

void YSLib::Timers::Timer::SetInterval ( const TimeSpan i)
inline

设置时间间隔。

自从
build 300

在文件 ytimer.h144 行定义.

参考自 YSLib::UI::InputTimer::Refresh() , 以及 YSLib::UI::InputTimer::Reset().

这是这个函数的调用关系图:

void YSLib::Timers::Timer::SetInterval ( const Duration )

设置时间间隔。

自从
build 300

友元及相关函数文档

YF_API friend void Activate ( Timer )
friend

激活。

YF_API friend void Deactivate ( Timer )
friend

停用。

类成员变量说明

Timer::TimerMap Timer::mTimers
staticprotected

在文件 ytimer.h111 行定义.

参考自 Activate(),Deactivate(),IsActive(),RefreshAll() , 以及 ResetAll().

TimePoint YSLib::Timers::Timer::nBase
protected

在文件 ytimer.h113 行定义.

参考自 Refresh().

Duration YSLib::Timers::Timer::nInterval
protected

在文件 ytimer.h114 行定义.

参考自 Refresh().


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