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

Base class for all plugins. More...

#include <plugin.hpp>

Public Member Functions

virtual ~Plugin ()=default
virtual void Build (App &app)=0
 Builds the plugin.
virtual void Finish (App &)
 Finishes adding this plugin to the App, once all plugins are ready.
virtual void Destroy (App &)
 Destroys the plugin and cleans up plugins.
virtual void Poll (App &)
 Advances asynchronous setup while the app waits for readiness.
virtual bool IsReady (const App &) const noexcept
 Checks if the plugin is ready for finalization.

Detailed Description

Base class for all plugins.

Definition at line 14 of file plugin.hpp.

Constructor & Destructor Documentation

◆ ~Plugin()

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

Member Function Documentation

◆ Build()

virtual void helios::app::Plugin::Build ( App & app)
pure virtual

Builds the plugin.

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

Parameters
appApplication for initialization

◆ Destroy()

virtual void helios::app::Plugin::Destroy ( App & )
inlinevirtual

Destroys the plugin and cleans up plugins.

Called during application shutdown.

Parameters
appThe application instance

Definition at line 40 of file plugin.hpp.

◆ Finish()

virtual void helios::app::Plugin::Finish ( App & )
inlinevirtual

Finishes adding this plugin to the App, once all plugins are ready.

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

Parameters
appThe application instance

Definition at line 33 of file plugin.hpp.

◆ IsReady()

virtual bool helios::app::Plugin::IsReady ( const App & ) const
inlinenodiscardvirtualnoexcept

Checks if the plugin is ready for finalization.

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

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

Definition at line 59 of file plugin.hpp.

◆ Poll()

virtual void helios::app::Plugin::Poll ( App & )
inlinevirtual

Advances asynchronous setup while the app waits for readiness.

Called from App::WaitForPluginsReady between readiness checks. Override to pump GPU/window/network init on the main thread or submit follow-up work to the app executor.

Parameters
appThe application instance

Definition at line 49 of file plugin.hpp.