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

Classes

struct  ComponentTypeInfo
 Component type information with ID and name. More...
 
struct  QueryDescriptor
 Query descriptor for AccessPolicy. More...
 
struct  ResourceTypeInfo
 Resource type information with ID and name. More...
 
class  ScheduleExecutor
 Manages system scheduling and execution for a single schedule. More...
 
struct  ScheduleOrdering
 Ordering constraints for a schedule. More...
 
class  Scheduler
 Main scheduler that manages all schedules. More...
 
class  SystemDiagnostics
 Provides diagnostic information about system conflicts and validation errors. More...
 
struct  SystemInfo
 Metadata about a system. More...
 
struct  SystemOrdering
 Ordering constraints for a system. More...
 
struct  SystemSetInfo
 Metadata about a system set. More...
 
struct  SystemStorage
 Storage for a system with its metadata and local storage. More...
 
struct  TrackedFuture
 Tracked future with ready flag to reduce syscall churn. More...
 

Functions

constexpr bool HasIntersection (std::span< const ComponentTypeInfo > lhs, std::span< const ComponentTypeInfo > rhs) noexcept
 Checks if two sorted ranges have any common elements.
 
constexpr bool HasIntersectionBinarySearch (std::span< const ResourceTypeInfo > lhs, std::span< const ResourceTypeInfo > rhs) noexcept
 Checks if any element from one range exists in another sorted range.
 

Function Documentation

◆ HasIntersection()

constexpr bool helios::app::details::HasIntersection ( std::span< const ComponentTypeInfo lhs,
std::span< const ComponentTypeInfo rhs 
)
constexprnoexcept

Checks if two sorted ranges have any common elements.

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

Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/access_policy.hpp.

Definition at line 59 of file access_policy.hpp.

60 {
61 auto it1 = lhs.begin();
62 auto it2 = rhs.begin();
63
64 while (it1 != lhs.end() && it2 != rhs.end()) {
65 if (it1->type_id < it2->type_id) {
66 ++it1;
67 } else if (it2->type_id < it1->type_id) {
68 ++it2;
69 } else {
70 return true; // Found common element
71 }
72 }
73
74 return false;
75}

◆ HasIntersectionBinarySearch()

constexpr bool helios::app::details::HasIntersectionBinarySearch ( std::span< const ResourceTypeInfo lhs,
std::span< const ResourceTypeInfo rhs 
)
constexprnoexcept

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

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

Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/access_policy.hpp.

Definition at line 81 of file access_policy.hpp.

82 {
83 // Optimize by iterating over smaller range
84 if (lhs.size() > rhs.size()) {
85 std::swap(lhs, rhs);
86 }
87
88 return std::ranges::any_of(lhs, [rhs](const auto& item) {
89 return std::ranges::binary_search(
90 rhs, item, [](const auto& info1, const auto& info2) { return info1.type_id < info2.type_id; });
91 });
92}