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

Main scheduler that manages all schedules. More...

#include <scheduler.hpp>

Public Member Functions

 Scheduler ()=default
 
 Scheduler (const Scheduler &)=delete
 
 Scheduler (Scheduler &&) noexcept=default
 
 ~Scheduler ()=default
 
Scheduleroperator= (const Scheduler &)=delete
 
Scheduleroperator= (Scheduler &&) noexcept=default
 
void Clear ()
 Clears all schedules and systems.
 
template<ScheduleTrait T>
void RegisterSchedule ()
 Registers a schedule type.
 
template<ecs::SystemTrait T, ScheduleTrait S>
void AddSystem (S schedule={})
 Adds a system to the specified schedule.
 
template<ecs::SystemTrait T, ScheduleTrait S>
void RegisterOrdering (S schedule, SystemOrdering ordering)
 Registers ordering constraint for a system.
 
template<ScheduleTrait S>
void ExecuteSchedule (ecs::World &world, async::Executor &executor)
 Executes all systems in the specified schedule.
 
void ExecuteScheduleById (ScheduleId schedule_id, ecs::World &world, async::Executor &executor)
 Executes all systems in the specified schedule by ID.
 
template<StageTrait S>
void ExecuteStage (ecs::World &world, async::Executor &executor)
 Executes all schedules in the specified stage.
 
void MergeCommandsToWorld (ecs::World &world)
 Merges all system local commands into the world's main command queue.
 
void ResetFrameAllocators () noexcept
 Resets all system frame allocators.
 
void BuildAllGraphs (ecs::World &world)
 Builds execution graphs for all schedules.
 
template<ecs::SystemTrait T, ScheduleTrait S>
void AppendSystemOrderingMetadata (S schedule, std::span< const ecs::SystemTypeId > before, std::span< const ecs::SystemTypeId > after)
 Appends system ordering constraints to a system's metadata in a specific schedule.
 
template<ecs::SystemTrait T, ScheduleTrait S>
void AppendSystemSetMetadata (S schedule, std::span< const SystemSetId > sets)
 Appends system set membership to a system's metadata in a specific schedule.
 
template<SystemSetTrait Set>
SystemSetInfoGetOrRegisterSystemSet ()
 Gets or registers a system set in the global registry.
 
void AddSystemToSet (SystemSetId set_id, ecs::SystemTypeId system_id)
 Adds a system to a system set's membership list.
 
void AddSetRunsBefore (SystemSetId before_id, SystemSetId after_id)
 Adds a set-level ordering constraint: set A runs before set B.
 
void AddSetRunsAfter (SystemSetId after_id, SystemSetId before_id)
 Adds a set-level ordering constraint: set A runs after set B.
 
template<ecs::SystemTrait T>
bool ContainsSystem () const noexcept
 Checks if a system of type T is in any schedule.
 
template<ecs::SystemTrait T, ScheduleTrait S>
bool ContainsSystem (S schedule={}) const noexcept
 Checks if a system of type T is in the specified schedule.
 
size_t SystemCount () const noexcept
 Gets the total number of systems across all schedules.
 
template<ScheduleTrait S>
size_t SystemCount (S schedule={}) const noexcept
 Gets the number of systems in the specified schedule.
 
auto GetSystemStorage () const noexcept -> const std::vector< SystemStorage > &
 Gets const reference to system storage.
 
auto GetScheduleOrder () const noexcept -> const std::vector< ScheduleId > &
 Gets the schedule execution order (topologically sorted).
 
template<StageTrait S>
auto GetSchedulesInStage () const noexcept -> std::vector< ScheduleId >
 Gets schedules that belong to a specific stage.
 

Detailed Description

Main scheduler that manages all schedules.

Holds multiple ScheduleExecutors for different execution stages.

Note
Not thread-safe.

Definition at line 263 of file scheduler.hpp.

Constructor & Destructor Documentation

◆ Scheduler() [1/3]

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

◆ Scheduler() [2/3]

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

◆ Scheduler() [3/3]

helios::app::details::Scheduler::Scheduler ( Scheduler &&  )
defaultnoexcept

◆ ~Scheduler()

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

Member Function Documentation

◆ AddSetRunsAfter()

void helios::app::details::Scheduler::AddSetRunsAfter ( SystemSetId  after_id,
SystemSetId  before_id 
)
inline

Adds a set-level ordering constraint: set A runs after set B.

Convenience wrapper around AddSetRunsBefore(B, A).

Parameters
after_idIdentifier of the set that must run after
before_idIdentifier of the set that must run before

Definition at line 413 of file scheduler.hpp.

413{ AddSetRunsBefore(before_id, after_id); }
void AddSetRunsBefore(SystemSetId before_id, SystemSetId after_id)
Adds a set-level ordering constraint: set A runs before set B.

◆ AddSetRunsBefore()

void helios::app::details::Scheduler::AddSetRunsBefore ( SystemSetId  before_id,
SystemSetId  after_id 
)
inline

Adds a set-level ordering constraint: set A runs before set B.

All systems that are members of set A must run before systems that are members of set B. This relationship is schedule-agnostic at registration time; it is applied when building graphs for each schedule based on actual system membership in that schedule.

Parameters
before_idIdentifier of the set that must run before
after_idIdentifier of the set that must run after

Definition at line 638 of file scheduler.hpp.

638 {
639 if (before_id == after_id) [[unlikely]] {
640 return;
641 }
642
643 auto before_it = system_sets_.find(before_id);
644 if (before_it == system_sets_.end()) {
645 // Set may not have been explicitly registered yet; create a minimal entry.
646 SystemSetInfo info{};
647 info.id = before_id;
648 before_it = system_sets_.emplace(before_id, std::move(info)).first;
649 }
650
651 auto after_it = system_sets_.find(after_id);
652 if (after_it == system_sets_.end()) {
653 SystemSetInfo info{};
654 info.id = after_id;
655 after_it = system_sets_.emplace(after_id, std::move(info)).first;
656 }
657
658 auto& before_info = before_it->second;
659 auto& after_info = after_it->second;
660
661 // Encode relationship:
662 // - before_info.before_sets contains after_id (before runs before after)
663 // - after_info.after_sets contains before_id
664 if (std::ranges::find(before_info.before_sets, after_id) == before_info.before_sets.end()) {
665 before_info.before_sets.push_back(after_id);
666 }
667 if (std::ranges::find(after_info.after_sets, before_id) == after_info.after_sets.end()) {
668 after_info.after_sets.push_back(before_id);
669 }
670}

◆ AddSystem()

template<ecs::SystemTrait T, ScheduleTrait S>
void helios::app::details::Scheduler::AddSystem ( schedule = {})
inline

Adds a system to the specified schedule.

Warning
Triggers assertion if system T is already added to the schedule.
Template Parameters
TSystem type
SSchedule type
Parameters
scheduleSchedule to add system to
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 565 of file scheduler.hpp.

565 {
566 HELIOS_ASSERT((!ContainsSystem<T>(S{})), "Failed to add system '{}': System already exists in schedule '{}'!",
567 ecs::SystemNameOf<T>(), ScheduleNameOf<S>());
568
569 RegisterSchedule<S>();
570 constexpr ScheduleId schedule_id = ScheduleIdOf<S>();
571 constexpr ecs::SystemTypeId system_id = ecs::SystemTypeIdOf<T>();
572
573 // Create system storage
574 SystemStorage storage{};
575 storage.system = std::make_unique<T>();
576 storage.info.name = std::string(ecs::SystemNameOf<T>());
577 storage.info.type_id = system_id;
578 storage.info.access_policy = T::GetAccessPolicy();
579 storage.info.execution_count = 0;
580
581 const size_t index = system_storage_.size();
582 system_storage_.push_back(std::move(storage));
583
584 schedules_.at(schedule_id).AddSystem(index);
585}
#define HELIOS_ASSERT(condition,...)
Assertion macro that aborts execution in debug builds.
Definition assert.hpp:140
size_t ScheduleId
Type alias for schedule type IDs.
Definition schedule.hpp:20
size_t SystemTypeId
Type ID for systems.
Definition system.hpp:93
BasicQuery< World, Allocator, Components... > Query
Type alias for query with mutable world access.
Definition query.hpp:2481

◆ AddSystemToSet()

void helios::app::details::Scheduler::AddSystemToSet ( SystemSetId  set_id,
ecs::SystemTypeId  system_id 
)
inline

Adds a system to a system set's membership list.

If the set is not present in the registry this call is a no-op.

Parameters
set_idIdentifier of the system set
system_idIdentifier of the system to add

Definition at line 688 of file scheduler.hpp.

688 {
689 const auto it = system_sets_.find(set_id);
690 if (it == system_sets_.end()) {
691 return;
692 }
693
694 auto& members = it->second.member_systems;
695 if (std::ranges::find(members, system_id) == members.end()) {
696 members.push_back(system_id);
697 }
698}

◆ AppendSystemOrderingMetadata()

template<ecs::SystemTrait T, ScheduleTrait S>
void helios::app::details::Scheduler::AppendSystemOrderingMetadata ( schedule,
std::span< const ecs::SystemTypeId before,
std::span< const ecs::SystemTypeId after 
)
inline

Appends system ordering constraints to a system's metadata in a specific schedule.

This updates SystemInfo.before_systems and SystemInfo.after_systems for the given system type within the specified schedule. If the system has not been added to the schedule yet, this call is a no-op.

Template Parameters
TSystem type
SSchedule type
Parameters
scheduleSchedule where the system is registered
beforeSystems that must run after T in this schedule
afterSystems that must run before T in this schedule

Definition at line 701 of file scheduler.hpp.

702 {
703 constexpr ScheduleId schedule_id = ScheduleIdOf<S>();
704 constexpr ecs::SystemTypeId system_id = ecs::SystemTypeIdOf<T>();
705
706 // Find the schedule
707 const auto schedule_it = schedules_.find(schedule_id);
708 if (schedule_it == schedules_.end()) {
709 return;
710 }
711
712 // Find the system index within this specific schedule
713 const auto index_opt = schedule_it->second.FindSystemIndexByType(system_id, system_storage_);
714 if (!index_opt.has_value()) {
715 return;
716 }
717
718 auto& info = system_storage_[index_opt.value()].info;
719 if (!before.empty()) {
720#ifdef HELIOS_CONTAINERS_RANGES_AVALIABLE
721 info.before_systems.append_range(before);
722#else
723 info.before_systems.insert(info.before_systems.end(), before.begin(), before.end());
724#endif
725 }
726 if (!after.empty()) {
727#ifdef HELIOS_CONTAINERS_RANGES_AVALIABLE
728 info.after_systems.append_range(after);
729#else
730 info.after_systems.insert(info.after_systems.end(), after.begin(), after.end());
731#endif
732 }
733}

◆ AppendSystemSetMetadata()

template<ecs::SystemTrait T, ScheduleTrait S>
void helios::app::details::Scheduler::AppendSystemSetMetadata ( schedule,
std::span< const SystemSetId sets 
)
inline

Appends system set membership to a system's metadata in a specific schedule.

This updates SystemInfo.system_sets for the given system type within the specified schedule. If the system has not been added to the schedule yet, this call is a no-op.

Template Parameters
TSystem type
SSchedule type
Parameters
scheduleSchedule where the system is registered
setsSystem set identifiers to append

Definition at line 736 of file scheduler.hpp.

736 {
737 if (sets.empty()) [[unlikely]] {
738 return;
739 }
740
741 constexpr ScheduleId schedule_id = ScheduleIdOf<S>();
742 constexpr ecs::SystemTypeId system_id = ecs::SystemTypeIdOf<T>();
743
744 // Find the schedule
745 const auto schedule_it = schedules_.find(schedule_id);
746 if (schedule_it == schedules_.end()) {
747 return;
748 }
749
750 // Find the system index within this specific schedule
751 const auto index_opt = schedule_it->second.FindSystemIndexByType(system_id, system_storage_);
752 if (!index_opt.has_value()) {
753 return;
754 }
755
756 auto& info = system_storage_[index_opt.value()].info;
757#ifdef HELIOS_CONTAINERS_RANGES_AVALIABLE
758 info.system_sets.append_range(sets);
759#else
760 info.system_sets.insert(info.system_sets.end(), sets.begin(), sets.end());
761#endif
762}

◆ BuildAllGraphs()

void helios::app::details::Scheduler::BuildAllGraphs ( ecs::World world)

Builds execution graphs for all schedules.

Should be called after all systems are added and before execution. This method also propagates system set ordering constraints into explicit system-to-system ordering edges for each schedule.

Parameters
worldWorld to execute systems on
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 60 of file scheduler.cpp.

60 {
61 schedule_order_.clear();
62
63 const auto all_schedules = CollectAllScheduleIds();
64 if (all_schedules.empty()) {
65 return;
66 }
67
68 auto [adjacency, in_degree] = BuildScheduleDependencyGraph(all_schedules);
69 schedule_order_ = TopologicalSort(all_schedules, adjacency, in_degree);
70
71 // Build execution graphs for all schedules
72 for (auto& [_, schedule] : schedules_) {
73 schedule.BuildExecutionGraph(world, system_storage_, system_sets_);
74 }
75}

◆ Clear()

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

Clears all schedules and systems.

Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 508 of file scheduler.hpp.

508 {
509 system_storage_.clear();
510 for (auto& [id, schedule] : schedules_) {
511 schedule.Clear();
512 }
513 schedules_.clear();
514 schedule_constraints_.clear();
515 schedule_order_.clear();
516 system_sets_.clear();
517}

◆ ContainsSystem() [1/2]

template<ecs::SystemTrait T>
bool helios::app::details::Scheduler::ContainsSystem ( ) const
inlinenoexcept

Checks if a system of type T is in any schedule.

Template Parameters
TSystem type
Returns
True if system is present, false otherwise
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 774 of file scheduler.hpp.

774 {
775 constexpr ecs::SystemTypeId system_id = ecs::SystemTypeIdOf<T>();
776 // Check if any schedule contains a system of this type
777 return std::ranges::any_of(schedules_, [this, system_id](const auto& pair) {
778 return pair.second.ContainsSystemOfType(system_id, system_storage_);
779 });
780}

◆ ContainsSystem() [2/2]

template<ecs::SystemTrait T, ScheduleTrait S>
bool helios::app::details::Scheduler::ContainsSystem ( schedule = {}) const
inlinenoexcept

Checks if a system of type T is in the specified schedule.

Template Parameters
TSystem type
SSchedule type
Parameters
scheduleSchedule to check
Returns
True if system is present, false otherwise

Definition at line 783 of file scheduler.hpp.

783 {
784 constexpr ScheduleId schedule_id = ScheduleIdOf<S>();
785 const auto it = schedules_.find(schedule_id);
786 if (it == schedules_.end()) {
787 return false;
788 }
789
790 constexpr ecs::SystemTypeId system_id = ecs::SystemTypeIdOf<T>();
791 return it->second.ContainsSystemOfType(system_id, system_storage_);
792}

◆ ExecuteSchedule()

template<ScheduleTrait S>
void helios::app::details::Scheduler::ExecuteSchedule ( ecs::World world,
async::Executor executor 
)
inline

Executes all systems in the specified schedule.

Template Parameters
SSchedule type
Parameters
worldWorld to execute systems on
executorAsync executor for parallel execution
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 588 of file scheduler.hpp.

588 {
589 constexpr ScheduleId schedule_id = ScheduleIdOf<S>();
590 ExecuteScheduleById(schedule_id, world, executor);
591}
void ExecuteScheduleById(ScheduleId schedule_id, ecs::World &world, async::Executor &executor)
Executes all systems in the specified schedule by ID.

◆ ExecuteScheduleById()

void helios::app::details::Scheduler::ExecuteScheduleById ( ScheduleId  schedule_id,
ecs::World world,
async::Executor executor 
)
inline

Executes all systems in the specified schedule by ID.

Parameters
schedule_idSchedule ID to execute
worldWorld to execute systems on
executorAsync executor for parallel execution

Definition at line 593 of file scheduler.hpp.

593 {
594 const auto it = schedules_.find(schedule_id);
595 if (it == schedules_.end()) [[unlikely]] {
596 return; // Schedule not registered or has no systems
597 }
598
599 it->second.Execute(world, executor, system_storage_);
600
601 // After each schedule, merge all commands into world's main queue
603}
void MergeCommandsToWorld(ecs::World &world)
Merges all system local commands into the world's main command queue.

◆ ExecuteStage()

template<StageTrait S>
void helios::app::details::Scheduler::ExecuteStage ( ecs::World world,
async::Executor executor 
)
inline

Executes all schedules in the specified stage.

Executes schedules in topologically sorted order based on Before/After relationships.

Template Parameters
SStage type (must satisfy StageTrait)
Parameters
worldWorld to execute systems on
executorAsync executor for parallel execution
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 621 of file scheduler.hpp.

621 {
622 constexpr ScheduleId stage_id = ScheduleIdOf<S>();
623
624 // Execute all schedules that belong to this stage in topological order
625 for (const ScheduleId schedule_id : schedule_order_) {
626 const auto constraint_it = schedule_constraints_.find(schedule_id);
627 if (constraint_it == schedule_constraints_.end()) {
628 continue;
629 }
630
631 // Check if this schedule belongs to this stage
632 if (constraint_it->second.stage_id == stage_id) {
633 ExecuteScheduleById(schedule_id, world, executor);
634 }
635 }
636}

◆ GetOrRegisterSystemSet()

template<SystemSetTrait Set>
SystemSetInfo & helios::app::details::Scheduler::GetOrRegisterSystemSet ( )
inline

Gets or registers a system set in the global registry.

If the set is not present, it will be created and initialized with its static name and ID.

Template Parameters
SetSystem set type
Returns
Reference to the SystemSetInfo for this set

Definition at line 673 of file scheduler.hpp.

673 {
674 constexpr SystemSetId id = SystemSetIdOf<Set>();
675 const auto it = system_sets_.find(id);
676 if (it != system_sets_.end()) {
677 return it->second;
678 }
679
680 SystemSetInfo info{};
681 info.id = id;
682 info.name = std::string(SystemSetNameOf<Set>());
683
684 const auto [insert_it, _] = system_sets_.emplace(id, std::move(info));
685 return insert_it->second;
686}
size_t SystemSetId
Type alias for system set type IDs.

◆ GetScheduleOrder()

auto helios::app::details::Scheduler::GetScheduleOrder ( ) const -> const std::vector<ScheduleId>&
inlinenoexcept

Gets the schedule execution order (topologically sorted).

Returns
Const reference to vector of Schedule IDs in execution order

Definition at line 458 of file scheduler.hpp.

458{ return schedule_order_; }

◆ GetSchedulesInStage()

template<StageTrait S>
auto helios::app::details::Scheduler::GetSchedulesInStage ( ) const -> std::vector<ScheduleId>
inlinenoexcept

Gets schedules that belong to a specific stage.

Template Parameters
SStage type
Returns
Vector of schedule IDs that execute within the stage

Definition at line 805 of file scheduler.hpp.

805 {
806 constexpr ScheduleId stage_id = ScheduleIdOf<S>();
807 std::vector<ScheduleId> result;
808
809 // Iterate through all schedules in topological order and collect those belonging to this stage
810 for (const ScheduleId schedule_id : schedule_order_) {
811 const auto constraint_it = schedule_constraints_.find(schedule_id);
812 if (constraint_it == schedule_constraints_.end()) {
813 continue;
814 }
815
816 // Check if this schedule belongs to this stage
817 if (constraint_it->second.stage_id == stage_id) {
818 result.push_back(schedule_id);
819 }
820 }
821
822 return result;
823}

◆ GetSystemStorage()

auto helios::app::details::Scheduler::GetSystemStorage ( ) const -> const std::vector<SystemStorage>&
inlinenoexcept

Gets const reference to system storage.

Returns
Const reference to vector of SystemStorage

Definition at line 452 of file scheduler.hpp.

452{ return system_storage_; }

◆ MergeCommandsToWorld()

void helios::app::details::Scheduler::MergeCommandsToWorld ( ecs::World world)
inline

Merges all system local commands into the world's main command queue.

Should be called after Extract schedule to flush all pending commands.

Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 605 of file scheduler.hpp.

605 {
606 for (auto& storage : system_storage_) {
607 auto& commands = storage.local_storage.GetCommands();
608 if (!commands.empty()) {
609 world.MergeCommands(std::move(commands));
610 }
611 }
612}

◆ operator=() [1/2]

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

◆ operator=() [2/2]

Scheduler & helios::app::details::Scheduler::operator= ( Scheduler &&  )
defaultnoexcept

◆ RegisterOrdering()

template<ecs::SystemTrait T, ScheduleTrait S>
void helios::app::details::Scheduler::RegisterOrdering ( schedule,
SystemOrdering  ordering 
)
inline

Registers ordering constraint for a system.

Template Parameters
TSystem type
SSchedule type
Parameters
scheduleSchedule to register ordering for
orderingOrdering constraints

Definition at line 556 of file scheduler.hpp.

556 {
557 RegisterSchedule<S>();
558 constexpr ScheduleId schedule_id = ScheduleIdOf<S>();
559 constexpr ecs::SystemTypeId system_id = ecs::SystemTypeIdOf<T>();
560
561 schedules_.at(schedule_id).RegisterOrdering(system_id, std::move(ordering));
562}

◆ RegisterSchedule()

template<ScheduleTrait S>
void helios::app::details::Scheduler::RegisterSchedule ( )
inline

Registers a schedule type.

Template Parameters
TSchedule type

Definition at line 520 of file scheduler.hpp.

520 {
521 constexpr ScheduleId schedule_id = ScheduleIdOf<S>();
522 if (schedules_.contains(schedule_id)) [[unlikely]] {
523 return; // Already registered
524 }
525
526 schedules_.emplace(schedule_id, ScheduleExecutor(schedule_id));
527
528 // Store schedule ordering constraints
529 ScheduleOrdering ordering;
530
531 // Extract Before constraints from schedule type
532 if constexpr (ScheduleWithBeforeTrait<S>) {
533 constexpr auto before = ScheduleBeforeOf<S>();
534 ordering.before.reserve(before.size());
535 for (const ScheduleId id : before) {
536 ordering.before.push_back(id);
537 }
538 }
539
540 // Extract After constraints from schedule type
541 if constexpr (ScheduleWithAfterTrait<S>) {
542 constexpr auto after = ScheduleAfterOf<S>();
543 ordering.after.reserve(after.size());
544 for (const ScheduleId id : after) {
545 ordering.after.push_back(id);
546 }
547 }
548
549 // Store stage membership
550 ordering.stage_id = ScheduleStageOf<S>();
551
552 schedule_constraints_[schedule_id] = std::move(ordering);
553}

◆ ResetFrameAllocators()

void helios::app::details::Scheduler::ResetFrameAllocators ( )
inlinenoexcept

Resets all system frame allocators.

Call this at frame boundaries to reclaim all temporary per-system allocations. Should typically be called at the end of App::Update() after all schedules have executed.

Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 614 of file scheduler.hpp.

614 {
615 for (auto& storage : system_storage_) {
616 storage.local_storage.ResetFrameAllocator();
617 }
618}

◆ SystemCount() [1/2]

size_t helios::app::details::Scheduler::SystemCount ( ) const
inlinenoexcept

Gets the total number of systems across all schedules.

Returns
Total number of systems
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/sub_app.hpp.

Definition at line 437 of file scheduler.hpp.

437{ return system_storage_.size(); }

◆ SystemCount() [2/2]

template<ScheduleTrait S>
size_t helios::app::details::Scheduler::SystemCount ( schedule = {}) const
inlinenoexcept

Gets the number of systems in the specified schedule.

Template Parameters
SSchedule type
Parameters
scheduleSchedule to query
Returns
Number of systems in the schedule

Definition at line 795 of file scheduler.hpp.

795 {
796 constexpr ScheduleId schedule_id = ScheduleIdOf<S>();
797 const auto it = schedules_.find(schedule_id);
798 if (it == schedules_.end()) [[unlikely]] {
799 return 0;
800 }
801 return it->second.SystemCount();
802}