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

Handle returned by variadic Schedule::Add for configuring a batch of systems added together. More...

#include <system_group_handle.hpp>

Public Member Functions

constexpr SystemGroupHandle (SystemSetId id, Schedule &schedule) noexcept
 Constructs a SystemGroupHandle with the given group id and schedule.
 SystemGroupHandle (const SystemGroupHandle &)=delete
constexpr SystemGroupHandle (SystemGroupHandle &&) noexcept=default
constexpr ~SystemGroupHandle () noexcept=default
SystemGroupHandleoperator= (const SystemGroupHandle &)=delete
constexpr SystemGroupHandleoperator= (SystemGroupHandle &&) noexcept=default
constexpr auto Before (this auto &&self, SystemId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run before the given system.
template<SystemTrait T>
constexpr auto Before (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run before the given system type.
constexpr auto Before (this auto &&self, const SystemHandle &target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run before the given system handle.
constexpr auto Before (this auto &&self, SystemSetId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run before all members of the given set.
template<SystemSetTrait T>
constexpr auto BeforeSet (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run before all members of the given set type.
constexpr auto Before (this auto &&self, const SystemSetHandle &target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run before the given system set handle.
constexpr auto Before (this auto &&self, const SystemGroupHandle &target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run before all members of the given system group.
constexpr auto After (this auto &&self, SystemId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run after the given system.
template<SystemTrait T>
constexpr auto After (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run after the given system type.
constexpr auto After (this auto &&self, const SystemHandle &target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run after the given system handle.
constexpr auto After (this auto &&self, SystemSetId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run after all members of the given set.
template<SystemSetTrait T>
constexpr auto AfterSet (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run after all members of the given set type.
constexpr auto After (this auto &&self, const SystemSetHandle &target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run after the given system set handle.
constexpr auto After (this auto &&self, const SystemGroupHandle &target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: all members of this group must run after all members of the given system group.
constexpr auto RunIf (this auto &&self, RunCondition condition, AccessPolicy policy={}, SystemLocalDataOptions options={}) -> decltype(std::forward< decltype(self)>(self))
 Adds a run condition predicate that applies to all group members.
template<FunctorSystemTrait T>
constexpr auto RunIf (this auto &&self, T &&condition) -> decltype(std::forward< decltype(self)>(self))
 Adds a run condition functor that applies to all group members.
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 all group members with an explicit name.
constexpr auto InSet (this auto &&self, SystemSetId target) -> decltype(std::forward< decltype(self)>(self))
 Assigns every member of this group to the given named set.
template<SystemSetTrait T>
constexpr auto InSet (this auto &&self, const T &={}) -> decltype(std::forward< decltype(self)>(self))
 Assigns every member of this group to the given named set type.
constexpr auto Sequence (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Marks this group as a sequence: members run in insertion order.
constexpr ScheduleDone () noexcept
 Finishes configuration and returns a reference to the parent schedule.
constexpr SystemSetId Id () const noexcept
 Gets the identifier for this anonymous group.

Detailed Description

Handle returned by variadic Schedule::Add for configuring a batch of systems added together.

Each variadic Add call creates a unique anonymous group so configuration such as Sequence() does not leak between batches with the same system types. Use InSet to assign every member of the batch to a named set in one call.

Definition at line 26 of file system_group_handle.hpp.

Constructor & Destructor Documentation

◆ SystemGroupHandle() [1/3]

helios::ecs::SystemGroupHandle::SystemGroupHandle ( SystemSetId id,
Schedule & schedule )
inlineconstexprnoexcept

Constructs a SystemGroupHandle with the given group id and schedule.

Parameters
idThe anonymous group id
scheduleThe schedule that the group belongs to

Definition at line 34 of file system_group_handle.hpp.

◆ SystemGroupHandle() [2/3]

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

◆ SystemGroupHandle() [3/3]

helios::ecs::SystemGroupHandle::SystemGroupHandle ( SystemGroupHandle && )
constexprdefaultnoexcept

◆ ~SystemGroupHandle()

helios::ecs::SystemGroupHandle::~SystemGroupHandle ( )
constexprdefaultnoexcept

Member Function Documentation

◆ After() [1/6]

template<SystemTrait T>
auto helios::ecs::SystemGroupHandle::After ( this auto && self) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

Adds an ordering constraint: all members of this group must run after the given system type.

Template Parameters
TSystem type satisfying SystemTrait
Returns
Reference to this handle for chaining

Definition at line 136 of file system_group_handle.hpp.

◆ After() [2/6]

auto helios::ecs::SystemGroupHandle::After ( this auto && self,
const SystemGroupHandle & target ) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

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

Parameters
targetSystem group handle that this group must follow
Returns
Reference to this handle for chaining

Definition at line 190 of file system_group_handle.hpp.

◆ After() [3/6]

auto helios::ecs::SystemGroupHandle::After ( this auto && self,
const SystemHandle & target ) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

Adds an ordering constraint: all members of this group must run after the given system handle.

Parameters
targetSystem handle that this group must follow
Returns
Reference to this handle for chaining

Definition at line 147 of file system_group_handle.hpp.

◆ After() [4/6]

auto helios::ecs::SystemGroupHandle::After ( this auto && self,
const SystemSetHandle & target ) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

Adds an ordering constraint: all members of this group must run after the given system set handle.

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

Definition at line 179 of file system_group_handle.hpp.

◆ After() [5/6]

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

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

Parameters
targetSystem id that this group must follow
Returns
Reference to this handle for chaining

Definition at line 933 of file schedule.hpp.

◆ After() [6/6]

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

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

Parameters
targetSet id that this group must follow
Returns
Reference to this handle for chaining

Definition at line 944 of file schedule.hpp.

◆ AfterSet()

template<SystemSetTrait T>
auto helios::ecs::SystemGroupHandle::AfterSet ( this auto && self) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

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

Template Parameters
TSet type satisfying SystemSetTrait
Returns
Reference to this handle for chaining

Definition at line 168 of file system_group_handle.hpp.

◆ Before() [1/6]

template<SystemTrait T>
auto helios::ecs::SystemGroupHandle::Before ( this auto && self) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

Adds an ordering constraint: all members of this group must run before the given system type.

Template Parameters
TSystem type satisfying SystemTrait
Returns
Reference to this handle for chaining

Definition at line 61 of file system_group_handle.hpp.

◆ Before() [2/6]

auto helios::ecs::SystemGroupHandle::Before ( this auto && self,
const SystemGroupHandle & target ) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

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

Parameters
targetSystem group handle that this group must precede
Returns
Reference to this handle for chaining

Definition at line 115 of file system_group_handle.hpp.

◆ Before() [3/6]

auto helios::ecs::SystemGroupHandle::Before ( this auto && self,
const SystemHandle & target ) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

Adds an ordering constraint: all members of this group must run before the given system handle.

Parameters
targetSystem handle that this group must precede
Returns
Reference to this handle for chaining

Definition at line 72 of file system_group_handle.hpp.

◆ Before() [4/6]

auto helios::ecs::SystemGroupHandle::Before ( this auto && self,
const SystemSetHandle & target ) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

Adds an ordering constraint: all members of this group must run before the given system set handle.

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

Definition at line 104 of file system_group_handle.hpp.

◆ Before() [5/6]

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

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

Parameters
targetSystem id that this group must precede
Returns
Reference to this handle for chaining

Definition at line 911 of file schedule.hpp.

◆ Before() [6/6]

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

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

Parameters
targetSet id that this group must precede
Returns
Reference to this handle for chaining

Definition at line 922 of file schedule.hpp.

◆ BeforeSet()

template<SystemSetTrait T>
auto helios::ecs::SystemGroupHandle::BeforeSet ( this auto && self) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

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

Template Parameters
TSet type satisfying SystemSetTrait
Returns
Reference to this handle for chaining

Definition at line 93 of file system_group_handle.hpp.

◆ Done()

Schedule & helios::ecs::SystemGroupHandle::Done ( )
inlineconstexprnoexcept

Finishes configuration and returns a reference to the parent schedule.

Returns
Reference to the parent schedule for continued configuration

Definition at line 267 of file system_group_handle.hpp.

◆ Id()

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

Gets the identifier for this anonymous group.

Returns
Anonymous group id

Definition at line 273 of file system_group_handle.hpp.

◆ InSet() [1/2]

template<SystemSetTrait T>
auto helios::ecs::SystemGroupHandle::InSet ( this auto && self,
const T & = {} ) -> decltype(std::forward< decltype(self)>(self))
inlineconstexpr

Assigns every member of this group to the given named set type.

Template Parameters
TSet type satisfying SystemSetTrait
Returns
Reference to this handle for chaining

Definition at line 250 of file system_group_handle.hpp.

◆ InSet() [2/2]

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

Assigns every member of this group to the given named set.

Creates the target set if needed. Members inherit the target set's ordering constraints and run conditions. Repeated calls with the same set id are ignored for each member.

Parameters
targetNamed set to assign group members to
Returns
Reference to this handle for chaining
schedule.Add(SystemA{}, SystemB{}).InSet(MovementSet{}).Sequence();
constexpr auto Sequence(this auto &&self) -> decltype(std::forward< decltype(self)>(self))
Marks this group as a sequence: members run in insertion order.
constexpr auto InSet(this auto &&self, SystemSetId target) -> decltype(std::forward< decltype(self)>(self))
Assigns every member of this group to the given named set.
Definition schedule.hpp:996

Definition at line 996 of file schedule.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

SystemGroupHandle & helios::ecs::SystemGroupHandle::operator= ( SystemGroupHandle && )
constexprdefaultnoexcept

◆ RunIf() [1/3]

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

Adds a run condition predicate that applies to all group members.

Parameters
conditionPredicate evaluated before any member runs
policyAccess policy for the run condition
optionsOptions for run condition local data construction
Returns
Reference to this handle for chaining

Definition at line 955 of file schedule.hpp.

◆ RunIf() [2/3]

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

Adds a run condition to all group members 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 handle for chaining

Definition at line 983 of file schedule.hpp.

◆ RunIf() [3/3]

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

Adds a run condition functor that applies to all group members.

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 handle for chaining

Definition at line 971 of file schedule.hpp.

◆ Sequence()

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

Marks this group as a sequence: members run in insertion order.

Returns
Reference to this handle for chaining

Definition at line 1003 of file schedule.hpp.