131template <
typename Traits = FTimerManagerDefaultTraits>
170 if (!ActiveTimerHeap.
IsEmpty())
190 return Storage.
Num();
262 return !PendingRepeatTimers.
IsEmpty();
307 bool bIsTicking =
false;
310template <
typename Traits>
315 Traits::CheckIsManagerThread(Storage.IsManagerThread());
321 InternalTime += DeltaTime;
337 if (
FTimerData* TimerData = Storage.Find(InternalHandle))
342 ActiveTimerHeap.HeapPush(InternalHandle, FTimerHeapOrder(Storage));
369 if (
FTimerData* TimerData = Storage.Find(InternalHandle))
371 TimerData->Expiration = InternalTime + TimerData->Rate;
373 ActiveTimerHeap.HeapPush(InternalHandle, FTimerHeapOrder(Storage));
376 PendingRepeatTimers.Empty();
382 while (ActiveTimerHeap.Num() > 0)
412 PendingRepeatTimers.Add(TimerHandle);
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define check(expr)
Definition AssertionMacros.h:314
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define QUICK_SCOPE_CYCLE_COUNTER(Stat)
Definition Stats.h:652
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
#define ON_SCOPE_EXIT
Definition ScopeExit.h:73
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition UnrealTemplate.h:321
UE_REWRITE bool IsEmpty() const
Definition Array.h:1133
UE_NODEBUG const ElementType & HeapTop() const UE_LIFETIMEBOUND
Definition Array.h:3848
Definition ContainerAllocationPolicies.h:894
TManagedStorageInternalHandle< FExternalHandle > FInternalHandle
Definition EventLoopManagedStorage.h:159
ElementType * Find(FExternalHandle Handle)
Definition EventLoopManagedStorage.h:352
typename Traits::FExternalHandle FExternalHandle
Definition EventLoopManagedStorage.h:158
bool IsManagerThread() const
Definition EventLoopManagedStorage.h:214
TArray< FInternalHandle, typename Traits::InternalHandleArryAllocatorType > FInternalHandleArryType
Definition EventLoopManagedStorage.h:160
void Init()
Definition EventLoopManagedStorage.h:224
void Remove(const FExternalHandle Handle, FManagedStorageOnRemoveComplete &&OnRemoveComplete=FManagedStorageOnRemoveComplete())
Definition EventLoopManagedStorage.h:316
FExternalHandle Add(ElementType &&Data)
Definition EventLoopManagedStorage.h:300
int32 Num() const
Definition EventLoopManagedStorage.h:340
Definition EventLoopTimer.h:133
void Init()
Definition EventLoopTimer.h:146
bool GetNextTimeout(FTimespan &OutTimeout) const
Definition EventLoopTimer.h:168
typename FStorageType::FInternalHandle FInternalHandle
Definition EventLoopTimer.h:137
TManagedStorage< FTimerData, typename Traits::FStorageTraits > FStorageType
Definition EventLoopTimer.h:135
FTimerHandle SetTimer(FTimerCallback &&Callback, FTimespan InRate, bool InbRepeat=false, TOptional< FTimespan > InFirstDelay=TOptional< FTimespan >())
Definition EventLoopTimer.h:205
bool HasPendingRepeatTimer() const
Definition EventLoopTimer.h:260
void Tick(FTimespan DeltaTime)
Definition EventLoopTimer.h:311
typename FStorageType::FInternalHandleArryType FInternalHandleArryType
Definition EventLoopTimer.h:138
uint32 GetNumTimers() const
Definition EventLoopTimer.h:188
void ClearTimer(FTimerHandle &InHandle, FOnTimerCleared &&OnTimerCleared=FOnTimerCleared())
Definition EventLoopTimer.h:234
typename FStorageType::FExternalHandle FTimerHandle
Definition EventLoopTimer.h:136
Definition EventLoopLog.cpp:5
TUniqueFunction< void()> FManagedStorageOnRemoveComplete
Definition EventLoopManagedStorage.h:17
TResourceHandle< FTimerHandleTraits > FTimerHandle
Definition EventLoopTimer.h:22
ETimerStatus
Definition EventLoopTimer.h:25
FManagedStorageOnRemoveComplete FOnTimerCleared
Definition EventLoopTimer.h:20
Definition TimerManager.h:73
Definition TimerHandle.h:12
Definition TimerManager.cpp:253
static FTimespan Zero()
Definition Timespan.h:747
Definition Optional.h:131
Definition EventLoopManagedStorage.h:54
Definition EventLoopTimer.h:50
ETimerStatus Status
Definition EventLoopTimer.h:71
FTimerData(FTimerData &&)=default
uint8 bRepeat
Definition EventLoopTimer.h:74
FTimerData & operator=(const FTimerData &)=delete
FTimespan Expiration
Definition EventLoopTimer.h:69
FTimerData & operator=(FTimerData &&)=default
TOptional< FTimespan > FirstDelay
Definition EventLoopTimer.h:63
FTimerCallback Callback
Definition EventLoopTimer.h:60
FTimerData(const FTimerData &)=delete
FTimespan Rate
Definition EventLoopTimer.h:66
FTimerData(FTimerCallback &&InCallback, TOptional< FTimespan > InFirstDelay, FTimespan InRate, bool bInRepeat)
Definition EventLoopTimer.h:51
Definition EventLoopTimer.h:14
static constexpr TCHAR Name[]
Definition EventLoopTimer.h:15
Definition EventLoopTimer.h:115
Definition EventLoopTimer.h:100
Definition EventLoopTimer.h:86
static void CheckIsManagerThread(bool bIsManagerThread)
Definition EventLoopTimer.h:87
Definition EventLoopHandle.h:12