Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FEvent Class Referenceabstract

#include <Event.h>

+ Inheritance diagram for FEvent:
+ Collaboration 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 ()
 
void AdvanceStats ()
 

Protected Member Functions

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

Protected Attributes

uint32 EventId
 
TAtomic< uint32EventStartCycles
 

Static Protected Attributes

static 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.

Definition at line 20 of file Event.h.

Constructor & Destructor Documentation

◆ FEvent()

FEvent::FEvent ( )
inline

Default constructor.

Definition at line 93 of file Event.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~FEvent()

virtual FEvent::~FEvent ( )
inlinevirtual

Virtual destructor.

Definition at line 99 of file Event.h.

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, 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 FPThreadEvent, and FSingleThreadEvent.

◆ Reset()

virtual void FEvent::Reset ( )
pure virtual

Resets the event to an untriggered (waitable) state.

See also
IsManualReset, Trigger

Implemented in FPThreadEvent, and FSingleThreadEvent.

◆ ResetForStats()

void FEvent::ResetForStats ( )
protected

Resets start cycles to 0.

+ Here is the caller graph for this function:

◆ Trigger()

virtual void FEvent::Trigger ( )
pure virtual

Triggers the event so any waiting threads are activated.

See also
IsManualReset, Reset

Implemented in FPThreadEvent, and FSingleThreadEvent.

+ Here is the caller graph for this function:

◆ TriggerForStats()

void FEvent::TriggerForStats ( )
protected

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

+ Here is the caller graph for this function:

◆ 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.

Definition at line 74 of file Event.h.

+ Here is the call graph for this function:

◆ 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.

Definition at line 86 of file Event.h.

+ Here is the call graph for this function:

◆ 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 FSingleThreadEvent, and FPThreadEvent.

+ Here is the caller graph for this function:

◆ 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.

Definition at line 121 of file Event.h.

◆ EventStartCycles

TAtomic<uint32> FEvent::EventStartCycles
protected

Greater than 0, if the event called wait.

Definition at line 124 of file Event.h.

◆ EventUniqueId

TAtomic<uint32> FEvent::EventUniqueId
staticprotected

Counter used to generate an unique id for the events.

Definition at line 118 of file Event.h.


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