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

A group of systems that share ordering, run conditions, and other properties. More...

#include <system_set.hpp>

Public Member Functions

constexpr SystemSet (SystemSetId id)
 Constructs a SystemSet with the given ID.
 SystemSet (const SystemSet &)=delete
constexpr SystemSet (SystemSet &&)=default
constexpr ~SystemSet ()=default
SystemSetoperator= (const SystemSet &)=delete
constexpr SystemSetoperator= (SystemSet &&)=default
constexpr auto Before (this auto &&self, SystemId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members must run before the given system.
constexpr auto Before (this auto &&self, SystemSetId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members must run before all members of the given set.
constexpr auto After (this auto &&self, SystemId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members must run after the given system.
constexpr auto After (this auto &&self, SystemSetId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members must run after all members of the given set.
constexpr auto RunIf (this auto &&self, RunConditionStorage condition, AccessPolicy policy={}, SystemLocalDataOptions options={}) -> decltype(std::forward< decltype(self)>(self))
 Adds a run condition to the set.
template<FunctorSystemTrait T>
constexpr auto RunIf (this auto &&self, T &&condition) -> decltype(std::forward< decltype(self)>(self))
 Adds a run condition functor to the set.
template<SystemTrait T>
constexpr auto RunIf (this auto &&self, std::string name, T &&condition) -> decltype(std::forward< decltype(self)>(self))
 Adds a run condition to the set with an explicit name.
constexpr auto Sequence (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Marks this set as a sequence: systems run in insertion order.
constexpr bool IsSequence () const noexcept
 Checks if this set is a sequence set.
constexpr SystemSetId Id () const noexcept
 Gets the system set id.
constexpr auto TakeConditions () -> std::vector< RunConditionStorage >
 Takes ownership of all run conditions from this set.
constexpr auto BeforeTargets () const noexcept -> const std::vector< SystemId > &
 Gets the system ordering targets for "before" constraints.
constexpr auto AfterTargets () const noexcept -> const std::vector< SystemId > &
 Gets the system ordering targets for "after" constraints.
constexpr auto BeforeSetTargets () const noexcept -> const std::vector< SystemSetId > &
 Gets the set ordering targets for "before" constraints.
constexpr auto AfterSetTargets () const noexcept -> const std::vector< SystemSetId > &
 Gets the set ordering targets for "after" constraints.
constexpr auto Conditions () const noexcept -> const std::vector< RunConditionStorage > &
 Gets the run conditions owned by this set.

Detailed Description

A group of systems that share ordering, run conditions, and other properties.

When a property is applied to a set (e.g., Before, After, RunIf), it is inherited by all systems that belong to the set.

Definition at line 148 of file system_set.hpp.

Constructor & Destructor Documentation

◆ SystemSet() [1/3]

helios::ecs::SystemSet::SystemSet ( SystemSetId id)
inlineexplicitconstexpr

Constructs a SystemSet with the given ID.

Parameters
idThe ID of the system set

Definition at line 154 of file system_set.hpp.

◆ SystemSet() [2/3]

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

◆ SystemSet() [3/3]

helios::ecs::SystemSet::SystemSet ( SystemSet && )
constexprdefault

◆ ~SystemSet()

helios::ecs::SystemSet::~SystemSet ( )
constexprdefault

Member Function Documentation

◆ After() [1/2]

auto helios::ecs::SystemSet::After ( this auto && self,
SystemId target ) -> decltype(std::forward< decltype(self)>(self))
constexpr

Adds an ordering constraint: all members must run after the given system.

Parameters
targetSystem that members must follow
Returns
Reference to this set for chaining

Definition at line 342 of file system_set.hpp.

◆ After() [2/2]

auto helios::ecs::SystemSet::After ( this auto && self,
SystemSetId target ) -> decltype(std::forward< decltype(self)>(self))
constexpr

Adds an ordering constraint: all members must run after all members of the given set.

Parameters
targetSet that members must follow
Returns
Reference to this set for chaining

Definition at line 351 of file system_set.hpp.

◆ AfterSetTargets()

auto helios::ecs::SystemSet::AfterSetTargets ( ) const -> const std::vector< SystemSetId > &
inlinenodiscardconstexprnoexcept

Gets the set ordering targets for "after" constraints.

Returns
Vector of system set ids that are targets of "after" constraints from this set

Definition at line 300 of file system_set.hpp.

◆ AfterTargets()

auto helios::ecs::SystemSet::AfterTargets ( ) const -> const std::vector< SystemId > &
inlinenodiscardconstexprnoexcept

Gets the system ordering targets for "after" constraints.

Returns
Vector of system ids that are targets of "after" constraints from this set

Definition at line 280 of file system_set.hpp.

◆ Before() [1/2]

auto helios::ecs::SystemSet::Before ( this auto && self,
SystemId target ) -> decltype(std::forward< decltype(self)>(self))
constexpr

Adds an ordering constraint: all members must run before the given system.

Parameters
targetSystem that members must precede
Returns
Reference to this set for chaining

Definition at line 324 of file system_set.hpp.

◆ Before() [2/2]

auto helios::ecs::SystemSet::Before ( this auto && self,
SystemSetId target ) -> decltype(std::forward< decltype(self)>(self))
constexpr

Adds an ordering constraint: all members must run before all members of the given set.

Parameters
targetSet that members must precede
Returns
Reference to this set for chaining

Definition at line 333 of file system_set.hpp.

◆ BeforeSetTargets()

auto helios::ecs::SystemSet::BeforeSetTargets ( ) const -> const std::vector< SystemSetId > &
inlinenodiscardconstexprnoexcept

Gets the set ordering targets for "before" constraints.

Returns
Vector of system set ids that are targets of "before" constraints from this set

Definition at line 290 of file system_set.hpp.

◆ BeforeTargets()

auto helios::ecs::SystemSet::BeforeTargets ( ) const -> const std::vector< SystemId > &
inlinenodiscardconstexprnoexcept

Gets the system ordering targets for "before" constraints.

Returns
Vector of system ids that are targets of "before" constraints from this set

Definition at line 270 of file system_set.hpp.

◆ Conditions()

auto helios::ecs::SystemSet::Conditions ( ) const -> const std::vector< RunConditionStorage > &
inlinenodiscardconstexprnoexcept

Gets the run conditions owned by this set.

Returns
Vector of run conditions owned by this set

Definition at line 309 of file system_set.hpp.

◆ Id()

SystemSetId helios::ecs::SystemSet::Id ( ) const
inlinenodiscardconstexprnoexcept

Gets the system set id.

Returns
System set id

Definition at line 254 of file system_set.hpp.

◆ IsSequence()

bool helios::ecs::SystemSet::IsSequence ( ) const
inlinenodiscardconstexprnoexcept

Checks if this set is a sequence set.

Returns
True if this set is a sequence set, false otherwise

Definition at line 246 of file system_set.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

SystemSet & helios::ecs::SystemSet::operator= ( SystemSet && )
constexprdefault

◆ RunIf() [1/3]

auto helios::ecs::SystemSet::RunIf ( this auto && self,
RunConditionStorage condition,
AccessPolicy policy = {},
SystemLocalDataOptions options = {} ) -> decltype(std::forward< decltype(self)>(self))
constexpr

Adds a run condition to the set.

All systems in this set will only run if all conditions return true.

Parameters
conditionRun condition predicate with access policy
policyAccess policy for the run condition
optionsOptions for run condition local data construction
Returns
Reference to this set for chaining

Definition at line 360 of file system_set.hpp.

◆ RunIf() [2/3]

template<SystemTrait T>
auto helios::ecs::SystemSet::RunIf ( this auto && self,
std::string name,
T && condition ) -> decltype(std::forward< decltype(self)>(self))
constexpr

Adds a run condition to the set with an explicit name.

Required for lambdas.

Template Parameters
TRun condition type satisfying SystemTrait
Parameters
nameHuman-readable name
conditionFunctor with declared access policy
Returns
Reference to this set for chaining

Definition at line 377 of file system_set.hpp.

◆ RunIf() [3/3]

template<FunctorSystemTrait T>
auto helios::ecs::SystemSet::RunIf ( this auto && self,
T && condition ) -> decltype(std::forward< decltype(self)>(self))
constexpr

Adds a run condition functor to the set.

Lambdas are rejected; use RunIf(std::string, T&&).

Template Parameters
TRun condition type satisfying FunctorSystemTrait
Parameters
conditionFunctor with declared access policy
Returns
Reference to this set for chaining

Definition at line 369 of file system_set.hpp.

◆ Sequence()

auto helios::ecs::SystemSet::Sequence ( this auto && self) -> decltype(std::forward< decltype(self)>(self))
constexpr

Marks this set as a sequence: systems run in insertion order.

Returns
Reference to this set for chaining

Definition at line 385 of file system_set.hpp.

◆ TakeConditions()

auto helios::ecs::SystemSet::TakeConditions ( ) -> std::vector< RunConditionStorage >
inlinenodiscardconstexpr

Takes ownership of all run conditions from this set.

Returns
Vector of run conditions that were previously owned by this set

Definition at line 260 of file system_set.hpp.