Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::ecs::SingleThreadedExecutor Class Referencefinal

Single-threaded executor that runs systems sequentially on a single thread. More...

#include <single_threaded.hpp>

Inheritance diagram for helios::ecs::SingleThreadedExecutor:
helios::ecs::Executor

Public Member Functions

 SingleThreadedExecutor (async::Executor &executor) noexcept
 Constructs a single-threaded executor with an external async executor.
 SingleThreadedExecutor (const SingleThreadedExecutor &)=delete
 SingleThreadedExecutor (SingleThreadedExecutor &&) noexcept=default
 ~SingleThreadedExecutor () override=default
SingleThreadedExecutoroperator= (const SingleThreadedExecutor &)=delete
SingleThreadedExecutoroperator= (SingleThreadedExecutor &&) noexcept=default
void Execute (Schedule &schedule, World &world) override
 Executes the schedule using the single-threaded executor.
void ExecuteAndWait (Schedule &schedule, World &world) override
 Executes all systems in the schedule and blocks until completion.
void Wait () override
 Waits for the most recent Execute() to complete.
Public Member Functions inherited from helios::ecs::Executor
virtual ~Executor ()=default

Detailed Description

Single-threaded executor that runs systems sequentially on a single thread.

Uses an async::Executor with a async::TaskGraph where all tasks are linearized (each depends on the previous), guaranteeing sequential execution while still using the thread pool infrastructure.

Definition at line 22 of file single_threaded.hpp.

Constructor & Destructor Documentation

◆ SingleThreadedExecutor() [1/3]

helios::ecs::SingleThreadedExecutor::SingleThreadedExecutor ( async::Executor & executor)
inlineexplicitnoexcept

Constructs a single-threaded executor with an external async executor.

Parameters
executorReference to the async executor for task execution

Definition at line 29 of file single_threaded.hpp.

◆ SingleThreadedExecutor() [2/3]

helios::ecs::SingleThreadedExecutor::SingleThreadedExecutor ( const SingleThreadedExecutor & )
delete

◆ SingleThreadedExecutor() [3/3]

helios::ecs::SingleThreadedExecutor::SingleThreadedExecutor ( SingleThreadedExecutor && )
defaultnoexcept

◆ ~SingleThreadedExecutor()

helios::ecs::SingleThreadedExecutor::~SingleThreadedExecutor ( )
overridedefault

Member Function Documentation

◆ Execute()

void helios::ecs::SingleThreadedExecutor::Execute ( Schedule & schedule,
World & world )
overridevirtual

Executes the schedule using the single-threaded executor.

Parameters
scheduleThe schedule to execute
worldThe world context for system execution

Implements helios::ecs::Executor.

Definition at line 81 of file single_threaded.cpp.

◆ ExecuteAndWait()

void helios::ecs::SingleThreadedExecutor::ExecuteAndWait ( Schedule & schedule,
World & world )
overridevirtual

Executes all systems in the schedule and blocks until completion.

Default implementation calls Execute() then Wait().

Parameters
scheduleCompiled schedule to execute
worldWorld to pass to each system

Reimplemented from helios::ecs::Executor.

Definition at line 86 of file single_threaded.cpp.

◆ operator=() [1/2]

SingleThreadedExecutor & helios::ecs::SingleThreadedExecutor::operator= ( const SingleThreadedExecutor & )
delete

◆ operator=() [2/2]

SingleThreadedExecutor & helios::ecs::SingleThreadedExecutor::operator= ( SingleThreadedExecutor && )
defaultnoexcept

◆ Wait()

void helios::ecs::SingleThreadedExecutor::Wait ( )
inlineoverridevirtual

Waits for the most recent Execute() to complete.

Blocks until the submitted task graph finishes.

Reimplemented from helios::ecs::Executor.

Definition at line 64 of file single_threaded.hpp.