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

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

#include <Modules.h>

Public Member Functions

 TObserveModule (FObserveModuleListener &&listeners)
 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.
 
 TObserveModule (FName const &moduleName, FObserveModuleListener &&listeners)
 This constructor provides an explicit FName for getting the module.
 
TObserveModuleOnStartup (TFunction< void()> &&func)
 Specify function to be executed on startup.
 
TObserveModuleOnShutdown (TFunction< void()> &&func)
 Specify function to be executed on shutdown.
 

Data Fields

TBelatedEventDelegate< void()> OnStartupModule
 Event broadcasted on module startup or immediately executed upon subscription if module has already been started up.
 
TBelatedEventDelegate< void()> OnShutdownModule
 Event broadcasted on module shutdown or immediately executed upon subscription if module has already been shut down.
 

Detailed Description

template<CObservableModule M>
struct Mcro::Modules::TObserveModule< M >

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

Definition at line 147 of file Modules.h.

Constructor & Destructor Documentation

◆ TObserveModule() [1/2]

template<CObservableModule M>
Mcro::Modules::TObserveModule< M >::TObserveModule ( FObserveModuleListener && listeners)
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 155 of file Modules.h.

◆ TObserveModule() [2/2]

template<CObservableModule M>
Mcro::Modules::TObserveModule< M >::TObserveModule ( FName const & moduleName,
FObserveModuleListener && listeners )
inline

This constructor provides an explicit FName for getting the module.

Definition at line 164 of file Modules.h.

Member Function Documentation

◆ OnShutdown()

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

Specify function to be executed on shutdown.

Definition at line 192 of file Modules.h.

◆ OnStartup()

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

Specify function to be executed on startup.

Definition at line 185 of file Modules.h.

Field Documentation

◆ OnShutdownModule

template<CObservableModule 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 182 of file Modules.h.

◆ OnStartupModule

template<CObservableModule 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 175 of file Modules.h.


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