UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::EventLoop::TEventLoop< IOManagerType, Traits > Class Template Referencefinal

#include <EventLoop.h>

+ Inheritance diagram for UE::EventLoop::TEventLoop< IOManagerType, Traits >:

Classes

struct  FParams
 

Public Member Functions

 TEventLoop (FParams &&Params=FParams())
 
virtual ~TEventLoop ()
 
IOManagerType::FIOAccess & GetIOAccess ()
 
virtual bool Init () override
 
virtual void RequestShutdown (FOnShutdownComplete &&OnShutdownComplete=FOnShutdownComplete()) override
 
virtual FTimerHandle SetTimer (FTimerCallback &&Callback, FTimespan InRate, bool InbRepeat=false, TOptional< FTimespan > InFirstDelay=TOptional< FTimespan >()) override
 
virtual void ClearTimer (FTimerHandle &InHandle, FOnTimerCleared &&OnTimerCleared=FOnTimerCleared()) override
 
virtual void PostAsyncTask (FAsyncTask &&Task) override
 
virtual void Run () override
 
virtual bool RunOnce (FTimespan WaitTime) override
 
virtual FTimespan GetLoopTime () const override
 
- Public Member Functions inherited from UE::EventLoop::IEventLoop
virtual ~IEventLoop ()=default
 
- Public Member Functions inherited from TSharedFromThis< IEventLoop, ESPMode::ThreadSafe >
TSharedRef< IEventLoop, Mode > AsShared ()
 
TSharedRef< IEventLoop const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< IEventLoop, Mode > AsWeak ()
 
TWeakPtr< IEventLoop const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Additional Inherited Members

- Protected Member Functions inherited from TSharedFromThis< IEventLoop, ESPMode::ThreadSafe >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 
- Static Protected Member Functions inherited from TSharedFromThis< IEventLoop, ESPMode::ThreadSafe >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Constructor & Destructor Documentation

◆ TEventLoop()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
UE::EventLoop::TEventLoop< IOManagerType, Traits >::TEventLoop ( FParams &&  Params = FParams())
inline

◆ ~TEventLoop()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual UE::EventLoop::TEventLoop< IOManagerType, Traits >::~TEventLoop ( )
inlinevirtual

Member Function Documentation

◆ ClearTimer()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual void UE::EventLoop::TEventLoop< IOManagerType, Traits >::ClearTimer ( FTimerHandle InHandle,
FOnTimerCleared &&  OnTimerCleared = FOnTimerCleared() 
)
inlineoverridevirtual

Clears a previously set timer.

Thread safe.

Parameters
InHandleThe handle of the timer to clear.
OnTimerClearedCallback to be fired when the timer has been removed. The callback will be fired from within the event loops RunOnce method.

Implements UE::EventLoop::IEventLoop.

◆ GetIOAccess()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
IOManagerType::FIOAccess & UE::EventLoop::TEventLoop< IOManagerType, Traits >::GetIOAccess ( )
inline

◆ GetLoopTime()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual FTimespan UE::EventLoop::TEventLoop< IOManagerType, Traits >::GetLoopTime ( ) const
inlineoverridevirtual

◆ Init()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual bool UE::EventLoop::TEventLoop< IOManagerType, Traits >::Init ( )
inlineoverridevirtual

Initialize the event loop.

NOT thread safe.

Implements UE::EventLoop::IEventLoop.

◆ PostAsyncTask()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual void UE::EventLoop::TEventLoop< IOManagerType, Traits >::PostAsyncTask ( FAsyncTask &&  Task)
inlineoverridevirtual

Post a task to be run by the event loop. Queues the task to be run and signals the event loop to wake.

Thread safe.

Parameters
TaskThe task to be run.

Implements UE::EventLoop::IEventLoop.

◆ RequestShutdown()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual void UE::EventLoop::TEventLoop< IOManagerType, Traits >::RequestShutdown ( FOnShutdownComplete &&  OnShutdownComplete = FOnShutdownComplete())
inlineoverridevirtual

Signals a shutdown request to the event loop. May be signaled from any thread. Once Shutdown has been called, continue calling Poll until Invalidates the timer handle as it should no longer be used.

Thread safe.

Implements UE::EventLoop::IEventLoop.

◆ Run()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual void UE::EventLoop::TEventLoop< IOManagerType, Traits >::Run ( )
inlineoverridevirtual

◆ RunOnce()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual bool UE::EventLoop::TEventLoop< IOManagerType, Traits >::RunOnce ( FTimespan  WaitTime)
inlineoverridevirtual

◆ SetTimer()

template<typename IOManagerType , typename Traits = FEventLoopDefaultTraits>
virtual FTimerHandle UE::EventLoop::TEventLoop< IOManagerType, Traits >::SetTimer ( FTimerCallback &&  Callback,
FTimespan  InRate,
bool  InbRepeat = false,
TOptional< FTimespan InFirstDelay = TOptionalFTimespan >() 
)
inlineoverridevirtual

Set a new timer. The timer callback will be triggered from within the call to RunOnce, which may occur on a different thread from the one which set the timer.

Thread safe.

Parameters
CallbackCallback to call when timer fires.
InRateThe amount of time between set and firing.
InbRepeattrue to keep firing at Rate intervals, false to fire only once.
InFirstDelayThe time for the first iteration of a looping timer.
Returns
handle to the registered timer.

Implements UE::EventLoop::IEventLoop.


The documentation for this class was generated from the following file: