Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FScopedSlowTask Struct Reference

#include <ScopedSlowTask.h>

+ Inheritance diagram for FScopedSlowTask:
+ Collaboration diagram for FScopedSlowTask:

Public Member Functions

FORCEINLINE FScopedSlowTask (float InAmountOfWork, const FText &InDefaultMessage=FText(), bool bInEnabled=true, FFeedbackContext &InContext= *GWarn)
 
FORCEINLINE ~FScopedSlowTask ()
 
- Public Member Functions inherited from FSlowTask
 FSlowTask (float InAmountOfWork, const FText &InDefaultMessage=FText(), bool bInEnabled=true, FFeedbackContext &InContext= *GWarn)
 
void Initialize ()
 
void Destroy ()
 
void MakeDialogDelayed (float Threshold, bool bShowCancelButton=false, bool bAllowInPIE=false)
 
void MakeDialog (bool bShowCancelButton=false, bool bAllowInPIE=false)
 
void EnterProgressFrame (float ExpectedWorkThisFrame=1.f, const FText &Text=FText())
 
void TickProgress ()
 
const FTextGetCurrentMessage () const
 
bool ShouldCancel () const
 

Additional Inherited Members

- Static Public Member Functions inherited from FSlowTask
static bool ShouldCreateThrottledSlowTask ()
 
- Public Attributes inherited from FSlowTask
FText DefaultMessage
 
FText FrameMessage
 
float TotalAmountOfWork
 
float CompletedWork
 
float CurrentFrameScope
 
ESlowTaskVisibility Visibility
 
double StartTime
 
TOptional< floatOpenDialogThreshold
 

Detailed Description

A scope block representing an amount of work divided up into sections. Use one scope at the top of each function to give accurate feedback to the user of a slow operation's progress.

Example Usage: void DoSlowWork() { FScopedSlowTask Progress(2.f, LOCTEXT("DoingSlowWork", "Doing Slow Work...")); // Optionally make this show a dialog if not already shown Progress.MakeDialog();

// Indicate that we are entering a frame representing 1 unit of work Progress.EnterProgressFrame(1.f);

// DoFirstThing() can follow a similar pattern of creating a scope divided into frames. These contribute to their parent's progress frame proportionately. DoFirstThing();

Progress.EnterProgressFrame(1.f); DoSecondThing(); }

Definition at line 31 of file ScopedSlowTask.h.

Constructor & Destructor Documentation

◆ FScopedSlowTask()

FORCEINLINE FScopedSlowTask::FScopedSlowTask ( float InAmountOfWork,
const FText & InDefaultMessage = FText(),
bool bInEnabled = true,
FFeedbackContext & InContext = *GWarn )
inline

Construct this scope from an amount of work to do, and a message to display

Parameters
InAmountOfWorkArbitrary number of work units to perform (can be a percentage or number of steps). 0 indicates that no progress frames are to be entered in this scope (automatically enters a frame encompassing the entire scope)
InDefaultMessageA message to display to the user to describe the purpose of the scope
bInEnabledWhen false, this scope will have no effect. Allows for proper scoped objects that are conditionally disabled.

Definition at line 41 of file ScopedSlowTask.h.

+ Here is the call graph for this function:

◆ ~FScopedSlowTask()

FORCEINLINE FScopedSlowTask::~FScopedSlowTask ( )
inline

Definition at line 47 of file ScopedSlowTask.h.

+ Here is the call graph for this function:

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