SystemProcessInterface Class Reference

#include <system_process.h>

详细描述

This interface allows to access and create system processes.

静态公共成员函数

static MAXON_METHOD Result < SystemProcessObjectRef >  CreateProcess (const Url &programPath, const ArrayInterface < String > &arguments, EXECUTEPROGRAMFLAGS flags, void *userData, const InOutputStreamRef &stdinPipe=InOutputStreamRef(), const InOutputStreamRef &stdoutPipe=InOutputStreamRef(), const InOutputStreamRef &stderrPipe=InOutputStreamRef())
static MAXON_METHOD Result < SystemProcessObjectRef >  StartProcessAndWait (const Url &programPath, const ArrayInterface < String > &arguments, EXECUTEPROGRAMFLAGS flags, ExecuteProgramCallback callback, void *userData)
static MAXON_METHOD Result < void >  GetSystemProcesses (const ValueReceiver < const SystemProcessObjectRef & > &processes)
static MAXON_METHOD UInt   GetCurrentProcessId ()
static MAXON_METHOD Result < SystemProcessObjectRef >  GetProcess ( UInt id)
static MAXON_METHOD Result < WAIT_PROCESS_RESULT WaitForProcess (const SystemProcessObjectRef &processRef, const TimeValue &timeout)

私有成员函数

  MAXON_INTERFACE_NONVIRTUAL ( SystemProcessInterface , MAXON_REFERENCE_NONE , "net.maxon.interface.systemprocess")

成员函数文档编制

◆  MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( SystemProcessInterface   ,
MAXON_REFERENCE_NONE   ,
"net.maxon.interface.systemprocess"   
)
private

◆  CreateProcess()

static MAXON_METHOD Result <SystemProcessObjectRef> CreateProcess ( const Url programPath ,
const ArrayInterface < String > &  arguments ,
EXECUTEPROGRAMFLAGS   flags ,
void *  userData ,
const InOutputStreamRef &  stdinPipe = InOutputStreamRef() ,
const InOutputStreamRef &  stdoutPipe = InOutputStreamRef() ,
const InOutputStreamRef &  stderrPipe = InOutputStreamRef()  
)
static

Prepares an executable to be executed as a process. If EXECUTEPROGRAMFLAGS::CAPTURELOGFILE is set all pipe parameters will be ignored.

参数
[in] programPath File path to the executable. It needs to be a valid path to a URLSCHEME_FILESYSTEM path. If an stdout and stderr pipe is used CAPTURELOGFILE will be ignored.
[in] arguments Array of parameters to start the executable with.
[in] flags See EXECUTEPROGRAMFLAGS flags.
[in] userData User data that can be attached to this process.
[in] stdinPipe Pipe where stdin is redirected to.
[in] stdoutPipe Pipe where stdout is redirected to.
[in] stderrPipe Pipe where stderr is redirected to.
返回
Reference object to a system process.

◆  StartProcessAndWait()

static MAXON_METHOD Result <SystemProcessObjectRef> StartProcessAndWait ( const Url programPath ,
const ArrayInterface < String > &  arguments ,
EXECUTEPROGRAMFLAGS   flags ,
ExecuteProgramCallback   callback ,
void *  userData  
)
static

Starts and waits for a process.

参数
[in] programPath File path to the executable. It needs to be a valid path to a URLSCHEME_FILESYSTEM path.
[in] arguments Array of parameters to start the executable with.
[in] flags See EXECUTEPROGRAMFLAGS flags.
[in] callback Pointer to a Callback function called while the executable is running. See ExecuteProgramCallback.
[in] userData User data that can be attached to this process.
返回
Reference object to a system process. Please note that the process is already done. You can use this handle to determine the log file or the exit code.

◆  GetSystemProcesses()

static MAXON_METHOD Result <void> GetSystemProcesses ( const ValueReceiver < const SystemProcessObjectRef & > &  processes )
static

Enumerates all system processes and returns a list of them.

参数
[out] processes The receiver for the system processes.
返回
OK on success.

◆  GetCurrentProcessId()

static MAXON_METHOD UInt GetCurrentProcessId ( )
static

Gets the process ID of the current running process.

返回
The current process ID.

◆  GetProcess()

static MAXON_METHOD Result <SystemProcessObjectRef> GetProcess ( UInt   id )
static

Creates a process object for the given process ID. The returned object will have only limited capabilities. E.g. you cannot get the logfile or user data.

参数
[in] id ID of the process you want to create an object for.
返回
Reference object to a system process.

◆  WaitForProcess()

static MAXON_METHOD Result < WAIT_PROCESS_RESULT > WaitForProcess ( const SystemProcessObjectRef &  processRef ,
const TimeValue timeout  
)
static

Waits for the given process to finish.

参数
[in] processRef Process object to wait for.
[in] timeout Timeout to wait for the process to finish.
返回
Returns whether the process is still running or not.