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

Classes

class  AsyncMessageStorage
 Base class for type-erased async message storage. More...
struct  HasSystemParamCallOperatorHelper
struct  MemberFnArgs
 Extracts the argument types of a member function pointer. More...
struct  MemberFnArgs< R(*)(Args...)>
 Concept: a type's operator() arguments all have SystemParamTraits. More...
struct  MemberFnArgs< R(Args...)>
struct  MemberFnArgs< R(C::*)(Args...) const >
struct  MemberFnArgs< R(C::*)(Args...)>
struct  RegisterQueryAccess
 Helper to register query component access from a component tuple. More...
struct  RegisterQueryAccess< std::tuple< Cs... > >

Concepts

concept  HasValidSystemParams
concept  HasSystemParamCallOperator

Functions

template<typename AccessSpec>
auto FetchComponent (const Archetype &archetype, Entity entity, ComponentManager &components) -> ComponentAccessType_t< AccessSpec >
 Fetches a single component for the current entity from the archetype, returning the appropriate access type.
template<typename AccessSpec>
auto FetchComponentConst (const Archetype &archetype, Entity entity, const ComponentManager &components) -> ComponentAccessType_t< AccessSpec >
 Const-world variant: always returns const access.
template<typename... Cs>
bool EntityHasComponentsCheck (const ComponentManager &manager, Entity entity, std::tuple< Cs... > *)
template<typename... Cs>
auto FetchComponentsMutable (const Archetype &archetype, Entity entity, ComponentManager &manager, std::tuple< Cs... > *) -> std::tuple< ComponentAccessType_t< Cs >... >
template<typename... Cs>
auto FetchComponentsConst (const Archetype &archetype, Entity entity, const ComponentManager &manager, std::tuple< Cs... > *) -> std::tuple< ComponentAccessType_t< Cs >... >
constexpr bool HasIntersection (std::span< const ComponentTypeId > lhs, std::span< const ComponentTypeId > rhs) noexcept
 Checks if two sorted ranges have any common elements.
constexpr bool HasIntersectionBinarySearch (std::span< const ResourceTypeId > lhs, std::span< const ResourceTypeId > rhs) noexcept
 Checks if any element from one range exists in another sorted range.

Variables

template<typename... Args>
constexpr bool kAllAreSystemParams
 True if every Arg in the pack satisfies SystemParam.

Function Documentation

◆ EntityHasComponentsCheck()

template<typename... Cs>
bool helios::ecs::details::EntityHasComponentsCheck ( const ComponentManager & manager,
Entity entity,
std::tuple< Cs... > *  )
inlinenodiscard

Definition at line 40 of file query.hpp.

◆ FetchComponent()

template<typename AccessSpec>
auto helios::ecs::details::FetchComponent ( const Archetype & archetype,
Entity entity,
ComponentManager & components ) -> ComponentAccessType_t< AccessSpec >
inline

Fetches a single component for the current entity from the archetype, returning the appropriate access type.

Handles all access patterns:

  • T& (mutable ref) -> returns T&
  • const T& (const ref) -> returns const T&
  • T&& (rvalue ref) -> returns T&& (via std::move)
  • T / const T (value) -> returns T by value
  • T* (nullable mutable pointer) -> returns T*, nullptr if absent
  • const T* (nullable const pointer) -> returns const T*, nullptr if absent
    Template Parameters
    AccessSpecThe original access specifier from the query arg list
    Parameters
    archetypeThe archetype the entity belongs to
    entityThe entity to fetch the component for
    componentsThe component manager
    Returns
    The component with the appropriate access type

Definition at line 43 of file iterator.hpp.

◆ FetchComponentConst()

template<typename AccessSpec>
auto helios::ecs::details::FetchComponentConst ( const Archetype & archetype,
Entity entity,
const ComponentManager & components ) -> ComponentAccessType_t< AccessSpec >
inline

Const-world variant: always returns const access.

Definition at line 112 of file iterator.hpp.

◆ FetchComponentsConst()

template<typename... Cs>
auto helios::ecs::details::FetchComponentsConst ( const Archetype & archetype,
Entity entity,
const ComponentManager & manager,
std::tuple< Cs... > *  ) -> std::tuple< ComponentAccessType_t< Cs >... >
inlinenodiscard

Definition at line 56 of file query.hpp.

◆ FetchComponentsMutable()

template<typename... Cs>
auto helios::ecs::details::FetchComponentsMutable ( const Archetype & archetype,
Entity entity,
ComponentManager & manager,
std::tuple< Cs... > *  ) -> std::tuple< ComponentAccessType_t< Cs >... >
inlinenodiscard

Definition at line 47 of file query.hpp.

◆ HasIntersection()

bool helios::ecs::details::HasIntersection ( std::span< const ComponentTypeId > lhs,
std::span< const ComponentTypeId > rhs )
nodiscardconstexprnoexcept

Checks if two sorted ranges have any common elements.

Uses a merge-like algorithm for O(n + m) complexity.

Parameters
lhsThe first sorted range
rhsThe second sorted range
Returns
True if there are any common elements, false otherwise

Definition at line 26 of file access_policy.hpp.

◆ HasIntersectionBinarySearch()

bool helios::ecs::details::HasIntersectionBinarySearch ( std::span< const ResourceTypeId > lhs,
std::span< const ResourceTypeId > rhs )
nodiscardconstexprnoexcept

Checks if any element from one range exists in another sorted range.

For each element in lhs, performs binary search in rhs.

Parameters
lhsThe first sorted range
rhsThe second sorted range
Returns
True if there are any common elements, false otherwise

Definition at line 52 of file access_policy.hpp.

Variable Documentation

◆ kAllAreSystemParams

template<typename... Args>
bool helios::ecs::details::kAllAreSystemParams
inlineconstexpr
Initial value:
=
Concept for types usable as system function parameters.

True if every Arg in the pack satisfies SystemParam.

Definition at line 39 of file system.hpp.