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

#include <GenericPlatformProcess.h>

+ Inheritance diagram for FGenericPlatformProcess:

Classes

struct  FSemaphore
 

Public Types

enum class  EWaitAndForkResult : uint8 { Error , Parent , Child }
 

Static Public Member Functions

static voidGetDllHandle (const TCHAR *Filename)
 
static void FreeDllHandle (void *DllHandle)
 
static voidGetDllExport (void *DllHandle, const TCHAR *ProcName)
 
static FORCEINLINE void AddDllDirectory (const TCHAR *Directory)
 
static FORCEINLINE void PushDllDirectory (const TCHAR *Directory)
 
static FORCEINLINE void PopDllDirectory (const TCHAR *Directory)
 
static FORCEINLINE void GetDllDirectories (TArray< FString > &OutDllDirectories)
 
static uint32 GetCurrentProcessId ()
 
static uint32 GetCurrentCoreNumber ()
 
static void SetThreadAffinityMask (uint64 AffinityMask)
 
static void SetThreadPriority (EThreadPriority NewPriority)
 
static void SetThreadName (const TCHAR *ThreadName)
 
static uint32 GetStackSize ()
 
static void DumpThreadInfo (const TCHAR *MarkerName)
 
static void SetupGameThread ()
 
static void SetupRenderThread ()
 
static void SetupRHIThread ()
 
static void SetupAudioThread ()
 
static void TeardownAudioThread ()
 
static bool ShouldSaveToUserDir ()
 
static const TCHAR * BaseDir ()
 
static const TCHAR * UserDir ()
 
static const TCHAR * UserSettingsDir ()
 
static const TCHAR * UserTempDir ()
 
static const TCHAR * UserHomeDir ()
 
static const TCHAR * ApplicationSettingsDir ()
 
static const TCHAR * ComputerName ()
 
static const TCHAR * UserName (bool bOnlyAlphaNumeric=true)
 
static const TCHAR * ShaderDir ()
 
static void SetShaderDir (const TCHAR *Where)
 
static void SetCurrentWorkingDirectoryToBaseDir ()
 
static FString GetCurrentWorkingDirectory ()
 
static bool SetProcessLimits (EProcessResource::Type Resource, uint64 Limit)
 
static const FString ShaderWorkingDir ()
 
static void CleanShaderWorkingDir ()
 
static const TCHAR * ExecutablePath ()
 
static const TCHAR * ExecutableName (bool bRemoveExtension=true)
 
static FString GenerateApplicationPath (const FString &AppName, EBuildConfiguration BuildConfiguration)
 
static const TCHAR * GetModulePrefix ()
 
static const TCHAR * GetModuleExtension ()
 
static const TCHAR * GetBinariesSubdirectory ()
 
static const FString GetModulesDirectory ()
 
static void LaunchURL (const TCHAR *URL, const TCHAR *Parms, FString *Error)
 
static bool LaunchURLFiltered (const TCHAR *URL, const TCHAR *Parms, FString *Error, const UE::Core::FURLRequestFilter &Filter)
 
static bool CanLaunchURL (const TCHAR *URL)
 
static FString GetGameBundleId ()
 
static FProcHandle CreateProc (const TCHAR *URL, const TCHAR *Parms, bool bLaunchDetached, bool bLaunchHidden, bool bLaunchReallyHidden, uint32 *OutProcessID, int32 PriorityModifier, const TCHAR *OptionalWorkingDirectory, void *PipeWriteChild, void *PipeReadChild=nullptr)
 
static FProcHandle CreateProc (const TCHAR *URL, const TCHAR *Parms, bool bLaunchDetached, bool bLaunchHidden, bool bLaunchReallyHidden, uint32 *OutProcessID, int32 PriorityModifier, const TCHAR *OptionalWorkingDirectory, void *PipeWriteChild, void *PipeReadChild, void *PipeStdErrChild)
 
static FProcHandle OpenProcess (uint32 ProcessID)
 
static bool IsProcRunning (FProcHandle &ProcessHandle)
 
static void WaitForProc (FProcHandle &ProcessHandle)
 
static void CloseProc (FProcHandle &ProcessHandle)
 
static void TerminateProc (FProcHandle &ProcessHandle, bool KillTree=false)
 
static void TerminateProcTreeWithPredicate (FProcHandle &ProcessHandle, TFunctionRef< bool(uint32 ProcessId, const TCHAR *ApplicationName)> Predicate)
 
static EWaitAndForkResult WaitAndFork ()
 
static bool GetProcReturnCode (FProcHandle &ProcHandle, int32 *ReturnCode)
 
static bool IsApplicationRunning (uint32 ProcessId)
 
static bool IsApplicationRunning (const TCHAR *ProcName)
 
static FString GetApplicationName (uint32 ProcessId)
 
static bool GetApplicationMemoryUsage (uint32 ProcessId, SIZE_T *OutMemoryUsage)
 
static bool ExecProcess (const TCHAR *URL, const TCHAR *Params, int32 *OutReturnCode, FString *OutStdOut, FString *OutStdErr, const TCHAR *OptionalWorkingDirectory=NULL, bool bShouldEndWithParentProcess=false)
 
static bool ExecElevatedProcess (const TCHAR *URL, const TCHAR *Params, int32 *OutReturnCode)
 
static bool LaunchFileInDefaultExternalApplication (const TCHAR *FileName, const TCHAR *Parms=NULL, ELaunchVerb::Type Verb=ELaunchVerb::Open, bool bPromptToOpenOnFailure=true)
 
static void ExploreFolder (const TCHAR *FilePath)
 
static void ConditionalSleep (TFunctionRef< bool()> Condition, float SleepTime=0.0f)
 
static class FEventCreateSynchEvent (bool bIsManualReset=false)
 
static class FEventGetSynchEventFromPool (bool bIsManualReset=false)
 
static void FlushPoolSyncEvents ()
 
static void ReturnSynchEventToPool (FEvent *Event)
 
static class FRunnableThreadCreateRunnableThread ()
 
static void ClosePipe (void *ReadPipe, void *WritePipe)
 
static bool CreatePipe (void *&ReadPipe, void *&WritePipe, bool bWritePipeLocal=false)
 
static FString ReadPipe (void *ReadPipe)
 
static bool ReadPipeToArray (void *ReadPipe, TArray< uint8 > &Output)
 
static bool WritePipe (void *WritePipe, const FString &Message, FString *OutWritten=nullptr)
 
static bool WritePipe (void *WritePipe, const uint8 *Data, const int32 DataLength, int32 *OutDataLength=nullptr)
 
static bool SupportsMultithreading ()
 
static void SetRealTimeMode ()
 
static FSemaphoreNewInterprocessSynchObject (const FString &Name, bool bCreate, uint32 MaxLocks=1)
 
static FSemaphoreNewInterprocessSynchObject (const TCHAR *Name, bool bCreate, uint32 MaxLocks=1)
 
static bool DeleteInterprocessSynchObject (FSemaphore *Object)
 
static bool Daemonize ()
 
static bool IsFirstInstance ()
 
static void TearDown ()
 
static bool SkipWaitForStats ()
 
static ENamedThreads::Type GetDesiredThreadForUObjectReferenceCollector ()
 
static void ModifyThreadAssignmentForUObjectReferenceCollector (int32 &NumThreads, int32 &NumBackgroundThreads, ENamedThreads::Type &NormalThreadName, ENamedThreads::Type &BackgroundThreadName)
 
static FORCEINLINE void Yield ()
 
static FORCEINLINE void YieldCycles (uint64 Cycles)
 

Detailed Description

Generic implementation for most platforms, these tend to be unused and unimplemented

Definition at line 131 of file GenericPlatformProcess.h.

Member Enumeration Documentation

◆ EWaitAndForkResult

Enumerator
Error 
Parent 
Child 

Definition at line 500 of file GenericPlatformProcess.h.

Member Function Documentation

◆ AddDllDirectory()

static FORCEINLINE void FGenericPlatformProcess::AddDllDirectory ( const TCHAR * Directory)
inlinestatic

Adds a directory to search in when resolving implicitly loaded or filename-only DLLs.

Definition at line 196 of file GenericPlatformProcess.h.

◆ ApplicationSettingsDir()

static const TCHAR * FGenericPlatformProcess::ApplicationSettingsDir ( )
static

Get application settings directory. NOTE: Only one return value is valid at a time!

◆ BaseDir()

static const TCHAR * FGenericPlatformProcess::BaseDir ( )
static

Get startup directory. NOTE: Only one return value is valid at a time!

◆ CanLaunchURL()

static bool FGenericPlatformProcess::CanLaunchURL ( const TCHAR * URL)
static

Checks if the platform can launch a uniform resource locator (i.e. http://www.epicgames.com/unreal).

◆ CleanShaderWorkingDir()

static void FGenericPlatformProcess::CleanShaderWorkingDir ( )
static

Clean the shader working directory.

◆ ClosePipe()

static void FGenericPlatformProcess::ClosePipe ( void * ReadPipe,
void * WritePipe )
static

Closes an anonymous pipe.

Parameters
ReadPipeThe handle to the read end of the pipe.
WritePipeThe handle to the write end of the pipe.
See also
CreatePipe, ReadPipe

◆ CloseProc()

static void FGenericPlatformProcess::CloseProc ( FProcHandle & ProcessHandle)
static

Cleans up FProcHandle after we're done with it.

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc.

◆ ComputerName()

static const TCHAR * FGenericPlatformProcess::ComputerName ( )
static

Get computer name. NOTE: Only one return value is valid at a time!

◆ ConditionalSleep()

static void FGenericPlatformProcess::ConditionalSleep ( TFunctionRef< bool()> Condition,
float SleepTime = 0.0f )
static

Sleep thread until condition is satisfied.

Parameters
ConditionCondition to evaluate.
SleepTimeTime to sleep

◆ CreatePipe()

static bool FGenericPlatformProcess::CreatePipe ( void *& ReadPipe,
void *& WritePipe,
bool bWritePipeLocal = false )
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

Parameters
ReadPipeWill hold the handle to the read end of the pipe.
WritePipeWill 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
Returns
true on success, false otherwise.
See also
ClosePipe, ReadPipe

◆ CreateProc() [1/2]

static FProcHandle FGenericPlatformProcess::CreateProc ( const TCHAR * URL,
const TCHAR * Parms,
bool bLaunchDetached,
bool bLaunchHidden,
bool bLaunchReallyHidden,
uint32 * OutProcessID,
int32 PriorityModifier,
const TCHAR * OptionalWorkingDirectory,
void * PipeWriteChild,
void * PipeReadChild,
void * PipeStdErrChild )
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.

Parameters
URLexecutable name
Parmscommand line arguments
bLaunchDetachedif true, the new process will have its own window
bLaunchHiddenif true, the new process will be minimized in the task bar
bLaunchReallyHiddenif true, the new process will not have a window or be in the task bar
OutProcessIdif non-NULL, this will be filled in with the ProcessId
PriorityModifier-2 idle, -1 low, 0 normal, 1 high, 2 higher
OptionalWorkingDirectoryDirectory to start in when running the program, or NULL to use the current working directory
PipeWriteChildOptional HANDLE to pipe for redirecting stdout
PipeReadChildOptional HANDLE to pipe for redirecting stdin
PipeStdErrChildOptional HANDLE to pipe for redirecting stderr
Returns
The process handle for use in other process functions

◆ CreateProc() [2/2]

static FProcHandle FGenericPlatformProcess::CreateProc ( const TCHAR * URL,
const TCHAR * Parms,
bool bLaunchDetached,
bool bLaunchHidden,
bool bLaunchReallyHidden,
uint32 * OutProcessID,
int32 PriorityModifier,
const TCHAR * OptionalWorkingDirectory,
void * PipeWriteChild,
void * PipeReadChild = nullptr )
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.

Parameters
URLexecutable name
Parmscommand line arguments
bLaunchDetachedif true, the new process will have its own window
bLaunchHiddenif true, the new process will be minimized in the task bar
bLaunchReallyHiddenif true, the new process will not have a window or be in the task bar
OutProcessIdif non-NULL, this will be filled in with the ProcessId
PriorityModifier-2 idle, -1 low, 0 normal, 1 high, 2 higher
OptionalWorkingDirectoryDirectory to start in when running the program, or NULL to use the current working directory
PipeWriteChildOptional HANDLE to pipe for redirecting output
PipeReadChildOptional HANDLE to pipe for redirecting input
Returns
The process handle for use in other process functions

◆ CreateRunnableThread()

static class FRunnableThread * FGenericPlatformProcess::CreateRunnableThread ( )
static

Creates the platform-specific runnable thread. This should only be called from FRunnableThread::Create.

Returns
The newly created thread

◆ CreateSynchEvent()

static class FEvent * FGenericPlatformProcess::CreateSynchEvent ( bool bIsManualReset = false)
static

Creates a new event.

Parameters
bIsManualResetWhether the event requires manual reseting or not.
Returns
A new event, or nullptr none could be created.
See also
GetSynchEventFromPool, ReturnSynchEventToPool

◆ Daemonize()

static bool FGenericPlatformProcess::Daemonize ( )
static

Makes process run as a system service (daemon), i.e. detaches it from whatever user session it was initially run from.

Returns
true if successful, false otherwise.

◆ DeleteInterprocessSynchObject()

static bool FGenericPlatformProcess::DeleteInterprocessSynchObject ( FSemaphore * Object)
static

Deletes an interprocess synchronization object.

Parameters
Objectobject to destroy.

◆ DumpThreadInfo()

static void FGenericPlatformProcess::DumpThreadInfo ( const TCHAR * MarkerName)
inlinestatic

Output information about the currently active thread

Definition at line 257 of file GenericPlatformProcess.h.

◆ ExecElevatedProcess()

static bool FGenericPlatformProcess::ExecElevatedProcess ( const TCHAR * URL,
const TCHAR * Params,
int32 * OutReturnCode )
static

Executes a process as administrator, requesting elevation as necessary. This call blocks until the process has returned.

◆ ExecProcess()

static bool FGenericPlatformProcess::ExecProcess ( const TCHAR * URL,
const TCHAR * Params,
int32 * OutReturnCode,
FString * OutStdOut,
FString * OutStdErr,
const TCHAR * OptionalWorkingDirectory = NULL,
bool bShouldEndWithParentProcess = false )
static

Executes a process, returning the return code, stdout, and stderr. This call blocks until the process has returned.

Parameters
OutReturnCodemay be 0
OutStdOutmay be 0
OutStdErrmay 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)

◆ ExecutableName()

static const TCHAR * FGenericPlatformProcess::ExecutableName ( bool bRemoveExtension = true)
static

Return the name of the currently running executable

Parameters
bRemoveExtensiontrue to remove the extension of the executable name, false to leave it intact
Returns
Name of the currently running executable

◆ ExecutablePath()

static const TCHAR * FGenericPlatformProcess::ExecutablePath ( )
static

Return the path to the currently running executable

Returns
Path of the currently running executable

◆ ExploreFolder()

static void FGenericPlatformProcess::ExploreFolder ( const TCHAR * FilePath)
static

Attempt to "explore" the folder specified by the provided file path

Parameters
FilePathFile path specifying a folder to explore

◆ FlushPoolSyncEvents()

static void FGenericPlatformProcess::FlushPoolSyncEvents ( )
static

Deletes all the recycled sync events contained by the pools

◆ FreeDllHandle()

static void FGenericPlatformProcess::FreeDllHandle ( void * DllHandle)
static

Free a DLL.

◆ GenerateApplicationPath()

static FString FGenericPlatformProcess::GenerateApplicationPath ( const FString & AppName,
EBuildConfiguration BuildConfiguration )
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"

Parameters
AppNameThe name of the application or game.
BuildConfigurationThe build configuration of the game.
Returns
The generated application path.

◆ GetApplicationMemoryUsage()

static bool FGenericPlatformProcess::GetApplicationMemoryUsage ( uint32 ProcessId,
SIZE_T * OutMemoryUsage )
static

Outputs the virtual memory usage, of the process with the specified PID

◆ GetApplicationName()

static FString FGenericPlatformProcess::GetApplicationName ( uint32 ProcessId)
static

Returns the Name of process given by the PID. Returns Empty string "" if PID not found.

◆ GetBinariesSubdirectory()

static const TCHAR * FGenericPlatformProcess::GetBinariesSubdirectory ( )
static

Used only by platforms with DLLs, this gives the subdirectory from binaries to find the executables

◆ GetCurrentCoreNumber()

static uint32 FGenericPlatformProcess::GetCurrentCoreNumber ( )
static

Retrieves the current hardware CPU core

Returns
the current hardware core.

◆ GetCurrentProcessId()

static uint32 FGenericPlatformProcess::GetCurrentProcessId ( )
static

Retrieves the ProcessId of this process.

Returns
the ProcessId of this process.

◆ GetCurrentWorkingDirectory()

static FString FGenericPlatformProcess::GetCurrentWorkingDirectory ( )
static

Get the current working directory (only really makes sense on desktop platforms)

◆ GetDesiredThreadForUObjectReferenceCollector()

static ENamedThreads::Type FGenericPlatformProcess::GetDesiredThreadForUObjectReferenceCollector ( )
static

specifies the thread to use for UObject reference collection

◆ GetDllDirectories()

static FORCEINLINE void FGenericPlatformProcess::GetDllDirectories ( TArray< FString > & OutDllDirectories)
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.

◆ GetDllExport()

static void * FGenericPlatformProcess::GetDllExport ( void * DllHandle,
const TCHAR * ProcName )
static

Lookup the address of a DLL function.

◆ GetDllHandle()

static void * FGenericPlatformProcess::GetDllHandle ( const TCHAR * Filename)
static

Load a DLL.

◆ GetGameBundleId()

static FString FGenericPlatformProcess::GetGameBundleId ( )
static

Retrieves the platform-specific bundle identifier or package name of the game

Returns
The game's bundle identifier or package name.

◆ GetModuleExtension()

static const TCHAR * FGenericPlatformProcess::GetModuleExtension ( )
static

Return the extension of dynamic library

Returns
Extension of dynamic library.
See also
GetModulePrefix, GetModulesDirectory

◆ GetModulePrefix()

static const TCHAR * FGenericPlatformProcess::GetModulePrefix ( )
static

Return the prefix of dynamic library (e.g. lib)

Returns
The prefix string.
See also
GetModuleExtension, GetModulesDirectory

◆ GetModulesDirectory()

static const FString FGenericPlatformProcess::GetModulesDirectory ( )
static

Used only by platforms with DLLs, this gives the full path to the main directory containing modules

Returns
The path to the directory.
See also
GetModulePrefix, GetModuleExtension

◆ GetProcReturnCode()

static bool FGenericPlatformProcess::GetProcReturnCode ( FProcHandle & ProcHandle,
int32 * ReturnCode )
static

Retrieves the termination status of the specified process.

◆ GetStackSize()

static uint32 FGenericPlatformProcess::GetStackSize ( )
static

Get the active stack size for the currently running thread

◆ GetSynchEventFromPool()

static class FEvent * FGenericPlatformProcess::GetSynchEventFromPool ( bool bIsManualReset = false)
static

Gets an event from the pool or creates a new one if necessary.

Parameters
bIsManualResetWhether the event requires manual reseting or not.
Returns
An event, or nullptr none could be created.
See also
CreateSynchEvent, ReturnSynchEventToPool

◆ IsApplicationRunning() [1/2]

static bool FGenericPlatformProcess::IsApplicationRunning ( const TCHAR * ProcName)
static

Returns true if the specified application is running

◆ IsApplicationRunning() [2/2]

static bool FGenericPlatformProcess::IsApplicationRunning ( uint32 ProcessId)
static

Returns true if the specified application is running

◆ IsFirstInstance()

static bool FGenericPlatformProcess::IsFirstInstance ( )
static

Checks if we're the first instance. An instance can become first if the previous first instance quits before it.

◆ IsProcRunning()

static bool FGenericPlatformProcess::IsProcRunning ( FProcHandle & ProcessHandle)
static

Returns true if the specified process is running

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc
Returns
true if the process is still running

◆ LaunchFileInDefaultExternalApplication()

static bool FGenericPlatformProcess::LaunchFileInDefaultExternalApplication ( const TCHAR * FileName,
const TCHAR * Parms = NULL,
ELaunchVerb::Type Verb = ELaunchVerb::Open,
bool bPromptToOpenOnFailure = true )
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.

Parameters
FileNameName of the file to attempt to launch in its default external application
ParmsOptional parameters to the default application
VerbOptional verb to use when opening the file, if it applies for the platform.
Returns
true if the file is launched successfully, false otherwise.

◆ LaunchURL()

static void FGenericPlatformProcess::LaunchURL ( const TCHAR * URL,
const TCHAR * Parms,
FString * Error )
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.

◆ LaunchURLFiltered()

static bool FGenericPlatformProcess::LaunchURLFiltered ( const TCHAR * URL,
const TCHAR * Parms,
FString * Error,
const UE::Core::FURLRequestFilter & Filter )
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.

Returns
true if URL passed the filter and was launched, false if it was rejected by the filter.

◆ ModifyThreadAssignmentForUObjectReferenceCollector()

static void FGenericPlatformProcess::ModifyThreadAssignmentForUObjectReferenceCollector ( int32 & NumThreads,
int32 & NumBackgroundThreads,
ENamedThreads::Type & NormalThreadName,
ENamedThreads::Type & BackgroundThreadName )
static

allows a platform to override the threading configuration for reference collection

◆ NewInterprocessSynchObject() [1/2]

static FSemaphore * FGenericPlatformProcess::NewInterprocessSynchObject ( const FString & Name,
bool bCreate,
uint32 MaxLocks = 1 )
static

Creates or opens an interprocess synchronization object.

Parameters
Namename (so we can use it across processes).
bCreateIf true, the function will try to create, otherwise will try to open existing.
MaxLocksMaximum amount of locks that the semaphore can have (pass 1 to make it act as mutex).
Returns
Pointer to heap allocated semaphore object. Caller is responsible for deletion.

◆ NewInterprocessSynchObject() [2/2]

static FSemaphore * FGenericPlatformProcess::NewInterprocessSynchObject ( const TCHAR * Name,
bool bCreate,
uint32 MaxLocks = 1 )
static

Creates or opens an interprocess synchronization object.

Parameters
Namename (so we can use it across processes).
bCreateIf true, the function will try to create, otherwise will try to open existing.
MaxLocksMaximum amount of locks that the semaphore can have (pass 1 to make it act as mutex).
Returns
Pointer to heap allocated semaphore object. Caller is responsible for deletion.

◆ OpenProcess()

static FProcHandle FGenericPlatformProcess::OpenProcess ( uint32 ProcessID)
static

Opens an existing process.

Parameters
ProcessIDThe process id of the process for which we want to obtain a handle.
Returns
The process handle for use in other process functions

◆ PopDllDirectory()

static FORCEINLINE void FGenericPlatformProcess::PopDllDirectory ( const TCHAR * Directory)
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.

◆ PushDllDirectory()

static FORCEINLINE void FGenericPlatformProcess::PushDllDirectory ( const TCHAR * Directory)
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.

◆ ReadPipe()

static FString FGenericPlatformProcess::ReadPipe ( void * ReadPipe)
static

Reads all pending data from an anonymous pipe, such as STDOUT or STDERROR of a process.

Parameters
PipeThe handle to the pipe to read from.
Returns
A string containing the read data.
See also
ClosePipe, CreatePipe

◆ ReadPipeToArray()

static bool FGenericPlatformProcess::ReadPipeToArray ( void * ReadPipe,
TArray< uint8 > & Output )
static

Reads all pending data from an anonymous pipe, such as STDOUT or STDERROR of a process.

Parameters
PipeThe handle to the pipe to read from.
OutputThe data read.
Returns
true if successful (i.e. any data was read)
See also
ClosePipe, CreatePipe

◆ ReturnSynchEventToPool()

static void FGenericPlatformProcess::ReturnSynchEventToPool ( FEvent * Event)
static

Returns an event to the pool.

Parameters
EventThe event to return.
See also
CreateSynchEvent, GetSynchEventFromPool

◆ SetCurrentWorkingDirectoryToBaseDir()

static void FGenericPlatformProcess::SetCurrentWorkingDirectoryToBaseDir ( )
static

◆ SetProcessLimits()

static bool FGenericPlatformProcess::SetProcessLimits ( EProcessResource::Type Resource,
uint64 Limit )
inlinestatic

Sets the process limits.

Parameters
Resourceone of process resources.
Limitthe maximum amount of the resource (for some OS, this means both hard and soft limits).
Returns
true on success, false otherwise.

Definition at line 314 of file GenericPlatformProcess.h.

◆ SetRealTimeMode()

static void FGenericPlatformProcess::SetRealTimeMode ( )
inlinestatic

Enables Real Time Mode on the current thread.

Definition at line 703 of file GenericPlatformProcess.h.

◆ SetShaderDir()

static void FGenericPlatformProcess::SetShaderDir ( const TCHAR * Where)
static

◆ SetThreadAffinityMask()

static void FGenericPlatformProcess::SetThreadAffinityMask ( uint64 AffinityMask)
static

Change the thread processor affinity

Parameters
AffinityMaskA bitfield indicating what processors the thread is allowed to run on.

◆ SetThreadName()

static void FGenericPlatformProcess::SetThreadName ( const TCHAR * ThreadName)
inlinestatic

Helper function to set thread name of the current thread.

Parameters
ThreadNameName to set

Definition at line 251 of file GenericPlatformProcess.h.

◆ SetThreadPriority()

static void FGenericPlatformProcess::SetThreadPriority ( EThreadPriority NewPriority)
static

Change the thread processor priority

Parameters
NewPriorityan EThreadPriority indicating what priority the thread is to run at.

◆ SetupAudioThread()

static void FGenericPlatformProcess::SetupAudioThread ( )
inlinestatic

Allow the platform to do anything it needs for audio thread

Definition at line 269 of file GenericPlatformProcess.h.

◆ SetupGameThread()

static void FGenericPlatformProcess::SetupGameThread ( )
inlinestatic

Allow the platform to do anything it needs for game thread

Definition at line 260 of file GenericPlatformProcess.h.

◆ SetupRenderThread()

static void FGenericPlatformProcess::SetupRenderThread ( )
inlinestatic

Allow the platform to do anything it needs for render thread

Definition at line 263 of file GenericPlatformProcess.h.

◆ SetupRHIThread()

static void FGenericPlatformProcess::SetupRHIThread ( )
inlinestatic

Allow the platform to do anything it needs for the RHI thread

Definition at line 266 of file GenericPlatformProcess.h.

◆ ShaderDir()

static const TCHAR * FGenericPlatformProcess::ShaderDir ( )
static

◆ ShaderWorkingDir()

static const FString FGenericPlatformProcess::ShaderWorkingDir ( )
static

Get the shader working directory.

Returns
The path to the directory.

◆ ShouldSaveToUserDir()

static bool FGenericPlatformProcess::ShouldSaveToUserDir ( )
static

Content saved to the game or engine directories should be rerouted to user directories instead

◆ SkipWaitForStats()

static bool FGenericPlatformProcess::SkipWaitForStats ( )
inlinestatic

force skip calling FThreadStats::WaitForStats()

Definition at line 752 of file GenericPlatformProcess.h.

◆ SupportsMultithreading()

static bool FGenericPlatformProcess::SupportsMultithreading ( )
static

Gets whether this platform can use multiple threads.

Returns
true if the platform can use multiple threads, false otherwise.

◆ TearDown()

static void FGenericPlatformProcess::TearDown ( )
static

Tears down allocated process resources.

◆ TeardownAudioThread()

static void FGenericPlatformProcess::TeardownAudioThread ( )
inlinestatic

Allow the platform to tear down the audio thread

Definition at line 272 of file GenericPlatformProcess.h.

◆ TerminateProc()

static void FGenericPlatformProcess::TerminateProc ( FProcHandle & ProcessHandle,
bool KillTree = false )
static

Terminates a process

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc
KillTreeWhether the entire process tree should be terminated.

◆ TerminateProcTreeWithPredicate()

static void FGenericPlatformProcess::TerminateProcTreeWithPredicate ( FProcHandle & ProcessHandle,
TFunctionRef< bool(uint32 ProcessId, const TCHAR *ApplicationName)> Predicate )
static

Terminates a process tree

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc
Predicatethat 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

◆ UserDir()

static const TCHAR * FGenericPlatformProcess::UserDir ( )
static

Get user directory. NOTE: Only one return value is valid at a time!

◆ UserHomeDir()

static const TCHAR * FGenericPlatformProcess::UserHomeDir ( )
static

Get the user home directory. NOTE: Only one return value is valid at a time!

◆ UserName()

static const TCHAR * FGenericPlatformProcess::UserName ( bool bOnlyAlphaNumeric = true)
static

Get user name. NOTE: Only one return value is valid at a time!

◆ UserSettingsDir()

static const TCHAR * FGenericPlatformProcess::UserSettingsDir ( )
static

Get the user settings directory. NOTE: Only one return value is valid at a time!

◆ UserTempDir()

static const TCHAR * FGenericPlatformProcess::UserTempDir ( )
static

Get the user temporary directory. NOTE: Only one return value is valid at a time!

◆ WaitAndFork()

static EWaitAndForkResult FGenericPlatformProcess::WaitAndFork ( )
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).

◆ WaitForProc()

static void FGenericPlatformProcess::WaitForProc ( FProcHandle & ProcessHandle)
static

Waits for a process to stop

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc

◆ WritePipe() [1/2]

static bool FGenericPlatformProcess::WritePipe ( void * WritePipe,
const FString & Message,
FString * OutWritten = nullptr )
static

Sends the message to process through pipe

Parameters
WritePipePipe for writing.
MessageThe message to be written.
OutWrittenOptional parameter to know how much of the string written.
Returns
True if all bytes written successfully.
See also
CreatePipe, ClosePipe, ReadPipe

◆ WritePipe() [2/2]

static bool FGenericPlatformProcess::WritePipe ( void * WritePipe,
const uint8 * Data,
const int32 DataLength,
int32 * OutDataLength = nullptr )
static

Sends data to process through pipe

Parameters
WritePipePipe for writing.
DataThe data to be written.
DataLengthhow many bytes to write.
OutDataLengthOptional parameter to know how many bytes had been written.
Returns
True if all bytes written successfully.
See also
CreatePipe, ClosePipe, ReadPipe

◆ Yield()

static FORCEINLINE void FGenericPlatformProcess::Yield ( )
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.

◆ YieldCycles()

static FORCEINLINE void FGenericPlatformProcess::YieldCycles ( uint64 Cycles)
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.


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