11class schedule_executor;
26 template<
typename... Args>
28 _init_stage.
add_system(std::forward<Args>(args)...);
39 return _stages.emplace_back(*
this, name);
50 std::vector<std::unique_ptr<stage_executor>> stage_executors;
51 for (
auto&
stage : _stages) {
55 return std::make_unique<schedule_executor>(
60 stage _init_stage{ *
this };
61 std::vector<stage> _stages;
77 std::vector<std::unique_ptr<stage_executor>> stages,
78 std::unique_ptr<stage_executor> init) :
79 _registry(
registry), _stages(
std::move(stages)), _init(
std::move(init)) {
91 for (
auto&
stage : _stages) {
101 std::vector<std::unique_ptr<stage_executor>> _stages;
102 std::unique_ptr<stage_executor> _init;
static void flush(registry ®istry)
Flushes all commands in the command buffers to the given registry.
Definition command.hpp:27
Registry is a container for all our entities and components. Components are stored in continuously in...
Definition registry.hpp:13
Executes the schedule by running all stages.
Definition schedule.hpp:66
void run_once()
Executes the schedule once.
Definition schedule.hpp:90
schedule_executor(registry ®istry, std::vector< std::unique_ptr< stage_executor > > stages, std::unique_ptr< stage_executor > init)
Constructs a schedule executor.
Definition schedule.hpp:76
Manages the execution of systems in different stages.
Definition schedule.hpp:15
auto begin_stage(std::string_view name={}) -> stage &
Begins a new stage in the schedule.
Definition schedule.hpp:38
auto create_executor(registry ®istry, void *user_context=nullptr) -> std::unique_ptr< schedule_executor >
Creates an executor for the schedule.
Definition schedule.hpp:49
auto add_init_system(Args &&... args) -> self_type &
Adds an initialization system to the initial stage.
Definition schedule.hpp:27
Class representing a stage in the schedule.
Definition stage.hpp:29
auto create_executor(registry ®istry, void *user_context=nullptr) -> std::unique_ptr< stage_executor >
Creates an executor for the stage.
Definition stage.hpp:74
auto add_system(main_thread_execution_policty_t policy, auto &&... args) -> self_type &
Adds a system to the main thread execution list.
Definition stage.hpp:53
Definition archetype.hpp:11