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

Handle returned by Schedule::Add for configuring a system. More...

#include <system_handle.hpp>

Public Member Functions

constexpr SystemHandle (ScheduleSystemId id, Schedule &schedule) noexcept
 Constructs a SystemHandle with the given system id and schedule.
 SystemHandle (const SystemHandle &)=delete
constexpr SystemHandle (SystemHandle &&) noexcept=default
constexpr ~SystemHandle () noexcept=default
SystemHandleoperator= (const SystemHandle &)=delete
constexpr SystemHandleoperator= (SystemHandle &&) noexcept=default
constexpr auto Before (this auto &&self, SystemId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: this system must run before the given system id.
template<SystemTrait T>
constexpr auto Before (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: this system 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: this system must run before the given system handle.
constexpr auto Before (this auto &&self, const SystemSetHandle &target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: this system 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: this system must run before all members of the given system group.
constexpr auto Before (this auto &&self, SystemSetId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: this system 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: this system must run before all members of the given set type.
constexpr auto After (this auto &&self, SystemId target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: this system must run after the given system id.
template<SystemTrait T>
constexpr auto After (this auto &&self) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: this system 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: this system 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: this system 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: this system 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: this system must run after all members of the given system set handle.
constexpr auto After (this auto &&self, const SystemGroupHandle &target) -> decltype(std::forward< decltype(self)>(self))
 Adds an ordering constraint: this system 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 must return true for this system to execute.
template<FunctorSystemTrait T>
constexpr auto RunIf (this auto &&self, T &&condition) -> decltype(std::forward< decltype(self)>(self))
 Adds a run condition functor that must return true for this system to execute.
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 this system with an explicit name.
constexpr auto InSet (this auto &&self, SystemSetId set_id) -> decltype(std::forward< decltype(self)>(self))
 Assigns this system to a labeled set by id.
template<SystemSetTrait T>
constexpr auto InSet (this auto &&self, const T &={}) -> decltype(std::forward< decltype(self)>(self))
 Assigns this system to a labeled set by type.
constexpr ScheduleDone () noexcept
 Finishes configuration and returns a reference to the parent schedule.
constexpr ScheduleSystemId Id () const noexcept
 Gets the unique schedule-local identifier for this system.

Detailed Description

Handle returned by Schedule::Add for configuring a system.

Definition at line 35 of file system_handle.hpp.

Constructor & Destructor Documentation

◆ SystemHandle() [1/3]

helios::ecs::SystemHandle::SystemHandle ( ScheduleSystemId id,
Schedule & schedule )
inlineconstexprnoexcept

Constructs a SystemHandle with the given system id and schedule.

Parameters
idThe system id
scheduleThe schedule that the system belongs to

Definition at line 42 of file system_handle.hpp.

◆ SystemHandle() [2/3]

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

◆ SystemHandle() [3/3]

helios::ecs::SystemHandle::SystemHandle ( SystemHandle && )
constexprdefaultnoexcept

◆ ~SystemHandle()

helios::ecs::SystemHandle::~SystemHandle ( )
constexprdefaultnoexcept

Member Function Documentation

◆ After() [1/6]

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

Adds an ordering constraint: this system must run after the given system type.

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

Definition at line 139 of file system_handle.hpp.

◆ After() [2/6]

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

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

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

Definition at line 750 of file schedule.hpp.

◆ After() [3/6]

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

Adds an ordering constraint: this system must run after the given system handle.

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

Definition at line 150 of file system_handle.hpp.

◆ After() [4/6]

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

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

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

Definition at line 744 of file schedule.hpp.

◆ After() [5/6]

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

Adds an ordering constraint: this system must run after the given system id.

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

Definition at line 722 of file schedule.hpp.

◆ After() [6/6]

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

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

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

Definition at line 733 of file schedule.hpp.

◆ AfterSet()

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

Adds an ordering constraint: this system 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 171 of file system_handle.hpp.

◆ Before() [1/6]

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

Adds an ordering constraint: this system must run before the given system type.

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

Definition at line 68 of file system_handle.hpp.

◆ Before() [2/6]

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

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

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

Definition at line 716 of file schedule.hpp.

◆ Before() [3/6]

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

Adds an ordering constraint: this system must run before the given system handle.

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

Definition at line 79 of file system_handle.hpp.

◆ Before() [4/6]

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

Adds an ordering constraint: this system must run before the given system set handle.

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

Definition at line 710 of file schedule.hpp.

◆ Before() [5/6]

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

Adds an ordering constraint: this system must run before the given system id.

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

Definition at line 688 of file schedule.hpp.

◆ Before() [6/6]

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

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

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

Definition at line 699 of file schedule.hpp.

◆ BeforeSet()

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

Adds an ordering constraint: this system 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 118 of file system_handle.hpp.

◆ Done()

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

Finishes configuration and returns a reference to the parent schedule.

Returns
Reference to the parent schedule for continued configuration

Definition at line 258 of file system_handle.hpp.

◆ Id()

ScheduleSystemId helios::ecs::SystemHandle::Id ( ) const
inlinenodiscardconstexprnoexcept

Gets the unique schedule-local identifier for this system.

Returns
Schedule system id

Definition at line 264 of file system_handle.hpp.

◆ InSet() [1/2]

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

Assigns this system to a labeled set by type.

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

Definition at line 248 of file system_handle.hpp.

◆ InSet() [2/2]

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

Assigns this system to a labeled set by id.

Creates the target set if needed. Repeated calls with the same set id are ignored.

Parameters
set_idSet to assign this system to
Returns
Reference to this handle for chaining

Definition at line 797 of file schedule.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ RunIf() [1/3]

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

Adds a run condition predicate that must return true for this system to execute.

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

Definition at line 756 of file schedule.hpp.

◆ RunIf() [2/3]

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

Adds a run condition to this system with an explicit name.

Required for lambdas. Derives identity from the provided name.

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 784 of file schedule.hpp.

◆ RunIf() [3/3]

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

Adds a run condition functor that must return true for this system to execute.

Lambdas are rejected; use RunIf(std::string, T&&) to register them with an explicit name.

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

Definition at line 771 of file schedule.hpp.