MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::Modules::TObserveModule< M > Struct Template Reference

#include <Modules.h>

Public Member Functions

 TObserveModule ()
 
 TObserveModule (FName const &moduleName)
 
TObserveModuleOnStartup (TFunction< void()> &&func)
 
TObserveModuleOnShutdown (TFunction< void()> &&func)
 

Data Fields

TBelatedEventDelegate< void()> OnStartupModule
 
TBelatedEventDelegate< void()> OnShutdownModule
 

Detailed Description

template<CDerivedFrom< IObservableModule > M>
struct Mcro::Modules::TObserveModule< M >

Use this in global variables to automatically do things on module startup or shutdown

Definition at line 47 of file Modules.h.

Constructor & Destructor Documentation

◆ TObserveModule() [1/2]

template<CDerivedFrom< IObservableModule > M>
Mcro::Modules::TObserveModule< M >::TObserveModule ( )
inline

Default constructor will try to infer module name from type name. Given convention `(F|I)Foobar(Module(Interface)?)? the extracted name will be Foobar. If your module doesn't follow this naming use the constructor accepting an FName

Definition at line 54 of file Modules.h.

◆ TObserveModule() [2/2]

template<CDerivedFrom< IObservableModule > M>
Mcro::Modules::TObserveModule< M >::TObserveModule ( FName const & moduleName)
inline

This constructor provides an explicit FName for getting the module

Definition at line 63 of file Modules.h.

Member Function Documentation

◆ OnShutdown()

template<CDerivedFrom< IObservableModule > M>
TObserveModule & Mcro::Modules::TObserveModule< M >::OnShutdown ( TFunction< void()> && func)
inline

Specify function to be executed on shutdown

Definition at line 88 of file Modules.h.

◆ OnStartup()

template<CDerivedFrom< IObservableModule > M>
TObserveModule & Mcro::Modules::TObserveModule< M >::OnStartup ( TFunction< void()> && func)
inline

Specify function to be executed on startup

Definition at line 81 of file Modules.h.

Field Documentation

◆ OnShutdownModule

template<CDerivedFrom< IObservableModule > M>
TBelatedEventDelegate<void()> Mcro::Modules::TObserveModule< M >::OnShutdownModule

Event broadcasted on module shutdown or immediately executed upon subscription if module has already been shut down.

Definition at line 78 of file Modules.h.

◆ OnStartupModule

template<CDerivedFrom< IObservableModule > M>
TBelatedEventDelegate<void()> Mcro::Modules::TObserveModule< M >::OnStartupModule

Event broadcasted on module startup or immediately executed upon subscription if module has already been started up.

Definition at line 72 of file Modules.h.


The documentation for this struct was generated from the following file: