Implements the module manager. 更多...
#include <ModuleManager.h>
类 FModuleManager 继承关系图:Public 成员函数 | |
| void | AbandonModule (const FName InModuleName) |
| Abandons a loaded module, leaving it loaded in memory but no longer tracking it in the module manager. 更多... | |
| void | AbandonModuleWithCallback (const FName InModuleName) |
| Calls PreUnload then abandons a module in memory. 更多... | |
| void | AddBinariesDirectory (const TCHAR *InDirectory, bool bIsGameDirectory) |
| Adds an engine binaries directory. | |
| void | AddExtraBinarySearchPaths () |
| Add any extra search paths that may be required | |
| void | AddModule (const FName InModuleName) |
| Adds a module to our list of modules, unless it's already known. 更多... | |
| DECLARE_DELEGATE_RetVal (IModuleInterface *, FInitializeStaticallyLinkedModule) void RegisterStaticallyLinkedModule(const FLazyName InModuleName | |
| Delegate that's used by the module manager to initialize a registered module that we statically linked with (monolithic only) 更多... | |
| DECLARE_DELEGATE_RetVal_OneParam (bool, FIsPackageLoadedCallback, FName) | |
| Gets a delegate that is executed when a module containing UObjects has been loaded. 更多... | |
| DECLARE_EVENT_TwoParams (FModuleManager, FModulesChangedEvent, FName, EModuleChangeReason) | |
| Gets an event delegate that is executed when the set of known modules changed, i.e. 更多... | |
| DECLARE_EVENT_TwoParams (FModuleManager, ProcessLoadedObjectsEvent, FName, bool) | |
| Gets a multicast delegate that is executed when any UObjects need processing after a module was loaded. 更多... | |
| bool | DoesLoadedModuleHaveUObjects (const FName ModuleName) const |
| Determines whether the specified module contains UObjects. 更多... | |
| void | FindModules (const TCHAR *WildcardWithoutExtension, TArray< FName > &OutModules) const |
| Finds module files on the disk for loadable modules matching the specified wildcard. 更多... | |
| FString | GetGameBinariesDirectory () const |
| Gets the game binaries directory | |
| IModuleInterface * | GetModule (const FName InModuleName) |
| Gets the specified module. 更多... | |
| int32 | GetModuleCount () const |
| Gets the number of loaded modules. 更多... | |
| FString | GetModuleFilename (FName ModuleName) const |
| Gets the filename for a module. 更多... | |
| bool | HasAnyOverridenModuleFilename () const |
| Determines if any non-default module instances are loaded (eg. 更多... | |
| bool | IsModuleLoaded (const FName InModuleName) const |
| Checks whether the specified module is currently loaded. 更多... | |
| bool | IsModuleUpToDate (const FName InModuleName) const |
| Checks to see if the specified module exists and is compatible with the current engine version. 更多... | |
| IModuleInterface * | LoadModule (const FName InModuleName) |
| Loads the specified module. 更多... | |
| IModuleInterface & | LoadModuleChecked (const FName InModuleName) |
| Loads the specified module, checking to ensure it exists. 更多... | |
| bool | LoadModuleWithCallback (const FName InModuleName, FOutputDevice &Ar) |
| Loads a module in memory then calls PostLoad. 更多... | |
| IModuleInterface * | LoadModuleWithFailureReason (const FName InModuleName, EModuleLoadResult &OutFailureReason) |
| Loads the specified module and returns a result. 更多... | |
| void | MakeUniqueModuleFilename (const FName InModuleName, FString &UniqueSuffix, FString &UniqueModuleFileName) const |
| Generates a unique file name for the specified module name by adding a random suffix and checking for file collisions. | |
| bool | ModuleExists (const TCHAR *ModuleName) const |
| Determines if a module with the given name exists, regardless of whether it is currently loaded. 更多... | |
| bool | QueryModule (const FName InModuleName, FModuleStatus &OutModuleStatus) const |
| Queries information about a specific module name. 更多... | |
| void | QueryModules (TArray< FModuleStatus > &OutModuleStatuses) const |
| Queries information about all of the currently known modules. 更多... | |
| void | ResetModulePathsCache () |
| Clears module path cache | |
| void | SaveCurrentStateForBootstrap (const TCHAR *Filename) |
| Save the current module manager's state into a file for bootstrapping other processes. | |
| void | SetGameBinariesDirectory (const TCHAR *InDirectory) |
| Set the game binaries directory 更多... | |
| void | SetModuleFilename (FName ModuleName, const FString &Filename) |
| Sets the filename for a module. 更多... | |
| void | StartProcessingNewlyLoadedObjects () |
| Called by the engine at startup to let the Module Manager know that it's now safe to process new UObjects discovered by loading C++ modules. | |
| bool | UnloadModule (const FName InModuleName, bool bIsShutdown=false) |
| Unloads a specific module NOTE: You can manually unload a module before the normal shutdown occurs with this, but be careful as you may be unloading another module's dependency too early! 更多... | |
| void | UnloadModulesAtShutdown () |
| Unloads modules during the shutdown process. 更多... | |
| void | UnloadOrAbandonModuleWithCallback (const FName InModuleName, FOutputDevice &Ar) |
| Calls PreUnload then either unloads or abandons a module in memory, depending on whether the module supports unloading. 更多... | |
静态 Public 成员函数 | |
| static FModuleManager & | Get () |
| Gets the singleton instance of the module manager. 更多... | |
| template<typename TModuleInterface > | |
| static TModuleInterface & | GetModuleChecked (const FName ModuleName) |
| Gets a module by name, checking to ensure it exists. 更多... | |
| template<typename TModuleInterface > | |
| static FORCEINLINE TModuleInterface * | GetModulePtr (const FName ModuleName) |
| Gets a module by name. 更多... | |
| static const TCHAR * | GetUBTConfiguration () |
| Gets the build configuration for compiling modules, as required by UBT. 更多... | |
| template<typename TModuleInterface > | |
| static TModuleInterface & | LoadModuleChecked (const FName InModuleName) |
| Loads a module by name, checking to ensure it exists. 更多... | |
| template<typename TModuleInterface > | |
| static TModuleInterface * | LoadModulePtr (const FName InModuleName) |
| Loads a module by name. 更多... | |
| static void | TearDown () |
| Destroys singleton if it exists. 更多... | |
友元 | |
| struct | TOptional< FModuleManager > |
Implements the module manager.
The module manager is used to load and unload modules, as well as to keep track of all of the modules that are currently loaded. You can access this singleton using FModuleManager::Get().
| void FModuleManager::AbandonModule | ( | const FName | InModuleName | ) |
Abandons a loaded module, leaving it loaded in memory but no longer tracking it in the module manager.
| InModuleName | The name of the module to abandon. Should not include path, extension or platform/configuration info. This is just the "module name" part of the module file name. |
| void FModuleManager::AbandonModuleWithCallback | ( | const FName | InModuleName | ) |
Calls PreUnload then abandons a module in memory.
| InModuleName | The name of the module to unload. |
| void FModuleManager::AddModule | ( | const FName | InModuleName | ) |
Adds a module to our list of modules, unless it's already known.
| InModuleName | The base name of the module file. Should not include path, extension or platform/configuration info. This is just the "name" part of the module file name. Names should be globally unique. |
| FModuleManager::DECLARE_DELEGATE_RetVal | ( | IModuleInterface * | , |
| FInitializeStaticallyLinkedModule | |||
| ) | const |
Delegate that's used by the module manager to initialize a registered module that we statically linked with (monolithic only)
Registers an initializer for a module that is statically linked.
| InModuleName | The name of this module. |
| InInitializerDelegate | The delegate that will be called to initialize an instance of this module. |
| FModuleManager::DECLARE_DELEGATE_RetVal_OneParam | ( | bool | , |
| FIsPackageLoadedCallback | , | ||
| FName | |||
| ) |
Gets a delegate that is executed when a module containing UObjects has been loaded.
The first parameter is the name of the loaded module.
| FModuleManager::DECLARE_EVENT_TwoParams | ( | FModuleManager | , |
| FModulesChangedEvent | , | ||
| FName | , | ||
| EModuleChangeReason | |||
| ) |
Gets an event delegate that is executed when the set of known modules changed, i.e.
upon module load or unload.
The first parameter is the name of the module that changed. The second parameter is the reason for the change.
| FModuleManager::DECLARE_EVENT_TwoParams | ( | FModuleManager | , |
| ProcessLoadedObjectsEvent | , | ||
| FName | , | ||
| bool | |||
| ) |
Gets a multicast delegate that is executed when any UObjects need processing after a module was loaded.
| bool FModuleManager::DoesLoadedModuleHaveUObjects | ( | const FName | ModuleName | ) | const |
Determines whether the specified module contains UObjects.
The module must already be loaded into memory before calling this function.
| ModuleName | Name of the loaded module to check. |
| void FModuleManager::FindModules | ( | const TCHAR * | WildcardWithoutExtension, |
| TArray< FName > & | OutModules | ||
| ) | const |
Finds module files on the disk for loadable modules matching the specified wildcard.
| WildcardWithoutExtension | Filename part (no path, no extension, no build config info) to search for. |
| OutModules | List of modules found. |
|
static |
Gets the singleton instance of the module manager.
| IModuleInterface * FModuleManager::GetModule | ( | const FName | InModuleName | ) |
Gets the specified module.
| InModuleName | Name of the module to return. |
|
inlinestatic |
Gets a module by name, checking to ensure it exists.
This method checks whether the module actually exists. If the module does not exist, an assertion will be triggered.
| ModuleName | The module to get. |
| int32 FModuleManager::GetModuleCount | ( | ) | const |
Gets the number of loaded modules.
Gets the filename for a module.
The return value is a full path of a module known to the module manager.
|
inlinestatic |
Gets a module by name.
| ModuleName | The module to get. |
|
static |
Gets the build configuration for compiling modules, as required by UBT.
| bool FModuleManager::HasAnyOverridenModuleFilename | ( | ) | const |
Determines if any non-default module instances are loaded (eg.
hot reloaded modules)
| bool FModuleManager::IsModuleLoaded | ( | const FName | InModuleName | ) | const |
Checks whether the specified module is currently loaded.
This is an O(1) operation.
| InModuleName | The base name of the module file. Should not include path, extension or platform/configuration info. This is just the "module name" part of the module file name. Names should be globally unique. |
| bool FModuleManager::IsModuleUpToDate | ( | const FName | InModuleName | ) | const |
Checks to see if the specified module exists and is compatible with the current engine version.
| InModuleName | The base name of the module file. |
| IModuleInterface * FModuleManager::LoadModule | ( | const FName | InModuleName | ) |
Loads the specified module.
| InModuleName | The base name of the module file. Should not include path, extension or platform/configuration info. This is just the "module name" part of the module file name. Names should be globally unique. |
| IModuleInterface & FModuleManager::LoadModuleChecked | ( | const FName | InModuleName | ) |
Loads the specified module, checking to ensure it exists.
| InModuleName | The base name of the module file. Should not include path, extension or platform/configuration info. This is just the "module name" part of the module file name. Names should be globally unique. |
|
inlinestatic |
Loads a module by name, checking to ensure it exists.
This method checks whether the module actually exists. If the module does not exist, an assertion will be triggered. If the module was already loaded previously, the existing instance will be returned.
| ModuleName | The module to find and load |
|
inlinestatic |
Loads a module by name.
| ModuleName | The module to find and load. |
| bool FModuleManager::LoadModuleWithCallback | ( | const FName | InModuleName, |
| FOutputDevice & | Ar | ||
| ) |
Loads a module in memory then calls PostLoad.
| InModuleName | The name of the module to load. |
| Ar | The archive to receive error messages, if any. |
| IModuleInterface * FModuleManager::LoadModuleWithFailureReason | ( | const FName | InModuleName, |
| EModuleLoadResult & | OutFailureReason | ||
| ) |
Loads the specified module and returns a result.
| InModuleName | The base name of the module file. Should not include path, extension or platform/configuration info. This is just the "module name" part of the module file name. Names should be globally unique. |
| OutFailureReason | Will contain the result. |
| bool FModuleManager::ModuleExists | ( | const TCHAR * | ModuleName | ) | const |
Determines if a module with the given name exists, regardless of whether it is currently loaded.
| ModuleName | Name of the module to look for. |
| bool FModuleManager::QueryModule | ( | const FName | InModuleName, |
| FModuleStatus & | OutModuleStatus | ||
| ) | const |
Queries information about a specific module name.
| InModuleName | Module to query status for. |
| OutModuleStatus | Status of the specified module. |
| void FModuleManager::QueryModules | ( | TArray< FModuleStatus > & | OutModuleStatuses | ) | const |
Queries information about all of the currently known modules.
| OutModuleStatuses | Status of all modules. |
| void FModuleManager::SetGameBinariesDirectory | ( | const TCHAR * | InDirectory | ) |
Set the game binaries directory
| InDirectory | The game binaries directory. |
Sets the filename for a module.
The module is not reloaded immediately, but the new name will be used for subsequent unload/load events.
|
static |
Destroys singleton if it exists.
Get() must not be called after Destroy().
| bool FModuleManager::UnloadModule | ( | const FName | InModuleName, |
| bool | bIsShutdown = false |
||
| ) |
Unloads a specific module NOTE: You can manually unload a module before the normal shutdown occurs with this, but be careful as you may be unloading another module's dependency too early!
| InModuleName | The name of the module to unload. Should not include path, extension or platform/configuration info. This is just the "module name" part of the module file name. |
| bIsShutdown | Is this unload module call occurring at shutdown (default = false). |
| void FModuleManager::UnloadModulesAtShutdown | ( | ) |
Unloads modules during the shutdown process.
Modules are unloaded in reverse order to when their StartupModule() FINISHES. The practical implication of this is that if module A depends on another module B, and A loads B during A's StartupModule, that B will actually get Unloaded after A during shutdown. This allows A's ShutdownModule() call to still reference module B. You can manually unload a module yourself which will change this ordering, but be careful as you may be unloading another module's dependency!
This method is Usually called at various points while exiting an application.
| void FModuleManager::UnloadOrAbandonModuleWithCallback | ( | const FName | InModuleName, |
| FOutputDevice & | Ar | ||
| ) |
Calls PreUnload then either unloads or abandons a module in memory, depending on whether the module supports unloading.
| InModuleName | The name of the module to unload. |
| Ar | The archive to receive error messages, if any. |