UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ModuleManager.h File Reference
#include "Containers/Array.h"
#include "Containers/ContainerAllocationPolicies.h"
#include "Containers/Map.h"
#include "Containers/UnrealString.h"
#include "CoreTypes.h"
#include "Delegates/Delegate.h"
#include "HAL/CriticalSection.h"
#include "HAL/PlatformCrt.h"
#include "HAL/PreprocessorHelpers.h"
#include "Misc/AssertionMacros.h"
#include "Misc/Build.h"
#include "Misc/CoreMisc.h"
#include "Misc/EnumClassFlags.h"
#include "Misc/Optional.h"
#include "Modules/Boilerplate/ModuleBoilerplate.h"
#include "Modules/ModuleInterface.h"
#include "Serialization/Archive.h"
#include "Templates/Atomic.h"
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "Templates/UnrealTemplate.h"
#include "UObject/NameTypes.h"

Go to the source code of this file.

Classes

struct  FModuleStatus
 
struct  FModuleDiskInfo
 
class  FModuleManager
 
class  FStaticallyLinkedModuleRegistrant< ModuleClass >
 
class  FModuleInitializerEntry
 
class  FDefaultModuleImpl
 
class  FDefaultGameModuleImpl
 

Namespaces

namespace  UE
 
namespace  UE::Core
 
namespace  UE::Core::Private
 implementation
 

Macros

#define IMPLEMENT_MODULE(ModuleImplClass, ModuleName)
 
#define IMPLEMENT_GAME_MODULE(ModuleImplClass, ModuleName)    IMPLEMENT_MODULE( ModuleImplClass, ModuleName )
 
#define IMPLEMENT_FOREIGN_ENGINE_DIR()
 
#define UE_LIST_ARGUMENT(...)   __VA_ARGS__
 
#define UE_REGISTER_SIGNING_KEY(ExponentValue, ModulusValue)
 
#define UE_REGISTER_ENCRYPTION_KEY(...)
 
#define IMPLEMENT_TARGET_NAME_REGISTRATION()
 
#define IMPLEMENT_PRIMARY_GAME_MODULE(ModuleImplClass, ModuleName, GameName)
 

Typedefs

typedef IModuleInterface *(* FInitializeModuleFunctionPtr) (void)
 

Enumerations

enum class  EModuleLoadResult {
  Success , FileNotFound , FileIncompatible , CouldNotBeLoadedByOS ,
  FailedToInitialize , NotLoadedByGameThread
}
 
enum class  EModuleUnloadResult { Success , UnloadNotSupported }
 
enum class  EModuleChangeReason { ModuleLoaded , ModuleUnloaded , PluginDirectoryChanged }
 
enum class  ECheckModuleCompatibilityFlags { None = 0x00 , DisplayUpToDateModules = 0x01 }
 
enum class  ELoadModuleFlags { None = 0x0 , LogFailures = 1 << 0 }
 
enum class  EActiveReloadType { None , Reinstancing }
 

Functions

CORE_API const TCHARLexToString (EModuleLoadResult LoadResult)
 
TOptional< FModuleManager > & UE::Core::Private::GetModuleManagerSingleton ()
 
EActiveReloadType GetActiveReloadType ()
 
bool IsReloadActive ()
 
IReloadGetActiveReloadInterface ()
 

Macro Definition Documentation

◆ IMPLEMENT_FOREIGN_ENGINE_DIR

#define IMPLEMENT_FOREIGN_ENGINE_DIR ( )

Macro for declaring the engine directory to check for foreign or nested projects.

◆ IMPLEMENT_GAME_MODULE

#define IMPLEMENT_GAME_MODULE (   ModuleImplClass,
  ModuleName 
)     IMPLEMENT_MODULE( ModuleImplClass, ModuleName )

Module implementation boilerplate for game play code modules.

This macro works like IMPLEMENT_MODULE but is specifically used for modules that contain game play code. If your module does not contain game classes, use IMPLEMENT_MODULE instead.

Usage: IMPLEMENT_GAME_MODULE(<My Game Module Class>, <Game Module name string>)

See also
IMPLEMENT_MODULE

◆ IMPLEMENT_MODULE

#define IMPLEMENT_MODULE (   ModuleImplClass,
  ModuleName 
)
Value:
\
\
/* InitializeModule function, called by module manager after this module's DLL has been loaded */ \
\
/* @return Returns an instance of this module */ \
\
static IModuleInterface* Initialize##ModuleName##Module() \
{ \
return new ModuleImplClass(); \
} \
static FModuleInitializerEntry ModuleName##InitializerEntry(TEXT(#ModuleName), Initialize##ModuleName##Module, TEXT(UE_MODULE_NAME)); \
/* Forced reference to this function is added by the linker to check that each module uses IMPLEMENT_MODULE */ \
extern "C" void IMPLEMENT_MODULE_##ModuleName() { UE_STATIC_ASSERT_WARN(UE::Core::Private::ModuleNameEquals(#ModuleName, UE_MODULE_NAME ), "Module name mismatch (" #ModuleName " != " UE_MODULE_NAME "). Please ensure module name passed to IMPLEMENT_MODULE is " UE_MODULE_NAME " to avoid runtime errors in monolithic builds."); } \
#define UE_STATIC_ASSERT_WARN(bExpression, Message)
Definition CoreMiscDefines.h:431
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition ModuleManager.h:852
Definition ModuleInterface.h:14

◆ IMPLEMENT_PRIMARY_GAME_MODULE

#define IMPLEMENT_PRIMARY_GAME_MODULE (   ModuleImplClass,
  ModuleName,
  GameName 
)
Value:
/* Nothing special to do for modular builds. The game name will be set via the command-line */ \

IMPLEMENT_PRIMARY_GAME_MODULE must be used for at least one game module in your game. It sets the "name" your game when compiling in monolithic mode. This is passed in by UBT from the .uproject name, and manually specifying a name is no longer necessary.

◆ IMPLEMENT_TARGET_NAME_REGISTRATION

#define IMPLEMENT_TARGET_NAME_REGISTRATION ( )
Value:
{ \
{ \
FPlatformMisc::SetUBTTargetName(TEXT(PREPROCESSOR_TO_STRING(UE_TARGET_NAME))); \
} \
#define PREPROCESSOR_TO_STRING(Token)
Definition PreprocessorHelpers.h:103

◆ UE_LIST_ARGUMENT

#define UE_LIST_ARGUMENT (   ...)    __VA_ARGS__

Macro for passing a list argument to a macro

◆ UE_REGISTER_ENCRYPTION_KEY

#define UE_REGISTER_ENCRYPTION_KEY (   ...)
Value:
{ \
{ \
extern CORE_API void RegisterEncryptionKeyCallback(void (*)(unsigned char OutKey[32])); \
} \
static void Callback(unsigned char OutKey[32]) \
{ \
const unsigned char Key[32] = { __VA_ARGS__ }; \
for(int ByteIdx = 0; ByteIdx < 32; ByteIdx++) \
{ \
} \
} \
CORE_API void RegisterEncryptionKeyCallback(TEncryptionKeyFunc InCallback)
Definition CoreDelegates.cpp:368

Macro for registering encryption key for a project.

◆ UE_REGISTER_SIGNING_KEY

#define UE_REGISTER_SIGNING_KEY (   ExponentValue,
  ModulusValue 
)
Value:
{ \
{ \
} \
{ \
const uint8 Exponent[] = { ExponentValue }; \
const uint8 Modulus[] = { ModulusValue }; \
OutExponent.SetNum(UE_ARRAY_COUNT(Exponent)); \
OutModulus.SetNum(UE_ARRAY_COUNT(Modulus)); \
for(int ByteIdx = 0; ByteIdx < UE_ARRAY_COUNT(Exponent); ByteIdx++) \
{ \
OutExponent[ByteIdx] = Exponent[ByteIdx]; \
} \
for(int ByteIdx = 0; ByteIdx < UE_ARRAY_COUNT(Modulus); ByteIdx++) \
{ \
OutModulus[ByteIdx] = Modulus[ByteIdx]; \
} \
} \
CORE_API void RegisterSigningKeyCallback(TSigningKeyFunc InCallback)
Definition CoreDelegates.cpp:360
#define UE_ARRAY_COUNT(array)
Definition UnrealTemplate.h:212
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Array.h:670

Macro for registering signing keys for a project.

Typedef Documentation

◆ FInitializeModuleFunctionPtr

typedef IModuleInterface *(* FInitializeModuleFunctionPtr) (void)

Function pointer type for InitializeModule().

All modules must have a FModuleInitializerEntry instance or an InitializeModule() function. Usually this is declared automatically using the IMPLEMENT_MODULE macro below. If using the function it must be declared using as 'extern "C"' so that the name remains undecorated. The object returned will be "owned" by the caller, and will be deleted by the caller before the module is unloaded.

Enumeration Type Documentation

◆ EActiveReloadType

enum class EActiveReloadType
strong

Enumerates the type of reload in progress

Enumerator
None 
Reinstancing 

◆ ECheckModuleCompatibilityFlags

Enumerator
None 
DisplayUpToDateModules 

◆ ELoadModuleFlags

enum class ELoadModuleFlags
strong
Enumerator
None 
LogFailures 

◆ EModuleChangeReason

enum class EModuleChangeReason
strong

Enumerates reasons for modules to change.

Values of this type will be passed into OnModuleChanged() delegates.

Enumerator
ModuleLoaded 

A module has been loaded and is ready to be used.

ModuleUnloaded 
PluginDirectoryChanged 

The paths controlling which plug-ins are loaded have been changed and the given module has been found, but not yet loaded.

◆ EModuleLoadResult

enum class EModuleLoadResult
strong

Enumerates reasons for failed module loads.

Enumerator
Success 

Module loaded successfully.

FileNotFound 

The specified module file could not be found.

FileIncompatible 

The specified module file is incompatible with the module system.

CouldNotBeLoadedByOS 

The operating system failed to load the module file.

FailedToInitialize 

Module initialization failed.

NotLoadedByGameThread 

A thread attempted to load the module before the Game thread did.

◆ EModuleUnloadResult

enum class EModuleUnloadResult
strong

Enumerates reasons for failed module unloads.

Enumerator
Success 

Module unloaded successfully.

UnloadNotSupported 

Module does not support dynamic reloading (see IModuleInterface::SupportsDynamicReloading).

Function Documentation

◆ GetActiveReloadInterface()

IReload * GetActiveReloadInterface ( )
inline

◆ GetActiveReloadType()

EActiveReloadType GetActiveReloadType ( )
inline

◆ IsReloadActive()

bool IsReloadActive ( )
inline

◆ LexToString()

CORE_API const TCHAR * LexToString ( EModuleLoadResult  LoadResult)