co_ecs 0.9.0
Cobalt ECS
Loading...
Searching...
No Matches
co_ecs::stage Class Reference

Class representing a stage in the schedule. More...

#include <stage.hpp>

Public Member Functions

 stage (schedule &schedule, std::string_view name={})
 Constructs a new stage object.
 
auto end_stage () noexcept -> schedule &
 Ends the current stage and returns the schedule.
 
auto add_system (main_thread_execution_policty_t policy, auto &&... args) -> self_type &
 Adds a system to the main thread execution list.
 
auto add_system (auto &&... args) -> self_type &
 Adds a system to the stage.
 
auto create_executor (registry &registry, void *user_context=nullptr) -> std::unique_ptr< stage_executor >
 Creates an executor for the stage.
 

Detailed Description

Class representing a stage in the schedule.

A stage contains systems that are executed in sequence.

Constructor & Destructor Documentation

◆ stage()

co_ecs::stage::stage ( schedule & schedule,
std::string_view name = {} )
inline

Constructs a new stage object.

Parameters
scheduleReference to the schedule object.
nameName of the stage.

Member Function Documentation

◆ add_system() [1/2]

auto co_ecs::stage::add_system ( auto &&... args) -> self_type&
inline

Adds a system to the stage.

Parameters
argsArguments for the system to be added.
Returns
Reference to this stage object.

◆ add_system() [2/2]

auto co_ecs::stage::add_system ( main_thread_execution_policty_t policy,
auto &&... args ) -> self_type&
inline

Adds a system to the main thread execution list.

Parameters
policyThe main thread execution policy.
argsArguments for the system to be added.
Returns
Reference to this stage object.

◆ create_executor()

auto co_ecs::stage::create_executor ( registry & registry,
void * user_context = nullptr ) -> std::unique_ptr<stage_executor>
inline

Creates an executor for the stage.

This function creates a stage executor, which is responsible for running the systems in the stage.

Parameters
registryReference to the registry object.
user_contextOptional user context.
Returns
Unique pointer to the created stage executor.

◆ end_stage()

auto co_ecs::stage::end_stage ( ) -> schedule&
inlinenoexcept

Ends the current stage and returns the schedule.

Returns
Reference to the schedule.

The documentation for this class was generated from the following file: