Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
system_param.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <concepts>
6#include <type_traits>
7
8namespace helios::ecs {
9
10class World;
11struct SystemLocalData;
12
13/**
14 * @brief Primary template — deliberately incomplete.
15 * @details Every system parameter type must provide a specialisation with:
16 * - `static auto Make(World&, SystemLocalData&, const AccessPolicy&) -> T`
17 * - `static constexpr void RegisterAccess(AccessPolicyBuilder&)`
18 */
19template <typename T>
21
22/**
23 * @brief Concept for types usable as system function parameters.
24 * @details Satisfied when `SystemParamTraits<T>` provides `RegisterAccess` and
25 * `Make`.
26 */
27template <typename T>
28concept SystemParam =
29 requires(AccessPolicyBuilder& builder, World& world, SystemLocalData& local,
30 const AccessPolicy& policy) {
31 { SystemParamTraits<std::remove_cvref_t<T>>::RegisterAccess(builder) };
32 {
33 SystemParamTraits<std::remove_cvref_t<T>>::Make(world, local, policy)
34 } -> std::same_as<std::remove_cvref_t<T>>;
35 };
36
37} // namespace helios::ecs
Fluent builder for constructing an AccessPolicy.
Stores data access requirements for a system at compile time.
The World class manages entities with their components and systems.
Definition world.hpp:39
Concept for types usable as system function parameters.
Local data for a system.
Primary template — deliberately incomplete.