UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FEvent Class Referenceabstract

#include <Event.h>

+ Inheritance diagram for FEvent:

Public Member Functions

virtual bool Create (bool bIsManualReset=false)=0
 
virtual bool IsManualReset ()=0
 
virtual void Trigger ()=0
 
virtual void Reset ()=0
 
virtual bool Wait (uint32 WaitTime, const bool bIgnoreThreadIdleStats=false)=0
 
bool Wait ()
 
bool Wait (const FTimespan &WaitTime, const bool bIgnoreThreadIdleStats=false)
 
 FEvent ()
 
virtual ~FEvent ()
 
CORE_API void AdvanceStats ()
 

Protected Member Functions

CORE_API void WaitForStats ()
 
CORE_API void TriggerForStats ()
 
CORE_API void ResetForStats ()
 

Protected Attributes

uint32 EventId
 
TAtomic< uint32EventStartCycles
 

Static Protected Attributes

static CORE_API TAtomic< uint32EventUniqueId
 

Detailed Description

Interface for waitable events.

This interface has platform-specific implementations that are used to wait for another thread to signal that it is ready for the waiting thread to do some work. It can also be used for telling groups of threads to exit.

Consider using FEventRef as a safer and more convenient alternative.

Constructor & Destructor Documentation

◆ FEvent()

FEvent::FEvent ( )
inline

Default constructor.

◆ ~FEvent()

virtual FEvent::~FEvent ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ AdvanceStats()

void FEvent::AdvanceStats ( )

Advances stats associated with this event. Used to monitor wait->trigger history.

◆ Create()

virtual bool FEvent::Create ( bool  bIsManualReset = false)
pure virtual

Creates the event.

Manually reset events stay triggered until reset. Named events share the same underlying event.

Parameters
bIsManualResetWhether the event requires manual reseting or not.
Returns
true if the event was created, false otherwise.

Implemented in FPThreadEvent, FSafeRecyclableEvent, FEventWin, and FSingleThreadEvent.

◆ IsManualReset()

virtual bool FEvent::IsManualReset ( )
pure virtual

Whether the signaled state of this event needs to be reset manually.

Returns
true if the state requires manual resetting, false otherwise.
See also
Reset

Implemented in FSafeRecyclableEvent, FEventWin, FPThreadEvent, and FSingleThreadEvent.

◆ Reset()

virtual void FEvent::Reset ( )
pure virtual

Resets the event to an untriggered (waitable) state.

See also
IsManualReset, Trigger

Implemented in FSafeRecyclableEvent, FEventWin, FPThreadEvent, and FSingleThreadEvent.

◆ ResetForStats()

void FEvent::ResetForStats ( )
protected

Resets start cycles to 0.

◆ Trigger()

virtual void FEvent::Trigger ( )
pure virtual

Triggers the event so any waiting threads are activated.

See also
IsManualReset, Reset

Implemented in FSafeRecyclableEvent, FEventWin, FPThreadEvent, and FSingleThreadEvent.

◆ TriggerForStats()

void FEvent::TriggerForStats ( )
protected

Send to the stats a special message which encodes a trigger for the event.

◆ Wait() [1/3]

bool FEvent::Wait ( )
inline

Waits an infinite amount of time for the event to be triggered.

Returns
true if the event was triggered.

◆ Wait() [2/3]

bool FEvent::Wait ( const FTimespan WaitTime,
const bool  bIgnoreThreadIdleStats = false 
)
inline

Waits the specified amount of time for the event to be triggered.

Parameters
WaitTimeThe time to wait.
bIgnoreThreadIdleStatsIf true, ignores ThreadIdleStats
Returns
true if the event was triggered, false if the wait timed out.

◆ Wait() [3/3]

virtual bool FEvent::Wait ( uint32  WaitTime,
const bool  bIgnoreThreadIdleStats = false 
)
pure virtual

Waits the specified amount of time for the event to be triggered.

A wait time of MAX_uint32 is treated as infinite wait.

Parameters
WaitTimeThe time to wait (in milliseconds).
bIgnoreThreadIdleStatsIf true, ignores ThreadIdleStats
Returns
true if the event was triggered, false if the wait timed out.

Implemented in FSafeRecyclableEvent, FEventWin, FSingleThreadEvent, and FPThreadEvent.

◆ WaitForStats()

void FEvent::WaitForStats ( )
protected

Sends to the stats a special messages which encodes a wait for the event.

Member Data Documentation

◆ EventId

uint32 FEvent::EventId
protected

An unique id of this event.

◆ EventStartCycles

TAtomic<uint32> FEvent::EventStartCycles
protected

Greater than 0, if the event called wait.

◆ EventUniqueId

TAtomic< uint32 > FEvent::EventUniqueId
staticprotected

Counter used to generate an unique id for the events.


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