Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
helios::app::SystemSetConfig< Schedule, Set > Class Template Reference

#include <system_set_config.hpp>

Public Member Functions

 SystemSetConfig (SubApp &sub_app, Schedule schedule={}) noexcept
 Constructs a system set configuration builder.
 
 SystemSetConfig (const SystemSetConfig &)=delete
 
 SystemSetConfig (SystemSetConfig &&) noexcept=default
 
 ~SystemSetConfig ()
 
SystemSetConfigoperator= (const SystemSetConfig &)=delete
 
SystemSetConfigoperator= (SystemSetConfig &&) noexcept=default
 
template<SystemSetTrait... AfterSets>
requires (sizeof...(AfterSets) > 0 && utils::UniqueTypes<AfterSets...>)
SystemSetConfigAfter ()
 Adds ordering constraint: this set runs after specified sets.
 
template<SystemSetTrait... BeforeSets>
requires (sizeof...(BeforeSets) > 0 && utils::UniqueTypes<BeforeSets...>)
SystemSetConfigBefore ()
 Adds ordering constraint: this set runs before specified sets.
 
void Apply ()
 Explicitly applies the configuration.
 
template<SystemSetTrait... AfterSets>
requires (sizeof...(AfterSets) > 0 && utils::UniqueTypes<AfterSets...>)
auto After () -> SystemSetConfig &
 
template<SystemSetTrait... BeforeSets>
requires (sizeof...(BeforeSets) > 0 && utils::UniqueTypes<BeforeSets...>)
auto Before () -> SystemSetConfig &
 

Detailed Description

template<ScheduleTrait Schedule, SystemSetTrait Set>
class helios::app::SystemSetConfig< Schedule, Set >

Definition at line 30 of file system_set_config.hpp.

Constructor & Destructor Documentation

◆ SystemSetConfig() [1/3]

template<ScheduleTrait Schedule, SystemSetTrait Set>
helios::app::SystemSetConfig< Schedule, Set >::SystemSetConfig ( SubApp sub_app,
Schedule  schedule = {} 
)
inlineexplicitnoexcept

Constructs a system set configuration builder.

Parameters
sub_appReference to the sub-app where the set is configured
scheduleSchedule instance where the set is configured

Definition at line 37 of file system_set_config.hpp.

37{}) noexcept : sub_app_(sub_app), schedule_(schedule) {}

◆ SystemSetConfig() [2/3]

template<ScheduleTrait Schedule, SystemSetTrait Set>
helios::app::SystemSetConfig< Schedule, Set >::SystemSetConfig ( const SystemSetConfig< Schedule, Set > &  )
delete

◆ SystemSetConfig() [3/3]

template<ScheduleTrait Schedule, SystemSetTrait Set>
helios::app::SystemSetConfig< Schedule, Set >::SystemSetConfig ( SystemSetConfig< Schedule, Set > &&  )
defaultnoexcept

◆ ~SystemSetConfig()

template<ScheduleTrait Schedule, SystemSetTrait Set>
helios::app::SystemSetConfig< Schedule, Set >::~SystemSetConfig ( )
inline
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/system_set_config.hpp.

Definition at line 84 of file system_set_config.hpp.

84 {
85 if (!applied_) {
86 Apply();
87 }
88}
void Apply()
Explicitly applies the configuration.

Member Function Documentation

◆ After() [1/2]

template<ScheduleTrait Schedule, SystemSetTrait Set>
template<SystemSetTrait... AfterSets>
requires (sizeof...(AfterSets) > 0 && utils::UniqueTypes<AfterSets...>)
SystemSetConfig & helios::app::SystemSetConfig< Schedule, Set >::After ( )

Adds ordering constraint: this set runs after specified sets.

Creates a dependency edge from each specified set to this set. All systems in the specified sets will run before systems in this set.

Template Parameters
AfterSetsSystem set types that must run before this set
Returns
Reference to this config for method chaining
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/system_set_config.hpp.

◆ After() [2/2]

template<ScheduleTrait Schedule, SystemSetTrait Set>
template<SystemSetTrait... AfterSets>
requires (sizeof...(AfterSets) > 0 && utils::UniqueTypes<AfterSets...>)
auto helios::app::SystemSetConfig< Schedule, Set >::After ( ) -> SystemSetConfig&
inline

Definition at line 93 of file system_set_config.hpp.

93 {
94 (after_sets_.push_back(SystemSetIdOf<AfterSets>()), ...);
95 return *this;
96}

◆ Apply()

template<ScheduleTrait Schedule, SystemSetTrait Set>
void helios::app::SystemSetConfig< Schedule, Set >::Apply ( )
inline

Explicitly applies the configuration.

Called automatically by destructor if not already applied. Can be called explicitly to control when configuration is finalized.

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

Definition at line 107 of file system_set_config.hpp.

107 {
108 if (applied_) {
109 return;
110 }
111
112 applied_ = true;
113
114 auto& sub_app = sub_app_.get();
115 auto& scheduler = sub_app.GetScheduler();
116
117 // Ensure this set exists in the registry
118 const auto& this_info = scheduler.template GetOrRegisterSystemSet<Set>();
119 const SystemSetId this_id = this_info.id;
120
121 // Register "After" relationships:
122 // ConfigureSet<Set>().After<A, B>()
123 // means all systems in A and B must run before systems in Set.
124 for (const SystemSetId after_id : after_sets_) {
125 scheduler.AddSetRunsBefore(after_id, this_id);
126 }
127
128 // Register "Before" relationships:
129 // ConfigureSet<Set>().Before<A, B>()
130 // means all systems in Set must run before systems in A and B.
131 for (const SystemSetId before_id : before_sets_) {
132 scheduler.AddSetRunsBefore(this_id, before_id);
133 }
134}
size_t SystemSetId
Type alias for system set type IDs.

◆ Before() [1/2]

template<ScheduleTrait Schedule, SystemSetTrait Set>
template<SystemSetTrait... BeforeSets>
requires (sizeof...(BeforeSets) > 0 && utils::UniqueTypes<BeforeSets...>)
SystemSetConfig & helios::app::SystemSetConfig< Schedule, Set >::Before ( )

Adds ordering constraint: this set runs before specified sets.

Creates a dependency edge from this set to each specified set. All systems in this set will run before systems in the specified sets.

Template Parameters
BeforeSetsSystem set types that must run after this set
Returns
Reference to this config for method chaining
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/system_set_config.hpp.

◆ Before() [2/2]

template<ScheduleTrait Schedule, SystemSetTrait Set>
template<SystemSetTrait... BeforeSets>
requires (sizeof...(BeforeSets) > 0 && utils::UniqueTypes<BeforeSets...>)
auto helios::app::SystemSetConfig< Schedule, Set >::Before ( ) -> SystemSetConfig&
inline

Definition at line 101 of file system_set_config.hpp.

101 {
102 (before_sets_.push_back(SystemSetIdOf<BeforeSets>()), ...);
103 return *this;
104}

◆ operator=() [1/2]

template<ScheduleTrait Schedule, SystemSetTrait Set>
SystemSetConfig & helios::app::SystemSetConfig< Schedule, Set >::operator= ( const SystemSetConfig< Schedule, Set > &  )
delete

◆ operator=() [2/2]

template<ScheduleTrait Schedule, SystemSetTrait Set>
SystemSetConfig & helios::app::SystemSetConfig< Schedule, Set >::operator= ( SystemSetConfig< Schedule, Set > &&  )
defaultnoexcept