FModuleManager

Implements the module manager.

Windows
MacOS
Linux

Inheritance Hierarchy

FExec

FSelfRegisteringExec

FModuleManager

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

Name Description

Protected function

FModuleManager()

Hidden constructor.

Use the static Get function to return the singleton instance.

Destructors

Name Description

Public function

~FModuleManager()

Destructor.

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

 

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

FSimpleMulti...

 

OnProcessLoadedObjectsCallback()

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

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

 

RegisterStaticallyLinkedModule

(
    const FName InModuleName,
    const FInitializeStaticallyLinkedMo...
)

Registers an initializer for a module that is statically linked.

Public function

void

 

ResetModulePathsCache()

Clears module path cache

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

bool

 

UnloadModule

(
    const FName InModuleName,
    bool bIsShutdown
)

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!

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

Protected class

FModuleInfo

Information about a single module (may or may not be loaded.)

Public class

FModulesChangedEvent

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

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.

FStaticallyLinkedModuleInitializerMap

Map of module names to a delegate that can initialize each respective statically linked module

ModuleInfoPtr

ModuleInfoRef

References

Module

Core

Header

Runtime/Core/Public/Modules/ModuleManager.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback