Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches

Storage for a system. More...

#include <system_storage.hpp>

Public Member Functions

 SystemStorage ()=default
 SystemStorage (SystemId sid, std::string sname, AccessPolicy spolicy, SystemCallable ssystem, SystemLocalDataOptions options)
 Constructs storage from individual members and options.
 SystemStorage (const SystemStorage &)=delete
 SystemStorage (SystemStorage &&) noexcept=default
 ~SystemStorage () noexcept=default
SystemStorageoperator= (const SystemStorage &)=delete
SystemStorageoperator= (SystemStorage &&) noexcept=default

Static Public Member Functions

template<FunctorSystemTrait T>
static SystemStorage FromParam (T &&system, SystemLocalDataOptions options={})
 Factory from a param-style system functor.
template<SystemTrait T>
static SystemStorage FromParamNamed (std::string name, T &&system, SystemLocalDataOptions options={})
 Factory from a param-style system functor with an explicit name.
static SystemStorage From (std::string name, SystemCallable system, AccessPolicy access_policy={}, SystemLocalDataOptions options={})
 Factory for a raw callable with explicit name and access policy.
static SystemStorage From (std::string name, SystemTypeIndex index, SystemCallable system, AccessPolicy access_policy={}, SystemLocalDataOptions options={})
 Factory from a system type index with explicit name and policy.
static SystemStorage From (std::string name, SystemTypeId id, SystemCallable system, AccessPolicy access_policy={}, SystemLocalDataOptions options={})
 Factory from a system type id with explicit name and policy.

Public Attributes

SystemId id
std::string name
AccessPolicy access_policy
SystemCallable system
SystemLocalData local_data

Detailed Description

Storage for a system.

Definition at line 25 of file system_storage.hpp.

Constructor & Destructor Documentation

◆ SystemStorage() [1/4]

helios::ecs::SystemStorage::SystemStorage ( )
default

◆ SystemStorage() [2/4]

helios::ecs::SystemStorage::SystemStorage ( SystemId sid,
std::string sname,
AccessPolicy spolicy,
SystemCallable ssystem,
SystemLocalDataOptions options )
inline

Constructs storage from individual members and options.

Parameters
idSystem identifier
nameSystem name
policyAccess policy
systemCallable that receives (World&, SystemLocalData&)
optionsSystem local data options

Definition at line 137 of file system_storage.hpp.

◆ SystemStorage() [3/4]

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

◆ SystemStorage() [4/4]

helios::ecs::SystemStorage::SystemStorage ( SystemStorage && )
defaultnoexcept

◆ ~SystemStorage()

helios::ecs::SystemStorage::~SystemStorage ( )
defaultnoexcept

Member Function Documentation

◆ From() [1/3]

SystemStorage helios::ecs::SystemStorage::From ( std::string name,
SystemCallable system,
AccessPolicy access_policy = {},
SystemLocalDataOptions options = {} )
inlinestaticnodiscard

Factory for a raw callable with explicit name and access policy.

Parameters
nameSystem name
systemCallable receiving (World&, SystemLocalData&)
access_policyAccess policy for scheduling
optionsSystem local data options
Returns
System storage

Definition at line 93 of file system_storage.hpp.

◆ From() [2/3]

SystemStorage helios::ecs::SystemStorage::From ( std::string name,
SystemTypeId id,
SystemCallable system,
AccessPolicy access_policy = {},
SystemLocalDataOptions options = {} )
inlinestaticnodiscard

Factory from a system type id with explicit name and policy.

Parameters
nameSystem name
idSystem type id
systemCallable receiving (World&, SystemLocalData&)
access_policyAccess policy for scheduling
optionsSystem local data options
Returns
System storage

Definition at line 128 of file system_storage.hpp.

◆ From() [3/3]

SystemStorage helios::ecs::SystemStorage::From ( std::string name,
SystemTypeIndex index,
SystemCallable system,
AccessPolicy access_policy = {},
SystemLocalDataOptions options = {} )
inlinestaticnodiscard

Factory from a system type index with explicit name and policy.

Parameters
nameSystem name
indexSystem type index
systemCallable receiving (World&, SystemLocalData&)
access_policyAccess policy for scheduling
optionsSystem local data options
Returns
System storage

Definition at line 110 of file system_storage.hpp.

◆ FromParam()

template<FunctorSystemTrait T>
SystemStorage helios::ecs::SystemStorage::FromParam ( T && system,
SystemLocalDataOptions options = {} )
inlinestaticnodiscard

Factory from a param-style system functor.

Auto-deduces the access policy from the functor's parameter types. Wraps invocation so that Update is called after the system runs. Only accepts functor structs; lambdas must use FromParamNamed.

Template Parameters
TSystem type satisfying FunctorSystemTrait
Parameters
systemSystem instance
optionsSystem local data options
Returns
System storage

Definition at line 148 of file system_storage.hpp.

◆ FromParamNamed()

template<SystemTrait T>
SystemStorage helios::ecs::SystemStorage::FromParamNamed ( std::string name,
T && system,
SystemLocalDataOptions options = {} )
inlinestaticnodiscard

Factory from a param-style system functor with an explicit name.

Identical to FromParam but uses the provided name instead of the auto-deduced type name for both the storage name and the SystemId derivation. Required for lambdas and optional for functor duplicates.

Template Parameters
TSystem type satisfying SystemTrait
Parameters
nameHuman-readable system name
systemSystem instance
optionsSystem local data options
Returns
System storage

Definition at line 173 of file system_storage.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

SystemStorage & helios::ecs::SystemStorage::operator= ( SystemStorage && )
defaultnoexcept

Member Data Documentation

◆ access_policy

AccessPolicy helios::ecs::SystemStorage::access_policy

Definition at line 28 of file system_storage.hpp.

◆ id

SystemId helios::ecs::SystemStorage::id

Definition at line 26 of file system_storage.hpp.

◆ local_data

SystemLocalData helios::ecs::SystemStorage::local_data

Definition at line 35 of file system_storage.hpp.

◆ name

std::string helios::ecs::SystemStorage::name

Definition at line 27 of file system_storage.hpp.

◆ system

SystemCallable helios::ecs::SystemStorage::system

Type-erased system callable. Receives World& and SystemLocalData& directly. The wrapper lambda constructs params and calls Update after the system runs.

Definition at line 33 of file system_storage.hpp.