Generic implementation for most platforms, these tend to be unused and unimplemented 更多...
#include <GenericPlatformProcess.h>
类 FGenericPlatformProcess 继承关系图:类 | |
| struct | FSemaphore |
| Generic representation of a interprocess semaphore 更多... | |
静态 Public 成员函数 | |
| static FORCEINLINE void | AddDllDirectory (const TCHAR *Directory) |
| Adds a directory to search in when resolving implicitly loaded or filename-only DLLs. | |
| static const TCHAR * | ApplicationSettingsDir () |
| Get application settings directory. 更多... | |
| static const TCHAR * | BaseDir () |
| Get startup directory. 更多... | |
| static bool | CanLaunchURL (const TCHAR *URL) |
| Checks if the platform can launch a uniform resource locator (i.e. 更多... | |
| static void | CleanShaderWorkingDir () |
| Clean the shader working directory. | |
| static void | ClosePipe (void *ReadPipe, void *WritePipe) |
| Closes an anonymous pipe. 更多... | |
| static void | CloseProc (FProcHandle &ProcessHandle) |
| Cleans up FProcHandle after we're done with it. 更多... | |
| static const TCHAR * | ComputerName () |
| Get computer name. 更多... | |
| static void | ConditionalSleep (TFunctionRef< bool()> Condition, float SleepTime=0.0f) |
| Sleep thread until condition is satisfied. 更多... | |
| static bool | CreatePipe (void *&ReadPipe, void *&WritePipe) |
| Creates a writable anonymous pipe. 更多... | |
| 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) |
| Creates a new process and its primary thread. 更多... | |
| static class FRunnableThread * | CreateRunnableThread () |
| Creates the platform-specific runnable thread. 更多... | |
| static class FEvent * | CreateSynchEvent (bool bIsManualReset=false) |
| Creates a new event. 更多... | |
| static bool | Daemonize () |
| Makes process run as a system service (daemon), i.e. 更多... | |
| static bool | DeleteInterprocessSynchObject (FSemaphore *Object) |
| Deletes an interprocess synchronization object. 更多... | |
| static bool | ExecElevatedProcess (const TCHAR *URL, const TCHAR *Params, int32 *OutReturnCode) |
| Executes a process as administrator, requesting elevation as necessary. 更多... | |
| static bool | ExecProcess (const TCHAR *URL, const TCHAR *Params, int32 *OutReturnCode, FString *OutStdOut, FString *OutStdErr, const TCHAR *OptionalWorkingDirectory=NULL) |
| Executes a process, returning the return code, stdout, and stderr. 更多... | |
| static const TCHAR * | ExecutableName (bool bRemoveExtension=true) |
| Return the name of the currently running executable 更多... | |
| static const TCHAR * | ExecutablePath () |
| Return the path to the currently running executable 更多... | |
| static void | ExploreFolder (const TCHAR *FilePath) |
| Attempt to "explore" the folder specified by the provided file path 更多... | |
| static void | FlushPoolSyncEvents () |
| Deletes all the recycled sync events contained by the pools | |
| static void | FreeDllHandle (void *DllHandle) |
| Free a DLL. | |
| static FString | GenerateApplicationPath (const FString &AppName, EBuildConfiguration BuildConfiguration) |
| Generates the path to the specified application or game. 更多... | |
| static bool | GetApplicationMemoryUsage (uint32 ProcessId, SIZE_T *OutMemoryUsage) |
| Outputs the virtual memory usage, of the process with the specified PID | |
| static FString | GetApplicationName (uint32 ProcessId) |
| Returns the Name of process given by the PID. 更多... | |
| static const TCHAR * | GetBinariesSubdirectory () |
| Used only by platforms with DLLs, this gives the subdirectory from binaries to find the executables | |
| static uint32 | GetCurrentCoreNumber () |
| Retrieves the current hardware CPU core 更多... | |
| static uint32 | GetCurrentProcessId () |
| Retrieves the ProcessId of this process. 更多... | |
| static FString | GetCurrentWorkingDirectory () |
| Get the current working directory (only really makes sense on desktop platforms) | |
| static ENamedThreads::Type | GetDesiredThreadForUObjectReferenceCollector () |
| specifies the thread to use for UObject reference collection | |
| static FORCEINLINE void | GetDllDirectories (TArray< FString > &OutDllDirectories) |
| Get the list of registered directories to search in when resolving implicitly loaded or filename-only DLLs. | |
| static void * | GetDllExport (void *DllHandle, const TCHAR *ProcName) |
| Lookup the address of a DLL function. | |
| static void * | GetDllHandle (const TCHAR *Filename) |
| Load a DLL. | |
| static FString | GetGameBundleId () |
| Retrieves the platform-specific bundle identifier or package name of the game 更多... | |
| static const TCHAR * | GetModuleExtension () |
| Return the extension of dynamic library 更多... | |
| static const TCHAR * | GetModulePrefix () |
| Return the prefix of dynamic library (e.g. 更多... | |
| static const FString | GetModulesDirectory () |
| Used only by platforms with DLLs, this gives the full path to the main directory containing modules 更多... | |
| static bool | GetProcReturnCode (FProcHandle &ProcHandle, int32 *ReturnCode) |
| Retrieves the termination status of the specified process. | |
| static class FEvent * | GetSynchEventFromPool (bool bIsManualReset=false) |
| Gets an event from the pool or creates a new one if necessary. 更多... | |
| static bool | IsApplicationRunning (const TCHAR *ProcName) |
| Returns true if the specified application is running | |
| static bool | IsApplicationRunning (uint32 ProcessId) |
| Returns true if the specified application is running | |
| static bool | IsFirstInstance () |
| Checks if we're the first instance. 更多... | |
| static bool | IsProcRunning (FProcHandle &ProcessHandle) |
| Returns true if the specified process is running 更多... | |
| static void | LaunchFileInDefaultExternalApplication (const TCHAR *FileName, const TCHAR *Parms=NULL, ELaunchVerb::Type Verb=ELaunchVerb::Open) |
| Attempt to launch the provided file name in its default external application. 更多... | |
| static void | LaunchURL (const TCHAR *URL, const TCHAR *Parms, FString *Error) |
| Launch a uniform resource locator (i.e. 更多... | |
| static void | ModifyThreadAssignmentForUObjectReferenceCollector (int32 &NumThreads, int32 &NumBackgroundThreads, ENamedThreads::Type &NormalThreadName, ENamedThreads::Type &BackgroundThreadName) |
| allows a platform to override the threading configuration for reference collection | |
| static FSemaphore * | NewInterprocessSynchObject (const FString &Name, bool bCreate, uint32 MaxLocks=1) |
| Creates or opens an interprocess synchronization object. 更多... | |
| static FSemaphore * | NewInterprocessSynchObject (const TCHAR *Name, bool bCreate, uint32 MaxLocks=1) |
| Creates or opens an interprocess synchronization object. 更多... | |
| static FProcHandle | OpenProcess (uint32 ProcessID) |
| Opens an existing process. 更多... | |
| static FORCEINLINE void | PopDllDirectory (const TCHAR *Directory) |
| Unsets a directory to look for DLL files. 更多... | |
| static FORCEINLINE void | PushDllDirectory (const TCHAR *Directory) |
| Set a directory to look for DLL files. 更多... | |
| static FString | ReadPipe (void *ReadPipe) |
| Reads all pending data from an anonymous pipe, such as STDOUT or STDERROR of a process. 更多... | |
| static bool | ReadPipeToArray (void *ReadPipe, TArray< uint8 > &Output) |
| Reads all pending data from an anonymous pipe, such as STDOUT or STDERROR of a process. 更多... | |
| static void | ReturnSynchEventToPool (FEvent *Event) |
| Returns an event to the pool. 更多... | |
| static bool | SetProcessLimits (EProcessResource::Type Resource, uint64 Limit) |
| Sets the process limits. 更多... | |
| static void | SetRealTimeMode () |
| Enables Real Time Mode on the current thread. | |
| static void | SetThreadAffinityMask (uint64 AffinityMask) |
| Change the thread processor affinity 更多... | |
| static void | SetThreadName (const TCHAR *ThreadName) |
| Helper function to set thread name of the current thread. 更多... | |
| static void | SetupAudioThread () |
| Allow the platform to do anything it needs for audio thread | |
| static void | SetupGameThread () |
| Allow the platform to do anything it needs for game thread | |
| static void | SetupRenderThread () |
| Allow the platform to do anything it needs for render thread | |
| static const FString | ShaderWorkingDir () |
| Get the shader working directory. 更多... | |
| static bool | ShouldSaveToUserDir () |
| Content saved to the game or engine directories should be rerouted to user directories instead | |
| static bool | SkipWaitForStats () |
| force skip calling FThreadStats::WaitForStats() | |
| static bool | SupportsMultithreading () |
| Gets whether this platform can use multiple threads. 更多... | |
| static void | TearDown () |
| Tears down allocated process resources. | |
| static void | TeardownAudioThread () |
| Allow the platform to tear down the audio thread | |
| static void | TerminateProc (FProcHandle &ProcessHandle, bool KillTree=false) |
| Terminates a process 更多... | |
| static const TCHAR * | UserDir () |
| Get user directory. 更多... | |
| static const TCHAR * | UserName (bool bOnlyAlphaNumeric=true) |
| Get user name. 更多... | |
| static const TCHAR * | UserSettingsDir () |
| Get the user settings directory. 更多... | |
| static const TCHAR * | UserTempDir () |
| Get the user temporary directory. 更多... | |
| static EWaitAndForkResult | WaitAndFork () |
| Waits for process signals and forks child processes. 更多... | |
| static void | WaitForProc (FProcHandle &ProcessHandle) |
| Waits for a process to stop 更多... | |
| static bool | WritePipe (void *WritePipe, const FString &Message, FString *OutWritten=nullptr) |
| Sends the message to process through pipe 更多... | |
| static bool | WritePipe (void *WritePipe, const uint8 *Data, const int32 DataLength, int32 *OutDataLength=nullptr) |
| Sends data to process through pipe 更多... | |
| static FORCEINLINE void | Yield () |
| Tells the processor to pause for implementation-specific amount of time. 更多... | |
Generic implementation for most platforms, these tend to be unused and unimplemented
|
static |
Get application settings directory.
NOTE: Only one return value is valid at a time!
|
static |
Get startup directory.
NOTE: Only one return value is valid at a time!
|
static |
Checks if the platform can launch a uniform resource locator (i.e.
|
static |
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. |
|
static |
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. |
|
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 |
| PipeWrite | Optional HANDLE to pipe for redirecting output |
|
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. |
|
static |
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. |
|
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 |
|
static |
Return the name of the currently running executable
| bRemoveExtension | true to remove the extension of the executable name, false to leave it intact |
|
static |
Return the path to the currently running executable
|
static |
Attempt to "explore" the folder specified by the provided file path
| FilePath | File path specifying a folder to explore |
|
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/UE4Editor-Win64-Debug.exe"
| AppName | The name of the application or game. |
| BuildConfiguration | The build configuration of the game. |
|
static |
Returns the Name of process given by the PID.
Returns Empty string "" if PID not found.
|
static |
Retrieves the current hardware CPU core
|
static |
Retrieves the ProcessId of this process.
|
static |
Retrieves the platform-specific bundle identifier or package name of the game
|
static |
Return the extension of dynamic library
|
static |
Return the prefix of dynamic library (e.g.
lib)
|
static |
Used only by platforms with DLLs, this gives the full path to the main directory containing modules
|
static |
Gets an event from the pool or creates a new one if necessary.
| bIsManualReset | Whether the event requires manual reseting or not. |
|
static |
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 |
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
|
inlinestatic |
Set a directory to look for DLL files.
NEEDS to have a Pop call when complete
|
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. |
|
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. |
|
static |
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). |
|
static |
Change the thread processor affinity
| AffinityMask | A bitfield indicating what processors the thread is allowed to run on. |
|
inlinestatic |
Helper function to set thread name of the current thread.
| ThreadName | Name to set |
|
static |
Get the shader working directory.
|
static |
Gets whether this platform can use multiple threads.
|
static |
Terminates a process
| ProcessHandle | handle returned from FPlatformProcess::CreateProc |
| KillTree | Whether the entire process tree should be terminated. |
|
static |
Get user directory.
NOTE: Only one return value is valid at a time!
|
static |
Get user name.
NOTE: Only one return value is valid at a time!
|
static |
Get the user settings directory.
NOTE: Only one return value is valid at a time!
|
static |
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.