Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
helios::app::Module Class Referenceabstract

Base class for all modules. More...

#include <module.hpp>

Inheritance diagram for helios::app::Module:
helios::example::ExampleModule

Public Member Functions

virtual ~Module ()=default
 
virtual void Build (App &app)=0
 Builds the module.
 
virtual void Destroy (App &app)
 Destroys the module and cleans up resources.
 
virtual bool IsReady (const App &app) const noexcept
 Checks if the module is ready for finalization.
 
virtual void Finish (App &app)
 Finishes adding this module to the App, once all modules are ready.
 

Detailed Description

Base class for all modules.

Derived classes must implement:

Examples
Library.

Definition at line 25 of file module.hpp.

Constructor & Destructor Documentation

◆ ~Module()

virtual helios::app::Module::~Module ( )
virtualdefault

Member Function Documentation

◆ Build()

virtual void helios::app::Module::Build ( App app)
pure virtual

Builds the module.

Called during application initialization to set up the module. This is where you should register systems, resources, and events.

Parameters
appApplication for initialization

Implemented in helios::example::ExampleModule.

Examples
Library.

◆ Destroy()

virtual void helios::app::Module::Destroy ( App app)
inlinevirtual

Destroys the module and cleans up resources.

Called during application shutdown.

Parameters
appThe application instance

Reimplemented in helios::example::ExampleModule.

Examples
Library.

Definition at line 42 of file module.hpp.

42{ (void)app; }

◆ Finish()

virtual void helios::app::Module::Finish ( App app)
inlinevirtual

Finishes adding this module to the App, once all modules are ready.

This can be useful for modules that depend on another module's asynchronous setup, like the renderer. Called after all modules' Build methods have been called and all modules return true from IsReady.

Parameters
appThe application instance

Definition at line 64 of file module.hpp.

64{ (void)app; }

◆ IsReady()

virtual bool helios::app::Module::IsReady ( const App app) const
inlinevirtualnoexcept

Checks if the module is ready for finalization.

This can be useful for modules that need something asynchronous to happen before they can finish their setup, like the initialization of a renderer. Once the module is ready, Finish will be called.

Parameters
appThe application instance (const)
Returns
True if the module is ready, false otherwise

Definition at line 52 of file module.hpp.

52 {
53 (void)app;
54 return true;
55 }