Header <Modules/ModuleManager.h>
#include "Modules/ModuleManager.h"Includes 22
<Containers/Array.h> |
<Containers/ContainerAllocationPolicies.h> |
<Containers/Map.h> |
<Containers/UnrealString.h> |
<CoreTypes.h> |
<Delegates/Delegate.h> |
<HAL/CriticalSection.h> |
<HAL/PlatformCrt.h> |
<HAL/PreprocessorHelpers.h> |
<Misc/AssertionMacros.h> |
<Misc/Build.h> |
<Misc/CoreMisc.h> |
<Misc/EnumClassFlags.h> |
<Misc/Optional.h> |
<Modules/Boilerplate/ModuleBoilerplate.h> |
<Modules/ModuleInterface.h> |
<Serialization/Archive.h> |
<Templates/Atomic.h> |
<Templates/SharedPointer.h> |
<Templates/UniquePtr.h> |
<Templates/UnrealTemplate.h> |
<UObject/NameTypes.h> |
Contents
FModuleManager | Implements the module manager. (class : FSelfRegisteringExec) |
Functions | 7 free functions (namespace scope) |
class FModuleManager
class FModuleManager : public FSelfRegisteringExecImplements the module manager.
Constructors 2
| ~FModuleManager | ~FModuleManager();Destructor. |
| FModuleManager | FModuleManager(FPrivateToken);Hidden constructor. |
Member functions 44
| AbandonModule | void AbandonModule(const FName InModuleName);Abandons a loaded module, leaving it loaded in memory but no longer tracking it in the module manager. |
| AddModule | void AddModule(const FName InModuleName);Adds a module to our list of modules, unless it's already known. |
| RefreshModuleFilenameFromManifest | void RefreshModuleFilenameFromManifest(const FName InModuleName); |
| GetModule | IModuleInterface* GetModule(const FName InModuleName);Gets the specified module. |
| IsModuleLoaded | bool IsModuleLoaded(const FName InModuleName) const;Checks whether the specified module is currently loaded. |
| LoadModule | IModuleInterface* LoadModule(const FName InModuleName, ELoadModuleFlags InLoadModuleFlags = ELoadModuleFlags::None);Loads the specified module. |
| LoadModuleChecked | IModuleInterface& LoadModuleChecked(const FName InModuleName);Loads the specified module, checking to ensure it exists. |
| LoadModuleWithCallback | bool LoadModuleWithCallback(const FName InModuleName, FOutputDevice &Ar);Loads a module in memory then calls PostLoad. |
| LoadModuleWithFailureReason | IModuleInterface* LoadModuleWithFailureReason(const FName InModuleName, EModuleLoadResult& OutFailureReason, ELoadModuleFlags InLoadModuleFlags = ELoadModuleFlags::None);Loads the specified module and returns a result. |
| QueryModule | bool QueryModule(const FName InModuleName, FModuleStatus& OutModuleStatus) const;Queries information about a specific module name. |
| QueryModules | void QueryModules(TArray<FModuleStatus>& OutModuleStatuses) const;Queries information about all of the currently known modules. |
| UnloadModule | bool UnloadModule(const FName InModuleName, bool bIsShutdown = false, bool bAllowUnloadCode = true);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! |
| UnloadOrAbandonModuleWithCallback | 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. |
| AbandonModuleWithCallback | void AbandonModuleWithCallback(const FName InModuleName);Calls PreUnload then abandons a module in memory. |
| AddExtraBinarySearchPaths | void AddExtraBinarySearchPaths();Add any extra search paths that may be required |
| FindModules | void FindModules(const TCHAR* WildcardWithoutExtension, TArray<FName>& OutModules) const;void FindModules(const TCHAR* WildcardWithoutExtension, TArray<FModuleDiskInfo>& OutModules) const;Finds module files on the disk for loadable modules matching the specified wildcard. |
| ModuleExists | bool ModuleExists(const TCHAR* ModuleName, FString* OutModuleFilePath = nullptr) const;Determines if a module with the given name exists, regardless of whether it is currently loaded. |
| GetModuleCount | int32 GetModuleCount() const;Gets the number of loaded modules. |
| UnloadModulesAtShutdown | void 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… |
| DECLARE_DELEGATE_RetVal | DECLARE_DELEGATE_RetVal(IModuleInterface*, FInitializeStaticallyLinkedModule) void RegisterStaticallyLinkedModule(const FLazyName InModuleName, const FInitializeStaticallyLinkedModule& InInitializerDelegate);Delegate that's used by the module manager to initialize a registered module that we statically linked with (monolithic only) |
| StartProcessingNewlyLoadedObjects | 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. |
| AddBinariesDirectory | void AddBinariesDirectory(const TCHAR *InDirectory, bool bIsGameDirectory);Adds an engine binaries directory. |
| LoadModuleBinaryOnly | void LoadModuleBinaryOnly(FName ModuleName);Will load the binary without doing initialization. Calling this will not make it possible to unload the module again |
| SetGameBinariesDirectory | void SetGameBinariesDirectory(const TCHAR* InDirectory);Set the game binaries directory |
| GetGameBinariesDirectory | FString GetGameBinariesDirectory() const;Gets the game binaries directory |
| IsModuleUpToDate | bool IsModuleUpToDate(const FName InModuleName) const;Checks to see if the specified module exists and is compatible with the current engine version. |
| DoesLoadedModuleHaveUObjects | bool DoesLoadedModuleHaveUObjects(const FName ModuleName) const;Determines whether the specified module contains UObjects. The module must already be loaded into memory before calling this function. |
| GetModuleFilename | FString GetModuleFilename(FName ModuleName) const;Gets the filename for a module. The return value is a full path of a module known to the module manager. |
| SetModuleFilename | void SetModuleFilename(FName ModuleName, const FString& Filename);Sets the filename for a module. The module is not reloaded immediately, but the new name will be used for subsequent unload/load events. |
| HasAnyOverridenModuleFilename | bool HasAnyOverridenModuleFilename() const;Determines if any non-default module instances are loaded (eg. hot reloaded modules) |
| SaveCurrentStateForBootstrap | void SaveCurrentStateForBootstrap(const TCHAR* Filename);Save the current module manager's state into a file for bootstrapping other processes. |
| OnModulesChanged | TTSMulticastDelegateRegistration<void(FName ModuleName, EModuleChangeReason ChangeReason)>& OnModulesChanged(); |
| OnProcessLoadedObjectsCallback | TMulticastDelegateRegistration<void(FName, bool)>& OnProcessLoadedObjectsCallback(); |
| OnRemoveLoadedObjectsCallback | TMulticastDelegateRegistration<void(TConstArrayView<FName>)>& OnRemoveLoadedObjectsCallback();Gets a multicast delegate that is executed when any UObjects need destroying before modules are unloaded. |
| OnCheckLiveObjectsInModulesCallback | TDelegateRegistration<bool(TConstArrayView<FName>)>& OnCheckLiveObjectsInModulesCallback();Gets a delegate that is executed whenever we need to confirm that modules can be safely unloaded. |
| IsPackageLoadedCallback | FIsPackageLoadedCallback& IsPackageLoadedCallback(); |
| Exec_Dev | virtual bool Exec_Dev(UWorld* Inworld, const TCHAR* Cmd, FOutputDevice& Ar) override;protectedFSelfRegisteringExec interface. |
| MakeUniqueModuleFilename | 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. |
| AddModuleToModulesList | void AddModuleToModulesList(const FName InModuleName, FModuleManager::ModuleInfoRef& ModuleInfo); |
| ResetModulePathsCache | void ResetModulePathsCache();Clears module path cache |
| LogMergedLibraryUsage | void LogMergedLibraryUsage();Dump all module usage for each loaded merged library |
| LoadAllModulesInMergedLibrary | void LoadAllModulesInMergedLibrary(FStringView LibraryName);Load all modules from a merged library |
| UnloadAllModulesInMergedLibrary | void UnloadAllModulesInMergedLibrary(FStringView LibraryName);Unload all modules from a merged library |
| OnObjectCleanup | void OnObjectCleanup();Signal that objects used by an unloading dynamic library should be cleaned up now |
Static functions 7
| Get | static FModuleManager& Get();Gets the singleton instance of the module manager. |
| TearDown | static void TearDown();Destroys singleton if it exists. Get() must not be called after Destroy(). |
| GetModuleChecked | template<typename TModuleInterface> static TModuleInterface& GetModuleChecked(const FName ModuleName);Gets a module by name, checking to ensure it exists. |
| GetModulePtr | template<typename TModuleInterface> static TModuleInterface* GetModulePtr(const FName ModuleName);Gets a module by name. |
| LoadModuleChecked | template<typename TModuleInterface> static TModuleInterface& LoadModuleChecked(const FName InModuleName);Loads a module by name, checking to ensure it exists. |
| LoadModulePtr | template<typename TModuleInterface> static TModuleInterface* LoadModulePtr(const FName InModuleName);Loads a module by name. |
| GetUBTConfiguration | static const TCHAR* GetUBTConfiguration();Gets the build configuration for compiling modules, as required by UBT. |
Functions
Free functions 7
| GetClassesToReinstanceForHotReload | extern TMap<UClass*, UClass*>& GetClassesToReinstanceForHotReload(); |
| LexToString | const TCHAR* LexToString(EModuleLoadResult LoadResult); |
| GetActiveReloadType | EActiveReloadType GetActiveReloadType();inline EActiveReloadType GetActiveReloadType();Return the currently active reload. Check for None to see if reloading is not active. This method respects the GIsHotReload setting. |
| GetActiveReloadInterface | IReload* GetActiveReloadInterface();inline IReload* GetActiveReloadInterface();Get the currently active reload interface. |
| IsReloadActive | bool IsReloadActive();inline bool IsReloadActive();Helper method to check to see if reloading is active. This method respects the GIsHotReload setting. |
| BeginReload | void BeginReload(EActiveReloadType ActiveReloadType, IReload& Interface);Begins the reload process. |
| EndReload | void EndReload();Ends the reload process |