ComponentTypeId Class Template
Unique type identifier for component types, scoped per domain. More...
Declaration
Friends Index
template <typename THandle> | |
| constexpr bool | operator== |
Public Constructors Index
template <typename THandle> | |
| ComponentTypeId (const size_t id) | |
|
Constructs a ComponentTypeId with a specific ID value. More... | |
template <typename THandle> | |
| ComponentTypeId (helios::ecs::types::no_init_t) | |
|
Constructs an uninitialized ComponentTypeId. More... | |
Public Member Functions Index
template <typename THandle> | |
| size_t | value () const noexcept |
|
Returns the underlying ID value. More... | |
Private Member Attributes Index
template <typename THandle> | |
| size_t | id_ {0} |
|
The underlying ID value. More... | |
Public Static Functions Index
template <typename T> | |
| static auto | id () -> ComponentTypeId< THandle > |
|
Gets the ComponentTypeId for a specific component type. More... | |
Description
Unique type identifier for component types, scoped per domain.
ComponentTypeId assigns a unique, monotonically increasing integer ID to each component type at compile time. This ID is used as an index into the component storage vector within EntityManager, enabling O(1) access.
Definition at line 53 of file ComponentTypeId.ixx.
Friends
operator==
| constexpr noexcept default |
Definition at line 106 of file ComponentTypeId.ixx.
Public Constructors
ComponentTypeId()
| inline explicit |
Constructs a ComponentTypeId with a specific ID value.
This constructor initializes a ComponentTypeId object with a given ID, representing a unique identifier for a component type. The ID is used internally for indexing and retrieving components from the storage system.
- Parameters
-
id The unique identifier assigned to the component type. This ID must be a valid non-negative value.
Definition at line 72 of file ComponentTypeId.ixx.
ComponentTypeId()
| inline explicit |
Constructs an uninitialized ComponentTypeId.
- Parameters
-
<a href="/docs/api/helios-ecs/structs/helios/ecs/types/no-init-t">no_init_t</a> Tag to indicate no initialization.
Definition at line 79 of file ComponentTypeId.ixx.
Public Member Functions
value()
| inline noexcept |
Returns the underlying ID value.
- Returns
The numeric type ID, suitable for use as an array index.
Definition at line 86 of file ComponentTypeId.ixx.
Referenced by helios::ecs::EntityManager< THandle, TEntityRegistry, TCapacity >::has, helios::ecs::ComponentOpsRegistry< THandle >::ops, helios::ecs::EntityManager< THandle, TEntityRegistry, TCapacity >::raw and helios::ecs::ComponentOpsRegistry< THandle >::setOps.
Private Member Attributes
id_
|
Public Static Functions
id()
| inline static |
Gets the ComponentTypeId for a specific component type.
Uses TypeIndexer to generate a unique, monotonically increasing ID for each component type. The ID is generated once per type and cached.
- Template Parameters
-
T The component type. Must be a concrete type (not abstract).
- Returns
The unique ComponentTypeId for type T.
Definition at line 101 of file ComponentTypeId.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.