engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | 所有成员列表
FTimerManager类 参考

Class to globally manage timers. 更多...

#include <TimerManager.h>

+ 类 FTimerManager 继承关系图:

Public 成员函数

FORCEINLINE void ClearAllTimersForObject (void const *Object)
 Clears all timers that are bound to functions on the given object.
 
FORCEINLINE void ClearTimer (FTimerHandle &InHandle)
 Clears a previously set timer, identical to calling SetTimer() with a <= 0.f rate. 更多...
 
FTimerHandle GenerateHandle (int32 Index)
 Generates a handle for a timer at a given index
 
FORCEINLINE float GetTimerElapsed (FTimerHandle InHandle) const
 Gets the current elapsed time for the specified timer. 更多...
 
FORCEINLINE float GetTimerRate (FTimerHandle InHandle) const
 Gets the current rate (time between activations) for the specified timer. 更多...
 
FORCEINLINE float GetTimerRemaining (FTimerHandle InHandle) const
 Gets the time remaining before the specified timer is called 更多...
 
FORCEINLINE bool IsTimerActive (FTimerHandle InHandle) const
 Returns true if the specified timer exists and is not paused 更多...
 
FORCEINLINE bool IsTimerPaused (FTimerHandle InHandle) const
 Returns true if the specified timer exists and is paused 更多...
 
FORCEINLINE bool IsTimerPending (FTimerHandle InHandle) const
 Returns true if the specified timer exists and is pending 更多...
 
FTimerHandle K2_FindDynamicTimerHandle (FTimerDynamicDelegate InDynamicDelegate) const
 Finds a handle to a timer bound to a particular dynamic delegate. 更多...
 
void ListTimers () const
 Debug command to output info on all timers currently set to the log.
 
virtual void OnCrash ()
 Called from crash handler to provide more debug information.
 
void PauseTimer (FTimerHandle InHandle)
 Pauses a previously set timer. 更多...
 
FORCEINLINE void SetTimer (FTimerHandle &InOutHandle, FTimerDelegate const &InDelegate, float InRate, bool InbLoop, float InFirstDelay=-1.f)
 Version that takes any generic delegate.
 
FORCEINLINE void SetTimer (FTimerHandle &InOutHandle, FTimerDynamicDelegate const &InDynDelegate, float InRate, bool InbLoop, float InFirstDelay=-1.f)
 Version that takes a dynamic delegate (e.g. 更多...
 
FORCEINLINE void SetTimer (FTimerHandle &InOutHandle, TFunction< void(void)> &&Callback, float InRate, bool InbLoop, float InFirstDelay=-1.f)
 Version that takes a TFunction
 
template<class UserClass >
FORCEINLINE void SetTimer (FTimerHandle &InOutHandle, UserClass *InObj, typename FTimerDelegate::TUObjectMethodDelegate< UserClass >::FMethodPtr InTimerMethod, float InRate, bool InbLoop=false, float InFirstDelay=-1.f)
 Sets a timer to call the given native function at a set interval. 更多...
 
FORCEINLINE FTimerHandle SetTimerForNextTick (FTimerDelegate const &InDelegate)
 Version that takes any generic delegate.
 
FORCEINLINE FTimerHandle SetTimerForNextTick (FTimerDynamicDelegate const &InDynDelegate)
 Version that takes a dynamic delegate (e.g. 更多...
 
FORCEINLINE FTimerHandle SetTimerForNextTick (TFunction< void(void)> &&Callback)
 Version that takes a TFunction
 
template<class UserClass >
FORCEINLINE FTimerHandle SetTimerForNextTick (UserClass *inObj, typename FTimerDelegate::TUObjectMethodDelegate< UserClass >::FMethodPtr inTimerMethod)
 Sets a timer to call the given native function on the next tick. 更多...
 
FORCEINLINE bool TimerExists (FTimerHandle InHandle) const
 Returns true if the specified timer exists 更多...
 
void UnPauseTimer (FTimerHandle InHandle)
 Unpauses a previously set timer 更多...
 

Protected 成员函数

FORCEINLINE FTimerData const * FindTimer (FTimerHandle const &InHandle) const
 Will find a timer in the active, paused, or pending list.
 

详细描述

Class to globally manage timers.

成员函数说明

◆ ClearTimer()

FORCEINLINE void FTimerManager::ClearTimer ( FTimerHandle &  InHandle)
inline

Clears a previously set timer, identical to calling SetTimer() with a <= 0.f rate.

Invalidates the timer handle as it should no longer be used.

参数
InHandleThe handle of the timer to clear.

◆ GetTimerElapsed()

FORCEINLINE float FTimerManager::GetTimerElapsed ( FTimerHandle  InHandle) const
inline

Gets the current elapsed time for the specified timer.

参数
InHandleThe handle of the timer to check the elapsed time of.
返回
The current time elapsed or -1.f if the timer does not exist.

◆ GetTimerRate()

FORCEINLINE float FTimerManager::GetTimerRate ( FTimerHandle  InHandle) const
inline

Gets the current rate (time between activations) for the specified timer.

参数
InHandleThe handle of the timer to return the rate of.
返回
The current rate or -1.f if timer does not exist.

◆ GetTimerRemaining()

FORCEINLINE float FTimerManager::GetTimerRemaining ( FTimerHandle  InHandle) const
inline

Gets the time remaining before the specified timer is called

参数
InHandleThe handle of the timer to check the remaining time of.
返回
The current time remaining, or -1.f if timer does not exist

◆ IsTimerActive()

FORCEINLINE bool FTimerManager::IsTimerActive ( FTimerHandle  InHandle) const
inline

Returns true if the specified timer exists and is not paused

参数
InHandleThe handle of the timer to check for being active.
返回
true if the timer exists and is active, false otherwise.

◆ IsTimerPaused()

FORCEINLINE bool FTimerManager::IsTimerPaused ( FTimerHandle  InHandle) const
inline

Returns true if the specified timer exists and is paused

参数
InHandleThe handle of the timer to check for being paused.
返回
true if the timer exists and is paused, false otherwise.

◆ IsTimerPending()

FORCEINLINE bool FTimerManager::IsTimerPending ( FTimerHandle  InHandle) const
inline

Returns true if the specified timer exists and is pending

参数
InHandleThe handle of the timer to check for being pending.
返回
true if the timer exists and is pending, false otherwise.

◆ K2_FindDynamicTimerHandle()

FTimerHandle FTimerManager::K2_FindDynamicTimerHandle ( FTimerDynamicDelegate  InDynamicDelegate) const

Finds a handle to a timer bound to a particular dynamic delegate.

This function is intended to be used only by the K2 system.

参数
InDynamicDelegateThe dynamic delegate to search for.
返回
A handle to the found timer - !IsValid() if no such timer was found.

◆ PauseTimer()

void FTimerManager::PauseTimer ( FTimerHandle  InHandle)

Pauses a previously set timer.

参数
InHandleThe handle of the timer to pause.

◆ SetTimer() [1/2]

FORCEINLINE void FTimerManager::SetTimer ( FTimerHandle &  InOutHandle,
FTimerDynamicDelegate const &  InDynDelegate,
float  InRate,
bool  InbLoop,
float  InFirstDelay = -1.f 
)
inline

Version that takes a dynamic delegate (e.g.

for UFunctions).

◆ SetTimer() [2/2]

template<class UserClass >
FORCEINLINE void FTimerManager::SetTimer ( FTimerHandle &  InOutHandle,
UserClass *  InObj,
typename FTimerDelegate::TUObjectMethodDelegate< UserClass >::FMethodPtr  InTimerMethod,
float  InRate,
bool  InbLoop = false,
float  InFirstDelay = -1.f 
)
inline

Sets a timer to call the given native function at a set interval.

If a timer is already set for this handle, it will replace the current timer.

参数
InOutHandleIf the passed-in handle refers to an existing timer, it will be cleared before the new timer is added. A new handle to the new timer is returned in either case.
InObjObject to call the timer function on.
InTimerMethodMethod to call when timer fires.
InRateThe amount of time (in seconds) between set and firing. If <= 0.f, clears existing timers.
InbLooptrue to keep firing at Rate intervals, false to fire only once.
InFirstDelayThe time (in seconds) for the first iteration of a looping timer. If < 0.f InRate will be used.

◆ SetTimerForNextTick() [1/2]

FORCEINLINE FTimerHandle FTimerManager::SetTimerForNextTick ( FTimerDynamicDelegate const &  InDynDelegate)
inline

Version that takes a dynamic delegate (e.g.

for UFunctions).

◆ SetTimerForNextTick() [2/2]

template<class UserClass >
FORCEINLINE FTimerHandle FTimerManager::SetTimerForNextTick ( UserClass *  inObj,
typename FTimerDelegate::TUObjectMethodDelegate< UserClass >::FMethodPtr  inTimerMethod 
)
inline

Sets a timer to call the given native function on the next tick.

参数
inObjObject to call the timer function on.
inTimerMethodMethod to call when timer fires.

◆ TimerExists()

FORCEINLINE bool FTimerManager::TimerExists ( FTimerHandle  InHandle) const
inline

Returns true if the specified timer exists

参数
InHandleThe handle of the timer to check for existence.
返回
true if the timer exists, false otherwise.

◆ UnPauseTimer()

void FTimerManager::UnPauseTimer ( FTimerHandle  InHandle)

Unpauses a previously set timer

参数
InHandleThe handle of the timer to unpause.

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