FTimerManager
- Module
- Core
- Header
#include "Core/FTimerManager.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
FTimerManager() | FTimerManager | |
~FTimerManager() | ~FTimerManager | |
FTimerManager(const FTimerManager&) = delete | FTimerManager |
Public functions
| Returns | Name | Description |
|---|---|---|
FTimerManager& | Get | The ENGINE-scope manager, ticked by the engine loop for the whole process lifetime. |
FTimerManager& | operator= | |
void | SetTimer | Overwrites outHandle. |
size_t | ClearAllInModule | Clears every timer a module set — the unload sweep, run over every live manager. |
void | ClearTimer | No-op if the handle is invalid or points to a swept slot. |
bool | IsTimerActive | |
float | GetTimerRemaining | Seconds until the next fire; -1.0 if the handle is invalid. |
bool | PauseTimer | A paused timer keeps its slot, its remaining time and its callback but does not count down; unpausing resumes from where it stopped. |
bool | UnPauseTimer | |
bool | IsTimerPaused | |
void | Tick | Called once per frame by the engine loop, before the gameplay tick. |
size_t | GetActiveTimerCount |
Function details
FTimerManager
FTimerManager()~FTimerManager
~FTimerManager()FTimerManager
FTimerManager(const FTimerManager&) = deleteGet
static FTimerManager& Get()The ENGINE-scope manager, ticked by the engine loop for the whole process lifetime. Gameplay code should use its world's manager (MWorld::GetTimerManager()) instead: a timer set here from an actor outlives the world, and its captured pointers dangle when it fires.
operator=
FTimerManager& operator=(const FTimerManager&) = deleteSetTimer
void SetTimer(FTimerHandle& outHandle, std::function<void()> callback, float delaySeconds, bool loop = false, const void* owner = FModuleAnchor::Here())Overwrites outHandle. A looping timer re-arms after each fire, a non-looping one self-clears. owner names the setting module (FModuleAnchor): every live manager clears that module's timers when it unloads, rather than firing a callback into its freed code.
ClearAllInModule
size_t ClearAllInModule(void* moduleHandle)Clears every timer a module set — the unload sweep, run over every live manager. Returns how many were cleared.
ClearTimer
void ClearTimer(FTimerHandle& handle)No-op if the handle is invalid or points to a swept slot.
IsTimerActive
bool IsTimerActive(const FTimerHandle& handle) constGetTimerRemaining
float GetTimerRemaining(const FTimerHandle& handle) constSeconds until the next fire; -1.0 if the handle is invalid. A paused timer reports the time it had left when it was paused.
PauseTimer
bool PauseTimer(const FTimerHandle& handle)A paused timer keeps its slot, its remaining time and its callback but does not count down; unpausing resumes from where it stopped. It stays "active" throughout — IsTimerPaused is what tells the two apart — so a paused handle can still be cleared, queried and unpaused. False for an invalid or stale handle, or when the timer is already in that state.
UnPauseTimer
bool UnPauseTimer(const FTimerHandle& handle)IsTimerPaused
bool IsTimerPaused(const FTimerHandle& handle) constTick
void Tick(float deltaSeconds)Called once per frame by the engine loop, before the gameplay tick.
GetActiveTimerCount
size_t GetActiveTimerCount() const noexcept