FModuleManager

Implements the module manager.

Windows
MacOS
Linux

Inheritance Hierarchy

FExec

FSelfRegisteringExec

FModuleManager

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Modules/ModuleManager.h

Include

#include "Modules/ModuleManager.h"

Syntax

class FModuleManager : private FSelfRegisteringExec

Remarks

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().

Constructors

No constructors are accessible with public or protected access.

Destructors

No destructors are accessible with public or protected access.

Functions

Name Description

Public function

void

 

AbandonModule

(
    const FName InModuleName
)

Abandons a loaded module, leaving it loaded in memory but no longer tracking it in the module manager.

Public function

void

 

AbandonModuleWithCallback

(
    const FName InModuleName
)

Calls PreUnload then abandons a module in memory.

Public function

void

 

AddBinariesDirectory

(
    const TCHAR* InDirectory,
    bool bIsGameDirectory
)

Adds an engine binaries directory.

Public function

void

 

AddExtraBinarySearchPaths()

Add any extra search paths that may be required

Public function

void

 

AddModule

(
    const FName InModuleName
)

Adds a module to our list of modules, unless it's already known.

Public function

void

 

AddModuleToModulesList

(
    const FName InModuleName,
    FModuleManager::ModuleInfoRef& Mod...
)

Public function Const

bool

 

DoesLoadedModuleHaveUObjects

(
    const FName ModuleName
)

Determines whether the specified module contains UObjects.

Public function Const

void

 

FindModules

(
    const TCHAR* WildcardWithoutEx...,
    TArray< FName >& OutModules
)

Finds module files on the disk for loadable modules matching the specified wildcard.

Public function Static

FModuleManag...

 

Get()

Gets the singleton instance of the module manager.

Public function Const

FString

 

GetGameBinariesDirectory()

Gets the game binaries directory

Public function

IModuleInter...

 

GetModule

(
    const FName InModuleName
)

Gets the specified module.

Public function Static

TModuleInter...

 

GetModuleChecked

(
    const FName ModuleName
)

Gets a module by name, checking to ensure it exists.

Public function Const

int32

 

GetModuleCount()

Gets the number of loaded modules.

Public function Const

FString

 

GetModuleFilename

(
    FName ModuleName
)

Gets the filename for a module.

Public function Static

TModuleInter...

 

GetModulePtr

(
    const FName ModuleName
)

Gets a module by name.

Public function Static

const TCHAR ...

 

GetUBTConfiguration()

Gets the build configuration for compiling modules, as required by UBT.

Public function Const

bool

 

HasAnyOverridenModuleFilename()

Determines if any non-default module instances are loaded (eg. hot reloaded modules)

Public function Const

bool

 

IsModuleLoaded

(
    const FName InModuleName
)

Checks whether the specified module is currently loaded.

This is an O(1) operation.

Public function Const

bool

 

IsModuleUpToDate

(
    const FName InModuleName
)

Checks to see if the specified module exists and is compatible with the current engine version.

Public function

FIsPackageLo...

 

IsPackageLoadedCallback()

Public function

IModuleInter...

 

LoadModule

(
    const FName InModuleName
)

Loads the specified module.

Public function

IModuleInter...

 

LoadModuleChecked

(
    const FName InModuleName
)

Loads the specified module, checking to ensure it exists.

Public function Static

TModuleInter...

 

LoadModuleChecked

(
    const FName InModuleName
)

Loads a module by name, checking to ensure it exists.

Public function Static

TModuleInter...

 

LoadModulePtr

(
    const FName InModuleName
)

Loads a module by name.

Public function

bool

 

LoadModuleWithCallback

(
    const FName InModuleName,
    FOutputDevice& Ar
)

Loads a module in memory then calls PostLoad.

Public function

IModuleInter...

 

LoadModuleWithFailureReason

(
    const FName InModuleName,
    EModuleLoadResult& OutFailureReaso...
)

Loads the specified module and returns a result.

Public function Const

void

 

MakeUniqueModuleFilename

(
    const FName InModuleName,
    FString& UniqueSuffix,
    FString& UniqueModuleFileName
)

Generates a unique file name for the specified module name by adding a random suffix and checking for file collisions.

Public function Const

bool

 

ModuleExists

(
    const TCHAR* ModuleName
)

Determines if a module with the given name exists, regardless of whether it is currently loaded.

Public function

FModulesChan...

 

OnModulesChanged()

Public function

ProcessLoade...

 

OnProcessLoadedObjectsCallback()

Public function Const

bool

 

QueryModule

(
    const FName InModuleName,
    FModuleStatus& OutModuleStatus
)

Queries information about a specific module name.

Public function Const

void

 

QueryModules

(
    TArray< FModuleStatus >& OutModule...
)

Queries information about all of the currently known modules.

Public function

void

 

RefreshModuleFilenameFromManifest

(
    const FName InModuleName
)

Public function

void

 

RegisterStaticallyLinkedModule

(
    const FLazyName InModuleName,
    const FInitializeStaticallyLinkedMo...
)

Registers an initializer for a module that is statically linked.

Public function

void

 

ResetModulePathsCache()

Clears module path cache

Public function

void

 

SaveCurrentStateForBootstrap

(
    const TCHAR* Filename
)

Save the current module manager's state into a file for bootstrapping other processes.

Public function

void

 

SetGameBinariesDirectory

(
    const TCHAR* InDirectory
)

Set the game binaries directory

Public function

void

 

SetModuleFilename

(
    FName ModuleName,
    const FString& Filename
)

Sets the filename for a module.

Public function

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.

Public function Static

void

 

TearDown()

Destroys singleton if it exists.

Public function

bool

 

UnloadModule

(
    const FName InModuleName,
    bool bIsShutdown
)

Unloads a specific module

Public function

void

 

UnloadModulesAtShutdown()

Unloads modules during the shutdown process.

Public function

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.

Overridden from FExec

Name Description

Public function Virtual

bool

 

Exec

(
    UWorld* InWorld,
    const TCHAR* Cmd,
    FOutputDevice& Ar
)

Exec handler

Classes

Name

Description

Public class

FModulesChangedEvent

Gets an event delegate that is executed when the set of known modules changed, i.e. upon module load or unload.

Public class

ProcessLoadedObjectsEvent

Gets a multicast delegate that is executed when any UObjects need processing after a module was loaded.

Typedefs

Name

Description

FInitializeStaticallyLinkedModule

Delegate that's used by the module manager to initialize a registered module that we statically linked with (monolithic only)

FIsPackageLoadedCallback

Gets a delegate that is executed when a module containing UObjects has been loaded.

FModuleMap

Type definition for maps of module names to module infos.

ModuleInfoPtr

ModuleInfoRef

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss