MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Modules.h File Reference
#include "CoreMinimal.h"
#include "Modules/ModuleInterface.h"
#include "Modules/ModuleManager.h"
#include "Mcro/AssertMacros.h"
#include "Mcro/TextMacros.h"
#include "Mcro/TypeName.h"
#include "Mcro/Delegates/EventDelegate.h"
#include "Mcro/Error.h"
#include "Mcro/Enums.h"

Go to the source code of this file.

Data Structures

class  Mcro::Modules::IObservableModule
 Add this interface to your module class if other things can listen to module startup or shutdown. More...
 
struct  Mcro::Modules::FObserveModuleListener
 A record for the module event listeners. More...
 
struct  Mcro::Modules::TObserveModule< M >
 Use this in global variables to automatically do things on module startup or shutdown. More...
 
struct  Mcro::Modules::TModuleBoundObject< M, T >
 A wrapper around a given object which lifespan is bound to given module. More...
 
struct  Mcro::Modules::TModuleBoundObject< M, T >::FObjectFactory
 

Namespaces

namespace  Mcro
 
namespace  Mcro::Modules
 Namespace for utilities handling Unreal modules.
 

Concepts

concept  Mcro::Modules::CObservableModule
 

Functions

template<CDerivedFrom< IModuleInterface > M>
FString Mcro::Modules::InferModuleName ()
 Infer the module name from an input type. This exists because there's a very reliable naming convention for class names representing modules. The inference is removing the first letter Hungarian type notation and removing "Module" or "ModuleInterface" from the end.
 
template<CDerivedFrom< IModuleInterface > M>
TMaybe< M * > Mcro::Modules::TryLoadUnrealModule ()
 Try to load a module and return an IError when that fails for any reason. Module name is inferred from type described in.
 
template<CDerivedFrom< IModuleInterface > M>
M & Mcro::Modules::LoadUnrealModule ()
 Load a module or crash with IError if it cannot be done for any reason Module name is inferred from type described in.
 
template<CDerivedFrom< IModuleInterface > M>
M * Mcro::Modules::GetUnrealModulePtr ()
 Shorthand for FModuleManager::GetModulePtr with the name inferred from given type.
 
template<CDerivedFrom< IModuleInterface > M>
M & Mcro::Modules::GetUnrealModule ()
 Get an already loaded unreal module. If for any reason it's not loaded, crash the app.
 

Detailed Description

Author
David Mórász
Date
2025

Definition in file Modules.h.