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

Application class. More...

#include <application.hpp>

Public Types

using RunnerFn = std::function<ExitCode(App&)>
using ExtractFn = std::function<void(const ecs::World&, ecs::World&)>

Public Member Functions

 App ()
 App (size_t worker_thread_count)
 Constructs an App with a specific number of worker threads.
 App (const App &)=delete
 App (App &&)=delete
 ~App ()
 Destructor that ensures all async work is completed before destruction.
Appoperator= (const App &)=delete
Appoperator= (App &&)=delete
void Clear ()
 Clears the application state, removing all data.
void Initialize ()
 Initializes the application and its subsystems.
void Update ()
 Updates the application and its subsystems.
ExitCode Run ()
 Runs the application with the given arguments.
void NotifyPluginReadinessChanged () noexcept
 Notifies the app that plugin readiness may have changed.
template<PluginTrait Plugin>
auto AddPlugins (this auto &&self, Plugin &&plugin) -> decltype(std::forward< decltype(self)>(self))
 Adds plugin instance, if plugin of the same type is not already registered.
template<PluginTrait... Plugins>
requires utils::UniqueTypes<Plugins...> && (sizeof...(Plugins) > 1)
auto AddPlugins (this auto &&self, Plugins &&... plugins) -> decltype(std::forward< decltype(self)>(self))
 Adds multiple plugin instances, if plugins of the same types are not already registered.
template<PluginTrait Plugin, typename... Args>
requires std::constructible_from<Plugin, Args...>
auto EmplacePlugin (this auto &&self, Args &&... args) -> decltype(std::forward< decltype(self)>(self))
 Adds one plugin, constructing it in-place with the given arguments if a plugin of the same type is not already registered.
auto AddDynamicPlugin (this auto &&self, DynamicPlugin plugin) -> decltype(std::forward< decltype(self)>(self))
 Adds a dynamic plugin instance, if a plugin of the same type is not already registered.
template<SubAppTrait T>
auto InsertSubApp (this auto &&self, const T &label, SubApp sub_app) -> decltype(std::forward< decltype(self)>(self))
 Inserts a sub-app under the given label, if a sub-app with the same label is not already registered.
template<SubAppTrait T>
bool RemoveSubApp (const T &label={})
 Removes a registered sub-app.
auto AddSchedule (ecs::ScheduleTypeId id, ecs::Schedule &&schedule) -> ecs::ScheduleOrdering
 Adds a schedule to the main sub-app.
template<ecs::ScheduleTrait T>
auto AddSchedule (const T &label, ecs::Schedule &&schedule) -> ecs::ScheduleOrdering
 Adds a schedule to the main sub-app.
template<ecs::ScheduleTrait T>
auto InitSchedule (this auto &&self, const T &label={}) -> decltype(std::forward< decltype(self)>(self))
 Creates an empty schedule on the main sub-app when missing.
template<ecs::ScheduleTrait L, typename F>
requires std::invocable<F, ecs::Schedule&>
auto EditSchedule (this auto &&self, const L &label, const F &fn) -> decltype(std::forward< decltype(self)>(self))
 Mutates a main sub-app schedule in place.
template<ecs::ScheduleTrait L, ecs::FunctorSystemTrait S>
auto AddSystem (const L &label, S &&system, ecs::SystemLocalDataOptions options={}) -> ecs::SystemHandle
 Adds a functor system to a main sub-app schedule.
template<ecs::ScheduleTrait L, ecs::SystemTrait S>
auto AddSystem (const L &label, std::string name, S &&system, ecs::SystemLocalDataOptions options={}) -> ecs::SystemHandle
 Adds a system to a main sub-app schedule with an explicit name.
template<ecs::ScheduleTrait L, ecs::FunctorSystemTrait... Systems>
requires (sizeof...(Systems) > 1)
ecs::SystemGroupHandle AddSystems (const L &label, Systems &&... systems)
 Adds multiple functor systems to the same main sub-app schedule.
template<ecs::ScheduleTrait L, ecs::SystemSetTrait S>
auto ConfigureSet (const L &label, const S &set={}) -> ecs::SystemSetHandle
 Gets or creates a system set in a main sub-app schedule.
template<ecs::ResourceTrait... Ts>
auto InsertResources (this auto &&self, Ts &&... resources) -> decltype(std::forward< decltype(self)>(self))
 Inserts or replaces resources in the main world.
template<ecs::ResourceTrait... Ts>
auto TryInsertResources (this auto &&self, Ts &&... resources) -> decltype(std::forward< decltype(self)>(self))
 Inserts resources in the main world only when absent.
template<ecs::AnyMessageTrait... Ts>
requires (sizeof...(Ts) > 0)
auto AddMessages (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Registers multiple message types on the main world.
auto SetRunner (this auto &&self, RunnerFn runner) noexcept -> decltype(std::forward< decltype(self)>(self))
 Sets runner function for the application.
auto ShouldExit () const noexcept -> std::optional< ExitCode >
 Returns an exit code if an AppExit message was written this frame.
bool IsInitialized () const noexcept
 Checks if the app has been initialized.
bool IsRunning () const noexcept
 Checks if the app is currently running.
bool HasPlugin (PluginTypeIndex index) const noexcept
 Checks if the app has a plugin of the given type.
template<PluginTrait Plugin>
bool HasPlugins () const noexcept
 Checks if the app has a plugin of the given type.
template<PluginTrait... Plugins>
requires utils::UniqueTypes<Plugins...> && (sizeof...(Plugins) > 1)
auto HasPlugins () const noexcept -> std::array< bool, sizeof...(Plugins)>
 Checks if the app has plugins of given types.
template<SubAppTrait T>
bool HasSubApp (const T &label={}) const noexcept
 Returns whether a sub-app is registered for the label.
SubAppGetMainSubApp () noexcept
 Gets the main sub-application.
const SubAppGetMainSubApp () const noexcept
 Gets the main sub-application (const version).
SubAppGetSubApp (SubAppTypeIndex index) noexcept
 Gets the sub-app of the given type.
const SubAppGetSubApp (SubAppTypeIndex index) const noexcept
 Gets the sub-app of the given type (const version).
template<SubAppTrait T>
SubAppGetSubApp (const T &sub_app={}) noexcept
 Gets the sub-app of the given type.
template<SubAppTrait T>
const SubAppGetSubApp (const T &sub_app={}) const noexcept
 Gets the sub-app of the given type (const version).
template<ecs::ScheduleTrait T>
ecs::ScheduleTryGetSchedule (const T &label={})
 Tries to get a main sub-app schedule by label.
template<ecs::ScheduleTrait T>
const ecs::ScheduleTryGetSchedule (const T &label={}) const
 Tries to get a main sub-app schedule by label (const version).
async::ExecutorGetExecutor () noexcept
 Gets the async executor.
const async::ExecutorGetExecutor () const noexcept
 Gets the async executor (const version).
ecs::WorldGetWorld () noexcept
 Gets the main sub-app's ECS world.
const ecs::WorldGetWorld () const noexcept
 Gets the main sub-app's ECS world (const version).
SchedulerGetScheduler () noexcept
 Gets the application frame scheduler.
const SchedulerGetScheduler () const noexcept
 Gets the application frame scheduler (const version).

Friends

class Scheduler

Detailed Description

Application class.

Manages the application lifecycle, including initialization, updating, and shutdown.

Note
Partially thread-safe.

Definition at line 74 of file application.hpp.

Member Typedef Documentation

◆ ExtractFn

using helios::app::App::ExtractFn = std::function<void(const ecs::World&, ecs::World&)>

Definition at line 82 of file application.hpp.

◆ RunnerFn

using helios::app::App::RunnerFn = std::function<ExitCode(App&)>

Definition at line 81 of file application.hpp.

Constructor & Destructor Documentation

◆ App() [1/4]

helios::app::App::App ( )

Definition at line 29 of file application.cpp.

◆ App() [2/4]

helios::app::App::App ( size_t worker_thread_count)
explicit

Constructs an App with a specific number of worker threads.

Parameters
worker_thread_countNumber of worker threads for the executor

Definition at line 35 of file application.cpp.

◆ App() [3/4]

helios::app::App::App ( const App & )
delete

◆ App() [4/4]

helios::app::App::App ( App && )
delete

◆ ~App()

helios::app::App::~App ( )
inline

Destructor that ensures all async work is completed before destruction.

Waits for all overlapping updates and pending executor tasks to complete.

Definition at line 666 of file application.hpp.

Member Function Documentation

◆ AddDynamicPlugin()

auto helios::app::App::AddDynamicPlugin ( this auto && self,
DynamicPlugin plugin ) -> decltype(std::forward< decltype(self)>(self))
inline

Adds a dynamic plugin instance, if a plugin of the same type is not already registered.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Parameters
pluginDynamic plugin instance to add
Returns
Reference to app for method chaining

Definition at line 722 of file application.hpp.

◆ AddMessages()

template<ecs::AnyMessageTrait... Ts>
requires (sizeof...(Ts) > 0)
auto helios::app::App::AddMessages ( this auto && self) -> decltype(std::forward< decltype(self)>(self))
inline

Registers multiple message types on the main world.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
TsMessage types
Returns
Reference to this app for chaining

Definition at line 813 of file application.hpp.

◆ AddPlugins() [1/2]

template<PluginTrait Plugin>
auto helios::app::App::AddPlugins ( this auto && self,
Plugin && plugin ) -> decltype(std::forward< decltype(self)>(self))
inline

Adds plugin instance, if plugin of the same type is not already registered.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
PluginPlugin type
Parameters
pluginPlugin instance to add
Returns
Reference to app for method chaining

Definition at line 684 of file application.hpp.

◆ AddPlugins() [2/2]

template<PluginTrait... Plugins>
requires utils::UniqueTypes<Plugins...> && (sizeof...(Plugins) > 1)
auto helios::app::App::AddPlugins ( this auto && self,
Plugins &&... plugins ) -> decltype(std::forward< decltype(self)>(self))
inline

Adds multiple plugin instances, if plugins of the same types are not already registered.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
PluginsPlugin types
Parameters
pluginsPlugin instances to add
Returns
Reference to app for method chaining

Definition at line 698 of file application.hpp.

◆ AddSchedule() [1/2]

template<ecs::ScheduleTrait T>
auto helios::app::App::AddSchedule ( const T & label,
ecs::Schedule && schedule ) -> ecs::ScheduleOrdering
inline

Adds a schedule to the main sub-app.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
TSchedule label type
Parameters
labelLabel value
scheduleSchedule instance
Returns
Ordering handle for configuring placement

Definition at line 766 of file application.hpp.

◆ AddSchedule() [2/2]

auto helios::app::App::AddSchedule ( ecs::ScheduleTypeId id,
ecs::Schedule && schedule ) -> ecs::ScheduleOrdering
inline

Adds a schedule to the main sub-app.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Parameters
idSchedule type id
scheduleSchedule instance
Returns
Ordering handle for configuring placement

Definition at line 756 of file application.hpp.

◆ AddSystem() [1/2]

template<ecs::ScheduleTrait L, ecs::FunctorSystemTrait S>
auto helios::app::App::AddSystem ( const L & label,
S && system,
ecs::SystemLocalDataOptions options = {} ) -> ecs::SystemHandle
inline

Adds a functor system to a main sub-app schedule.

Derives name and SystemId from the functor type. Lambdas are rejected; use the AddSystem(label, name, system) overload.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
LSchedule label type
SSystem type satisfying FunctorSystemTrait
Parameters
labelTarget schedule label
systemSystem instance
optionsLocal data options
Returns
System configuration handle

Definition at line 291 of file application.hpp.

◆ AddSystem() [2/2]

template<ecs::ScheduleTrait L, ecs::SystemTrait S>
auto helios::app::App::AddSystem ( const L & label,
std::string name,
S && system,
ecs::SystemLocalDataOptions options = {} ) -> ecs::SystemHandle
inline

Adds a system to a main sub-app schedule with an explicit name.

Required for lambdas. Derives the SystemId from the provided name, enabling multiple instances of the same type.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
LSchedule label type
SSystem type satisfying SystemTrait
Parameters
labelTarget schedule label
nameHuman-readable system name
systemSystem instance
optionsLocal data options
Returns
System configuration handle

Definition at line 312 of file application.hpp.

◆ AddSystems()

template<ecs::ScheduleTrait L, ecs::FunctorSystemTrait... Systems>
requires (sizeof...(Systems) > 1)
ecs::SystemGroupHandle helios::app::App::AddSystems ( const L & label,
Systems &&... systems )
inline

Adds multiple functor systems to the same main sub-app schedule.

Returns a SystemGroupHandle for configuring the batch. Use InSet on the returned handle to assign every system to a named set.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
LSchedule label type
SystemsSystem types satisfying FunctorSystemTrait
Parameters
labelTarget schedule label
systemsSystem instances
Returns
Handle for configuring the system group

Definition at line 784 of file application.hpp.

◆ Clear()

void helios::app::App::Clear ( )

Clears the application state, removing all data.

Note
Not thread-safe.
Warning
Triggers assertion if app is running.

Definition at line 42 of file application.cpp.

◆ ConfigureSet()

template<ecs::ScheduleTrait L, ecs::SystemSetTrait S>
auto helios::app::App::ConfigureSet ( const L & label,
const S & set = {} ) -> ecs::SystemSetHandle
inline

Gets or creates a system set in a main sub-app schedule.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
LSchedule label type
SSystem set type
Parameters
labelTarget schedule label
setSystem set instance
Returns
System set handle

Definition at line 346 of file application.hpp.

◆ EditSchedule()

template<ecs::ScheduleTrait L, typename F>
requires std::invocable<F, ecs::Schedule&>
auto helios::app::App::EditSchedule ( this auto && self,
const L & label,
const F & fn ) -> decltype(std::forward< decltype(self)>(self))
inline

Mutates a main sub-app schedule in place.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
LSchedule label type
Parameters
labelTarget schedule label
fnCallable receiving ecs::Schedule&
Returns
Reference to this app for chaining

Definition at line 791 of file application.hpp.

◆ EmplacePlugin()

template<PluginTrait Plugin, typename... Args>
requires std::constructible_from<Plugin, Args...>
auto helios::app::App::EmplacePlugin ( this auto && self,
Args &&... args ) -> decltype(std::forward< decltype(self)>(self))
inline

Adds one plugin, constructing it in-place with the given arguments if a plugin of the same type is not already registered.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
PluginPlugin type
Parameters
argsArguments to construct the plugin
Returns
Reference to app for method chaining

Definition at line 710 of file application.hpp.

◆ GetExecutor() [1/2]

const async::Executor & helios::app::App::GetExecutor ( ) const
inlinenodiscardnoexcept

Gets the async executor (const version).

Note
Thread-safe.
Returns
Const reference to the async executor

Definition at line 558 of file application.hpp.

◆ GetExecutor() [2/2]

async::Executor & helios::app::App::GetExecutor ( )
inlinenodiscardnoexcept

Gets the async executor.

Note
Thread-safe.
Returns
Reference to the async executor

Definition at line 551 of file application.hpp.

◆ GetMainSubApp() [1/2]

const SubApp & helios::app::App::GetMainSubApp ( ) const
inlinenodiscardnoexcept

Gets the main sub-application (const version).

Note
Thread-safe.
Returns
Const reference to the main sub-application

Definition at line 478 of file application.hpp.

◆ GetMainSubApp() [2/2]

SubApp & helios::app::App::GetMainSubApp ( )
inlinenodiscardnoexcept

Gets the main sub-application.

Note
Thread-safe.
Returns
Reference to the main sub-application

Definition at line 471 of file application.hpp.

◆ GetScheduler() [1/2]

const Scheduler & helios::app::App::GetScheduler ( ) const
inlinenodiscardnoexcept

Gets the application frame scheduler (const version).

Note
Thread-safe.
Returns
Const reference to the application frame scheduler

Definition at line 592 of file application.hpp.

◆ GetScheduler() [2/2]

Scheduler & helios::app::App::GetScheduler ( )
inlinenodiscardnoexcept

Gets the application frame scheduler.

Note
Thread-safe.
Returns
Reference to the application frame scheduler

Definition at line 585 of file application.hpp.

◆ GetSubApp() [1/4]

template<SubAppTrait T>
const SubApp & helios::app::App::GetSubApp ( const T & sub_app = {}) const
inlinenodiscardnoexcept

Gets the sub-app of the given type (const version).

Note
Not thread-safe.
Warning
Triggers assertion if the sub-app is not found.
Template Parameters
TThe sub-app type
Parameters
sub_appThe sub-app instance to find
Returns
Const reference to the sub-app

Definition at line 851 of file application.hpp.

◆ GetSubApp() [2/4]

template<SubAppTrait T>
SubApp & helios::app::App::GetSubApp ( const T & sub_app = {})
inlinenodiscardnoexcept

Gets the sub-app of the given type.

Note
Not thread-safe.
Warning
Triggers assertion if the sub-app is not found.
Template Parameters
TThe sub-app type
Parameters
sub_appThe sub-app instance to find
Returns
Reference to the sub-app

Definition at line 843 of file application.hpp.

◆ GetSubApp() [3/4]

const SubApp & helios::app::App::GetSubApp ( SubAppTypeIndex index) const
inlinenodiscardnoexcept

Gets the sub-app of the given type (const version).

Note
Not thread-safe.
Warning
Triggers assertion if the sub-app is not found.
Parameters
indexThe sub-app type index
Returns
Const reference to the sub-app

Definition at line 836 of file application.hpp.

◆ GetSubApp() [4/4]

SubApp & helios::app::App::GetSubApp ( SubAppTypeIndex index)
inlinenodiscardnoexcept

Gets the sub-app of the given type.

Note
Not thread-safe.
Warning
Triggers assertion if the sub-app is not found.
Parameters
indexThe sub-app type index
Returns
Reference to the sub-app

Definition at line 830 of file application.hpp.

◆ GetWorld() [1/2]

const ecs::World & helios::app::App::GetWorld ( ) const
inlinenodiscardnoexcept

Gets the main sub-app's ECS world (const version).

Note
Thread-safe.
Returns
Const reference to the main sub-app's ECS world

Definition at line 576 of file application.hpp.

◆ GetWorld() [2/2]

ecs::World & helios::app::App::GetWorld ( )
inlinenodiscardnoexcept

Gets the main sub-app's ECS world.

Note
Thread-safe.
Returns
Reference to the main sub-app's ECS world

Definition at line 567 of file application.hpp.

◆ HasPlugin()

bool helios::app::App::HasPlugin ( PluginTypeIndex index) const
inlinenodiscardnoexcept

Checks if the app has a plugin of the given type.

Note
Not thread-safe.
Returns
True if the plugin is registered, false otherwise

Definition at line 429 of file application.hpp.

◆ HasPlugins() [1/2]

template<PluginTrait Plugin>
bool helios::app::App::HasPlugins ( ) const
inlinenodiscardnoexcept

Checks if the app has a plugin of the given type.

Note
Not thread-safe.
Returns
True if the plugin is registered, false otherwise

Definition at line 439 of file application.hpp.

◆ HasPlugins() [2/2]

template<PluginTrait... Plugins>
requires utils::UniqueTypes<Plugins...> && (sizeof...(Plugins) > 1)
auto helios::app::App::HasPlugins ( ) const -> std::array< bool, sizeof...(Plugins)>
inlinenodiscardnoexcept

Checks if the app has plugins of given types.

Note
Not thread-safe.
Returns
Array of bools indicating whether each plugin is registered

Definition at line 450 of file application.hpp.

◆ HasSubApp()

template<SubAppTrait T>
bool helios::app::App::HasSubApp ( const T & label = {}) const
inlinenodiscardnoexcept

Returns whether a sub-app is registered for the label.

Template Parameters
TSub-app label type
Parameters
labelSub-app label to check
Returns
True if the sub-app is registered, false otherwise

Definition at line 462 of file application.hpp.

◆ Initialize()

void helios::app::App::Initialize ( )

Initializes the application and its subsystems.

Called before the main loop starts. Spawns tasks on the executor for parallel initialization.

Automaticly called in Run().

Note
Not thread-safe.
Warning
Triggers assertion if app is already initialized or running.

Definition at line 56 of file application.cpp.

◆ InitSchedule()

template<ecs::ScheduleTrait T>
auto helios::app::App::InitSchedule ( this auto && self,
const T & label = {} ) -> decltype(std::forward< decltype(self)>(self))
inline

Creates an empty schedule on the main sub-app when missing.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
TSchedule label type
Parameters
labelLabel value
Returns
Reference to this app for chaining

Definition at line 776 of file application.hpp.

◆ InsertResources()

template<ecs::ResourceTrait... Ts>
auto helios::app::App::InsertResources ( this auto && self,
Ts &&... resources ) -> decltype(std::forward< decltype(self)>(self))
inline

Inserts or replaces resources in the main world.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
TsResource types
Parameters
resourcesResource values
Returns
Reference to this app for chaining

Definition at line 798 of file application.hpp.

◆ InsertSubApp()

template<SubAppTrait T>
auto helios::app::App::InsertSubApp ( this auto && self,
const T & label,
SubApp sub_app ) -> decltype(std::forward< decltype(self)>(self))
inline

Inserts a sub-app under the given label, if a sub-app with the same label is not already registered.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
TSub-app label type
Parameters
labelLabel value
sub_appSub-app instance (executor is injected by App)
Returns
Reference to this app for chaining

Definition at line 735 of file application.hpp.

◆ IsInitialized()

bool helios::app::App::IsInitialized ( ) const
inlinenodiscardnoexcept

Checks if the app has been initialized.

Note
Not thread-safe.
Returns
True if initialized, false otherwise

Definition at line 413 of file application.hpp.

◆ IsRunning()

bool helios::app::App::IsRunning ( ) const
inlinenodiscardnoexcept

Checks if the app is currently running.

Note
Thread-safe.
Returns
True if running, false otherwise

Definition at line 420 of file application.hpp.

◆ NotifyPluginReadinessChanged()

void helios::app::App::NotifyPluginReadinessChanged ( )
inlinenoexcept

Notifies the app that plugin readiness may have changed.

Async plugins should call this after completing background setup so WaitForPluginsReady can resume without busy-waiting.

Note
Not thread-safe.

Definition at line 147 of file application.hpp.

◆ operator=() [1/2]

App & helios::app::App::operator= ( App && )
delete

◆ operator=() [2/2]

App & helios::app::App::operator= ( const App & )
delete

◆ RemoveSubApp()

template<SubAppTrait T>
bool helios::app::App::RemoveSubApp ( const T & label = {})
inline

Removes a registered sub-app.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
TSub-app label type
Returns
True if a sub-app was removed

Definition at line 748 of file application.hpp.

◆ Run()

ExitCode helios::app::App::Run ( )

Runs the application with the given arguments.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Returns
Exit code of the application.

Definition at line 74 of file application.cpp.

◆ SetRunner()

auto helios::app::App::SetRunner ( this auto && self,
RunnerFn runner ) -> decltype(std::forward< decltype(self)>(self))
inlinenoexcept

Sets runner function for the application.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Triggers assertion in next cases:
  • App is initialized
  • App is running
  • Runner is null
Parameters
runnerA move-only function that takes an App reference and returns an ExitCode.
Returns
Reference to app for method chaining

Definition at line 819 of file application.hpp.

◆ ShouldExit()

auto helios::app::App::ShouldExit ( ) const -> std::optional< ExitCode >
nodiscardnoexcept

Returns an exit code if an AppExit message was written this frame.

Note
Not thread-safe.
Returns
Exit code when AppExit is present, otherwise std::nullopt

Definition at line 92 of file application.cpp.

◆ TryGetSchedule() [1/2]

template<ecs::ScheduleTrait T>
ecs::Schedule * helios::app::App::TryGetSchedule ( const T & label = {})
inlinenodiscard

Tries to get a main sub-app schedule by label.

Note
Not thread-safe.
Template Parameters
TSchedule label type
Parameters
labelSchedule label to search for
Returns
Pointer to the schedule, or nullptr if not found

Definition at line 530 of file application.hpp.

◆ TryGetSchedule() [2/2]

template<ecs::ScheduleTrait T>
const ecs::Schedule * helios::app::App::TryGetSchedule ( const T & label = {}) const
inlinenodiscard

Tries to get a main sub-app schedule by label (const version).

Note
Not thread-safe.
Template Parameters
TSchedule label type
Parameters
labelSchedule label to search for
Returns
Pointer to the schedule, or nullptr if not found

Definition at line 542 of file application.hpp.

◆ TryInsertResources()

template<ecs::ResourceTrait... Ts>
auto helios::app::App::TryInsertResources ( this auto && self,
Ts &&... resources ) -> decltype(std::forward< decltype(self)>(self))
inline

Inserts resources in the main world only when absent.

Note
Not thread-safe.
Warning
Triggers assertion if app is initialized or running.
Template Parameters
TsResource types
Parameters
resourcesResource values
Returns
Reference to this app for chaining

Definition at line 805 of file application.hpp.

◆ Update()

void helios::app::App::Update ( )
inline

Updates the application and its subsystems.

Calls Update on the main sub-app and all registered sub-apps. Spawns async tasks as needed.

Note
Not thread-safe.
Warning
Triggers assertion if app is not initialized.

Definition at line 674 of file application.hpp.

◆ Scheduler

friend class Scheduler
friend

Definition at line 663 of file application.hpp.