engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FScopedSlowTask结构体 参考

A scope block representing an amount of work divided up into sections. 更多...

#include <ScopedSlowTask.h>

+ 类 FScopedSlowTask 继承关系图:

Public 成员函数

FORCEINLINE FScopedSlowTask (float InAmountOfWork, const FText &InDefaultMessage=FText(), bool bInEnabled=true, FFeedbackContext &InContext= *GWarn)
 Construct this scope from an amount of work to do, and a message to display 更多...
 
- Public 成员函数 继承自 FSlowTask
void Destroy ()
 Function that finishes any remaining work and removes itself from the global scope stack
 
void EnterProgressFrame (float ExpectedWorkThisFrame=1.f, const FText &Text=FText())
 Indicate that we are to enter a frame that will take up the specified amount of work. 更多...
 
 FSlowTask (float InAmountOfWork, const FText &InDefaultMessage=FText(), bool bInEnabled=true, FFeedbackContext &InContext= *GWarn)
 Construct this scope from an amount of work to do, and a message to display 更多...
 
const FText & GetCurrentMessage () const
 Get the frame message or default message if empty
 
void Initialize ()
 Function that initializes the scope by adding it to its context's stack
 
void MakeDialog (bool bShowCancelButton=false, bool bAllowInPIE=false)
 Creates a new dialog for this slow task, if there is currently not one open 更多...
 
void MakeDialogDelayed (float Threshold, bool bShowCancelButton=false, bool bAllowInPIE=false)
 Creates a new dialog for this slow task after the given time threshold. 更多...
 
bool ShouldCancel () const
 True if the user has requested that the slow task be canceled
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 FSlowTask
static bool ShouldCreateThrottledSlowTask ()
 True if a slow task should be created. 更多...
 
- Public 属性 继承自 FSlowTask
float CompletedWork
 The amount of work we have already completed in this scope
 
float CurrentFrameScope
 The amount of work the current frame is responsible for
 
FText DefaultMessage
 Default message to display to the user when not overridden by a frame
 
FText FrameMessage
 Message pertaining to the current frame's work
 
TOptional< float > OpenDialogThreshold
 Threshold before dialog is opened
 
double StartTime
 The time that this scope was created
 
float TotalAmountOfWork
 The amount of work to do in this scope
 
ESlowTaskVisibility Visibility
 The visibility of this slow task
 

详细描述

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(); }

构造及析构函数说明

◆ 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

参数
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.

该结构体的文档由以下文件生成: