UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IEventLoop.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
7#include "Misc/Timespan.h"
10
11namespace UE::EventLoop {
12
13class IRequestManager;
14
16{
18 Running,
20};
21
24
25class IEventLoop : public TSharedFromThis<IEventLoop, ESPMode::ThreadSafe>
26{
27public:
28 virtual ~IEventLoop() = default;
29
35 virtual bool Init() = 0;
36
45
59
70
78 virtual void PostAsyncTask(FAsyncTask&& Task) = 0;
79
80 /*
81 * Run the event loop until shutdown is called.
82 * The event loop will wake up when a timer needs to run or an async task has been posted.
83 *
84 * NOT thread safe.
85 */
86 virtual void Run() = 0;
87
88 /*
89 * Run one iteration of the event loop.
90 *
91 * NOT thread safe.
92 *
93 * @param WaitTime Maximum amount of time to wait for events.
94 * @return true if RunOnce should be called again.
95 */
96 virtual bool RunOnce(FTimespan WaitTime) = 0;
97
98 /*
99 * Return the event loops current loop time.
100 *
101 * NOT thread safe.
102 *
103 * @return the time the event loop last woke up.
104 */
105 virtual FTimespan GetLoopTime() const = 0;
106};
107
108/* UE::EventLoop */ }
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition SharedPointer.h:1640
Definition IEventLoop.h:26
virtual void PostAsyncTask(FAsyncTask &&Task)=0
virtual bool Init()=0
virtual ~IEventLoop()=default
virtual bool RunOnce(FTimespan WaitTime)=0
virtual FTimerHandle SetTimer(FTimerCallback &&Callback, FTimespan InRate, bool InbRepeat=false, TOptional< FTimespan > InFirstDelay=TOptional< FTimespan >())=0
virtual void ClearTimer(FTimerHandle &InHandle, FOnTimerCleared &&OnTimerCleared=FOnTimerCleared())=0
virtual void RequestShutdown(FOnShutdownComplete &&OnShutdownComplete=FOnShutdownComplete())=0
virtual FTimespan GetLoopTime() const =0
virtual void Run()=0
Definition EventLoopLog.cpp:5
TUniqueFunction< void()> FOnShutdownComplete
Definition IEventLoop.h:23
EEventLoopStatus
Definition IEventLoop.h:16
FManagedStorageOnRemoveComplete FOnTimerCleared
Definition EventLoopTimer.h:20
Definition Timespan.h:76
Definition Optional.h:131
Definition EventLoopHandle.h:12