engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | 所有成员列表
FMonitoredProcess类 参考

Implements an external process that can be monitored. 更多...

#include <MonitoredProcess.h>

+ 类 FMonitoredProcess 继承关系图:

Public 成员函数

void Cancel (bool InKillTree=false)
 Cancels the process. 更多...
 
virtual void Exit () override
 Exits the runnable object. 更多...
 
 FMonitoredProcess (const FString &InURL, const FString &InParams, bool InHidden, bool InCreatePipes=true)
 Creates a new monitored process. 更多...
 
 FMonitoredProcess (const FString &InURL, const FString &InParams, const FString &InWorkingDir, bool InHidden, bool InCreatePipes=true)
 Creates a new monitored process. 更多...
 
FTimespan GetDuration () const
 Gets the duration of time that the task has been running. 更多...
 
FProcHandle GetProcessHandle () const
 Gets the Process Handle. 更多...
 
int GetReturnCode () const
 Returns the return code from the exited process 更多...
 
virtual FSingleThreadRunnable * GetSingleThreadInterface () override
 Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. 更多...
 
virtual bool Init () override
 Initializes the runnable object. 更多...
 
bool Launch ()
 Launches the process.
 
FSimpleDelegate & OnCanceled ()
 Returns a delegate that is executed when the process has been canceled. 更多...
 
FOnMonitoredProcessCompleted & OnCompleted ()
 Returns a delegate that is executed when a monitored process completed. 更多...
 
FOnMonitoredProcessOutput & OnOutput ()
 Returns a delegate that is executed when a monitored process produces output. 更多...
 
virtual uint32 Run () override
 Runs the runnable object. 更多...
 
void SetSleepInterval (float InSleepInterval)
 Sets the sleep interval to be used in the main thread loop. 更多...
 
virtual void Stop () override
 Stops the runnable object. 更多...
 
bool Update ()
 Checks whether the process is still running. 更多...
 
 ~FMonitoredProcess ()
 Destructor.
 
- Public 成员函数 继承自 FRunnable
virtual void Exit ()
 Exits the runnable object. 更多...
 
virtual class FSingleThreadRunnable * GetSingleThreadInterface ()
 Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. 更多...
 
virtual bool Init ()
 Initializes the runnable object. 更多...
 
virtual uint32 Run ()=0
 Runs the runnable object. 更多...
 
virtual void Stop ()
 Stops the runnable object. 更多...
 
virtual ~FRunnable ()
 Virtual destructor
 

Protected 成员函数

void ProcessOutput (const FString &Output)
 Processes the given output string. 更多...
 
void Tick () override
 FSingleThreadRunnable interface
 

详细描述

Implements an external process that can be monitored.

构造及析构函数说明

◆ FMonitoredProcess() [1/2]

FMonitoredProcess::FMonitoredProcess ( const FString &  InURL,
const FString &  InParams,
bool  InHidden,
bool  InCreatePipes = true 
)

Creates a new monitored process.

参数
InURLThe URL of the executable to launch.
InParamsThe command line parameters.
InHiddenWhether the window of the process should be hidden.
InCreatePipesWhether the output should be redirected to the caller.

◆ FMonitoredProcess() [2/2]

FMonitoredProcess::FMonitoredProcess ( const FString &  InURL,
const FString &  InParams,
const FString &  InWorkingDir,
bool  InHidden,
bool  InCreatePipes = true 
)

Creates a new monitored process.

参数
InURLThe URL of the executable to launch.
InParamsThe command line parameters.
InHiddenWhether the window of the process should be hidden.
InWorkingDirThe URL of the working dir where the executable should launch.
InCreatePipesWhether the output should be redirected to the caller.

成员函数说明

◆ Cancel()

void FMonitoredProcess::Cancel ( bool  InKillTree = false)
inline

Cancels the process.

参数
InKillTreeWhether to kill the entire process tree when canceling this process.

◆ Exit()

virtual void FMonitoredProcess::Exit ( )
inlineoverridevirtual

Exits the runnable object.

Called in the context of the aggregating thread to perform any cleanup.

参见
Init, Run, Stop

重载 FRunnable .

◆ GetDuration()

FTimespan FMonitoredProcess::GetDuration ( ) const

Gets the duration of time that the task has been running.

返回
Time duration.

◆ GetProcessHandle()

FProcHandle FMonitoredProcess::GetProcessHandle ( ) const
inline

Gets the Process Handle.

The instance can be invalid if the process was not created.

返回
The Process Handle

◆ GetReturnCode()

int FMonitoredProcess::GetReturnCode ( ) const
inline

Returns the return code from the exited process

返回
Process return code

◆ GetSingleThreadInterface()

virtual FSingleThreadRunnable * FMonitoredProcess::GetSingleThreadInterface ( )
inlineoverridevirtual

Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled.

If the interface is not implemented, this runnable will not be ticked when FPlatformProcess::SupportsMultithreading() is false.

返回
Pointer to the single thread interface or nullptr if not implemented.

重载 FRunnable .

◆ Init()

virtual bool FMonitoredProcess::Init ( )
inlineoverridevirtual

Initializes the runnable object.

This method is called in the context of the thread object that aggregates this, not the thread that passes this runnable to a new thread.

返回
True if initialization was successful, false otherwise
参见
Run, Stop, Exit

重载 FRunnable .

◆ OnCanceled()

FSimpleDelegate & FMonitoredProcess::OnCanceled ( )
inline

Returns a delegate that is executed when the process has been canceled.

返回
The delegate.

◆ OnCompleted()

FOnMonitoredProcessCompleted & FMonitoredProcess::OnCompleted ( )
inline

Returns a delegate that is executed when a monitored process completed.

返回
The delegate.

◆ OnOutput()

FOnMonitoredProcessOutput & FMonitoredProcess::OnOutput ( )
inline

Returns a delegate that is executed when a monitored process produces output.

返回
The delegate.

◆ ProcessOutput()

void FMonitoredProcess::ProcessOutput ( const FString &  Output)
protected

Processes the given output string.

参数
OutputThe output string to process.

◆ Run()

virtual uint32 FMonitoredProcess::Run ( )
overridevirtual

Runs the runnable object.

This is where all per object thread work is done. This is only called if the initialization was successful.

返回
The exit code of the runnable object
参见
Init, Stop, Exit

实现了 FRunnable.

◆ SetSleepInterval()

void FMonitoredProcess::SetSleepInterval ( float  InSleepInterval)
inline

Sets the sleep interval to be used in the main thread loop.

参数
InSleepIntervalThe Sleep interval to use.

◆ Stop()

virtual void FMonitoredProcess::Stop ( )
inlineoverridevirtual

Stops the runnable object.

This is called if a thread is requested to terminate early.

参见
Init, Run, Exit

重载 FRunnable .

◆ Update()

bool FMonitoredProcess::Update ( )

Checks whether the process is still running.

In single threaded mode, this will tick the thread processing

返回
true if the process is running, false otherwise.

该类的文档由以下文件生成: