Ark Server API (ASA) - Wiki
|
#include <GenericPlatformProcess.h>
Classes | |
struct | FSemaphore |
Public Types | |
enum class | EWaitAndForkResult : uint8 { Error , Parent , Child } |
Generic implementation for most platforms, these tend to be unused and unimplemented
Definition at line 131 of file GenericPlatformProcess.h.
Enumerator | |
---|---|
Error | |
Parent | |
Child |
Definition at line 500 of file GenericPlatformProcess.h.
|
inlinestatic |
Adds a directory to search in when resolving implicitly loaded or filename-only DLLs.
Definition at line 196 of file GenericPlatformProcess.h.
Get application settings directory. NOTE: Only one return value is valid at a time!
Get startup directory. NOTE: Only one return value is valid at a time!
Checks if the platform can launch a uniform resource locator (i.e. http://www.epicgames.com/unreal).
Clean the shader working directory.
Closes an anonymous pipe.
ReadPipe | The handle to the read end of the pipe. |
WritePipe | The handle to the write end of the pipe. |
|
static |
Cleans up FProcHandle after we're done with it.
ProcessHandle | handle returned from FPlatformProcess::CreateProc. |
Get computer name. NOTE: Only one return value is valid at a time!
|
static |
Sleep thread until condition is satisfied.
Condition | Condition to evaluate. |
SleepTime | Time to sleep |
|
static |
Creates a writable anonymous pipe.
Anonymous pipes can be used to capture and/or redirect STDOUT and STDERROR of a process. The pipe created by this method can be passed into CreateProc as Write
ReadPipe | Will hold the handle to the read end of the pipe. |
WritePipe | Will hold the handle to the write end of the pipe. @parm bWritePipeLocal indicates that the write pipe end will be used locally, instead of the read pipe |
|
static |
Creates a new process and its primary thread, with separate std pipes. The new process runs the specified executable file in the security context of the calling process.
URL | executable name |
Parms | command line arguments |
bLaunchDetached | if true, the new process will have its own window |
bLaunchHidden | if true, the new process will be minimized in the task bar |
bLaunchReallyHidden | if true, the new process will not have a window or be in the task bar |
OutProcessId | if non-NULL, this will be filled in with the ProcessId |
PriorityModifier | -2 idle, -1 low, 0 normal, 1 high, 2 higher |
OptionalWorkingDirectory | Directory to start in when running the program, or NULL to use the current working directory |
PipeWriteChild | Optional HANDLE to pipe for redirecting stdout |
PipeReadChild | Optional HANDLE to pipe for redirecting stdin |
PipeStdErrChild | Optional HANDLE to pipe for redirecting stderr |
|
static |
Creates a new process and its primary thread. The new process runs the specified executable file in the security context of the calling process.
URL | executable name |
Parms | command line arguments |
bLaunchDetached | if true, the new process will have its own window |
bLaunchHidden | if true, the new process will be minimized in the task bar |
bLaunchReallyHidden | if true, the new process will not have a window or be in the task bar |
OutProcessId | if non-NULL, this will be filled in with the ProcessId |
PriorityModifier | -2 idle, -1 low, 0 normal, 1 high, 2 higher |
OptionalWorkingDirectory | Directory to start in when running the program, or NULL to use the current working directory |
PipeWriteChild | Optional HANDLE to pipe for redirecting output |
PipeReadChild | Optional HANDLE to pipe for redirecting input |
|
static |
Creates the platform-specific runnable thread. This should only be called from FRunnableThread::Create.
|
static |
Creates a new event.
bIsManualReset | Whether the event requires manual reseting or not. |
Makes process run as a system service (daemon), i.e. detaches it from whatever user session it was initially run from.
|
static |
Deletes an interprocess synchronization object.
Object | object to destroy. |
Output information about the currently active thread
Definition at line 257 of file GenericPlatformProcess.h.
|
static |
Executes a process as administrator, requesting elevation as necessary. This call blocks until the process has returned.
|
static |
Executes a process, returning the return code, stdout, and stderr. This call blocks until the process has returned.
OutReturnCode | may be 0 |
OutStdOut | may be 0 |
OutStdErr | may be 0 @OptionalWorkingDirectory may be 0 @OptionalbShouldEndWithParentProcess false by default. True to make sure the process is killed with the parent processor (Not Supported on all Platforms) |
Return the name of the currently running executable
bRemoveExtension | true to remove the extension of the executable name, false to leave it intact |
Return the path to the currently running executable
Attempt to "explore" the folder specified by the provided file path
FilePath | File path specifying a folder to explore |
Deletes all the recycled sync events contained by the pools
|
static |
Generates the path to the specified application or game.
The application must reside in the Engine's binaries directory. The returned path is relative to this executable's directory.For example, calling this method with "UE4" and EBuildConfiguration::Debug on Windows 64-bit will generate the path "../Win64/UnrealEditor-Win64-Debug.exe"
AppName | The name of the application or game. |
BuildConfiguration | The build configuration of the game. |
|
static |
Outputs the virtual memory usage, of the process with the specified PID
Returns the Name of process given by the PID. Returns Empty string "" if PID not found.
Used only by platforms with DLLs, this gives the subdirectory from binaries to find the executables
Retrieves the current hardware CPU core
Retrieves the ProcessId of this process.
Get the current working directory (only really makes sense on desktop platforms)
|
static |
specifies the thread to use for UObject reference collection
|
inlinestatic |
Get the list of registered directories to search in when resolving implicitly loaded or filename-only DLLs.
Definition at line 214 of file GenericPlatformProcess.h.
|
static |
Lookup the address of a DLL function.
Retrieves the platform-specific bundle identifier or package name of the game
Return the extension of dynamic library
Return the prefix of dynamic library (e.g. lib)
Used only by platforms with DLLs, this gives the full path to the main directory containing modules
|
static |
Retrieves the termination status of the specified process.
Get the active stack size for the currently running thread
|
static |
Gets an event from the pool or creates a new one if necessary.
bIsManualReset | Whether the event requires manual reseting or not. |
Returns true if the specified application is running
Returns true if the specified application is running
Checks if we're the first instance. An instance can become first if the previous first instance quits before it.
|
static |
Returns true if the specified process is running
ProcessHandle | handle returned from FPlatformProcess::CreateProc |
|
static |
Attempt to launch the provided file name in its default external application. Similar to FPlatformProcess::LaunchURL, with the exception that if a default application isn't found for the file, the user will be prompted with an "Open With..." dialog.
FileName | Name of the file to attempt to launch in its default external application |
Parms | Optional parameters to the default application |
Verb | Optional verb to use when opening the file, if it applies for the platform. |
|
static |
Launch a uniform resource locator (i.e. http://www.epicgames.com/unreal). This is expected to return immediately as the URL is launched by another task. The URL param must already be a valid URL. If you're looking for code to properly escape a URL fragment, use FGenericPlatformHttp::UrlEncode.
|
static |
Launch a uniform resource locator (i.e. http://www.epicgames.com/unreal). This is expected to return immediately as the URL is launched by another task. The URL param must already be a valid URL. The URL is passed through the filter parameter for an added measure of security if the URL is from and untrusted source. If you're looking for code to properly escape a URL fragment, use FGenericPlatformHttp::UrlEncode.
|
static |
allows a platform to override the threading configuration for reference collection
|
static |
Creates or opens an interprocess synchronization object.
Name | name (so we can use it across processes). |
bCreate | If true, the function will try to create, otherwise will try to open existing. |
MaxLocks | Maximum amount of locks that the semaphore can have (pass 1 to make it act as mutex). |
|
static |
Creates or opens an interprocess synchronization object.
Name | name (so we can use it across processes). |
bCreate | If true, the function will try to create, otherwise will try to open existing. |
MaxLocks | Maximum amount of locks that the semaphore can have (pass 1 to make it act as mutex). |
|
static |
Opens an existing process.
ProcessID | The process id of the process for which we want to obtain a handle. |
|
inlinestatic |
Unsets a directory to look for DLL files. The same directory must be passed in as the Push call to validate
Definition at line 208 of file GenericPlatformProcess.h.
|
inlinestatic |
Set a directory to look for DLL files. NEEDS to have a Pop call when complete
Definition at line 202 of file GenericPlatformProcess.h.
Reads all pending data from an anonymous pipe, such as STDOUT or STDERROR of a process.
Pipe | The handle to the pipe to read from. |
|
static |
Reads all pending data from an anonymous pipe, such as STDOUT or STDERROR of a process.
Pipe | The handle to the pipe to read from. |
Output | The data read. |
Returns an event to the pool.
Event | The event to return. |
|
inlinestatic |
Sets the process limits.
Resource | one of process resources. |
Limit | the maximum amount of the resource (for some OS, this means both hard and soft limits). |
Definition at line 314 of file GenericPlatformProcess.h.
Enables Real Time Mode on the current thread.
Definition at line 703 of file GenericPlatformProcess.h.
Change the thread processor affinity
AffinityMask | A bitfield indicating what processors the thread is allowed to run on. |
Helper function to set thread name of the current thread.
ThreadName | Name to set |
Definition at line 251 of file GenericPlatformProcess.h.
|
static |
Change the thread processor priority
NewPriority | an EThreadPriority indicating what priority the thread is to run at. |
Allow the platform to do anything it needs for audio thread
Definition at line 269 of file GenericPlatformProcess.h.
Allow the platform to do anything it needs for game thread
Definition at line 260 of file GenericPlatformProcess.h.
Allow the platform to do anything it needs for render thread
Definition at line 263 of file GenericPlatformProcess.h.
Allow the platform to do anything it needs for the RHI thread
Definition at line 266 of file GenericPlatformProcess.h.
Get the shader working directory.
Content saved to the game or engine directories should be rerouted to user directories instead
force skip calling FThreadStats::WaitForStats()
Definition at line 752 of file GenericPlatformProcess.h.
Gets whether this platform can use multiple threads.
Allow the platform to tear down the audio thread
Definition at line 272 of file GenericPlatformProcess.h.
|
static |
Terminates a process
ProcessHandle | handle returned from FPlatformProcess::CreateProc |
KillTree | Whether the entire process tree should be terminated. |
|
static |
Terminates a process tree
ProcessHandle | handle returned from FPlatformProcess::CreateProc |
Predicate | that returns true if the process identified by ProcessId and ApplicationName should be terminated with its children, else that process and its children will be kept alive |
Get user directory. NOTE: Only one return value is valid at a time!
Get the user home directory. NOTE: Only one return value is valid at a time!
Get user name. NOTE: Only one return value is valid at a time!
Get the user settings directory. NOTE: Only one return value is valid at a time!
Get the user temporary directory. NOTE: Only one return value is valid at a time!
|
static |
Waits for process signals and forks child processes.
WaitAndFork stalls the invoking process and forks child processes when signals are sent to it from an external source. Forked child processes will provide a return value of EWaitAndForkResult::Child, while the parent process will not return until IsEngineExitRequested() is true (EWaitAndForkResult::Parent) or there was an error (EWaitAndForkResult::Error) The signal the parent process expects is platform-specific (i.e. SIGRTMIN+1 on Linux).
|
static |
Waits for a process to stop
ProcessHandle | handle returned from FPlatformProcess::CreateProc |
|
static |
Sends the message to process through pipe
WritePipe | Pipe for writing. |
Message | The message to be written. |
OutWritten | Optional parameter to know how much of the string written. |
|
static |
Sends data to process through pipe
WritePipe | Pipe for writing. |
Data | The data to be written. |
DataLength | how many bytes to write. |
OutDataLength | Optional parameter to know how many bytes had been written. |
|
inlinestatic |
Tells the processor to pause for implementation-specific amount of time. Is used for spin-loops to improve the speed at which the code detects the release of the lock and power-consumption.
Definition at line 768 of file GenericPlatformProcess.h.
|
inlinestatic |
Tells the processor to pause for at least the amount of cycles given. Is used for spin-loops to improve the speed at which the code detects the release of the lock and power-consumption.
Definition at line 787 of file GenericPlatformProcess.h.