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

Orchestrates the main sub-app schedule loop and sub-app updates. More...

#include <scheduler.hpp>

Public Member Functions

 Scheduler ()=default
 Scheduler (const Scheduler &)=delete
 Scheduler (Scheduler &&other) noexcept
 ~Scheduler ()=default
Scheduleroperator= (const Scheduler &)=delete
Scheduleroperator= (Scheduler &&other) noexcept
void Build (App &app)
 Builds schedulers and precomputes sub-app task graphs.
void RunStartup (App &app)
 Runs startup on the main sub-app, then startup on all sub-apps in parallel, then starts async sub-app update loops.
void RunFrame (App &app)
 Runs one full application frame.
void Shutdown (App &app)
 Stops async loops, waits for in-flight updates, shuts down sub-apps, then the main sub-app.
void WaitForSubApps ()
 Waits until blocking sub-apps finish their frame update.
void Clear ()
 Clears cached task graphs and pending sub-app update state.

Detailed Description

Orchestrates the main sub-app schedule loop and sub-app updates.

Each frame runs the main sub-app kUpdateStage, then kExtractStage, then sub-app updates. Blocking sub-apps are joined each frame. Overlapping sub-apps may skip extraction while an update is in flight, up to kMaxOverlappingUpdates consecutive frames (0 = unlimited). Async sub-apps run updates on a background loop; extraction runs every main frame.

Definition at line 27 of file scheduler.hpp.

Constructor & Destructor Documentation

◆ Scheduler() [1/3]

helios::app::Scheduler::Scheduler ( )
default

◆ Scheduler() [2/3]

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

◆ Scheduler() [3/3]

helios::app::Scheduler::Scheduler ( Scheduler && other)
inlinenoexcept

Definition at line 106 of file scheduler.hpp.

◆ ~Scheduler()

helios::app::Scheduler::~Scheduler ( )
default

Member Function Documentation

◆ Build()

void helios::app::Scheduler::Build ( App & app)

Builds schedulers and precomputes sub-app task graphs.

Parameters
appOwning application

Definition at line 17 of file scheduler.cpp.

◆ Clear()

void helios::app::Scheduler::Clear ( )
inline

Clears cached task graphs and pending sub-app update state.

Definition at line 132 of file scheduler.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

Scheduler & helios::app::Scheduler::operator= ( Scheduler && other)
inlinenoexcept

Definition at line 115 of file scheduler.hpp.

◆ RunFrame()

void helios::app::Scheduler::RunFrame ( App & app)

Runs one full application frame.

Parameters
appOwning application

Definition at line 76 of file scheduler.cpp.

◆ RunStartup()

void helios::app::Scheduler::RunStartup ( App & app)

Runs startup on the main sub-app, then startup on all sub-apps in parallel, then starts async sub-app update loops.

Parameters
appOwning application

Definition at line 62 of file scheduler.cpp.

◆ Shutdown()

void helios::app::Scheduler::Shutdown ( App & app)

Stops async loops, waits for in-flight updates, shuts down sub-apps, then the main sub-app.

Parameters
appOwning application

Definition at line 92 of file scheduler.cpp.

◆ WaitForSubApps()

void helios::app::Scheduler::WaitForSubApps ( )

Waits until blocking sub-apps finish their frame update.

Definition at line 115 of file scheduler.cpp.