Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
composite_param.hpp
Go to the documentation of this file.
1#pragma once
2
6
7namespace helios::ecs {
8
9/**
10 * @brief Helper for implementing `SystemParamTraits` on aggregate parameters.
11 * @details Inherit from this type in a `SystemParamTraits` specialization when
12 * every field is itself a system parameter. Field types in `Fields...` must
13 * match the aggregate's member types exactly.
14 * @tparam Param Aggregate parameter type
15 * @tparam Fields System parameter types for each aggregate field, in order
16 */
17template <typename Param, typename... Fields>
19 /**
20 * @brief Constructs the aggregate from each field's `Make`.
21 * @param world World instance
22 * @param data Per-system local data
23 * @param policy Compiled access policy for the system
24 * @return Constructed aggregate parameter
25 */
26 static Param Make(World& world, SystemLocalData& data,
27 const AccessPolicy& policy) {
28 return Param{SystemParamTraits<Fields>::Make(world, data, policy)...};
29 }
30
31 /**
32 * @brief Registers access for all fields.
33 * @param builder Access policy builder
34 */
35 static constexpr void RegisterAccess(AccessPolicyBuilder& builder) {
36 RegisterParamAccess<Fields...>(builder);
37 }
38};
39
40} // 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
constexpr void RegisterParamAccess(AccessPolicyBuilder &builder)
Registers access declarations for each parameter type.
Helper for implementing SystemParamTraits on aggregate parameters.
static Param Make(World &world, SystemLocalData &data, const AccessPolicy &policy)
Constructs the aggregate from each field's Make.
static constexpr void RegisterAccess(AccessPolicyBuilder &builder)
Registers access for all fields.
Local data for a system.
Primary template — deliberately incomplete.