EntityHandle Struct Template
A versioned handle for referencing entities in a registry. More...
Declaration
Public Member Typedefs Index
template <typename TStrongId> | |
| using | StrongId_type = TStrongId |
Public Operators Index
template <typename TStrongId> | |
| bool | operator== (const EntityHandle &) const =default |
|
Compares two handles for equality. More... | |
template <typename TStrongId> | |
| constexpr bool | operator< (const EntityHandle &entityHandle) const noexcept |
|
Compares two handles by entity ID (less-than). More... | |
template <typename TStrongId> | |
| constexpr bool | operator> (const EntityHandle &entityHandle) const noexcept |
|
Compares two handles by entity ID (greater-than). More... | |
Public Member Functions Index
template <typename TStrongId> | |
| bool | isValid () const noexcept |
|
Checks if this handle is potentially valid. More... | |
Public Member Attributes Index
template <typename TStrongId> | |
| EntityId | entityId {0} |
|
The unique identifier for the entity within the registry. More... | |
template <typename TStrongId> | |
| VersionId | versionId = InvalidVersion |
|
The version number for stale handle detection. More... | |
template <typename TStrongId> | |
| TStrongId | strongId {} |
|
The domain-specific strong ID associated with this handle. More... | |
Description
A versioned handle for referencing entities in a registry.
`EntityHandle` combines an entity ID with a version number and a domain-specific strong ID to provide safe, typed references to registered entities. The version ensures that handles to removed entities are detected as stale.
- Template Parameters
-
TStrongId A strong ID type carrying domain semantics.
- See Also
Definition at line 47 of file EntityHandle.ixx.
Public Member Typedefs
StrongId_type
|
Definition at line 49 of file EntityHandle.ixx.
Public Operators
operator<()
| inline constexpr noexcept |
Compares two handles by entity ID (less-than).
- Parameters
-
entityHandle The handle to compare against.
- Returns
True if this handle's entity ID is less than the other.
Definition at line 80 of file EntityHandle.ixx.
Reference helios::ecs::types::EntityHandle< TStrongId >::entityId.
operator==()
| default |
Compares two handles for equality.
Definition at line 71 of file EntityHandle.ixx.
operator>()
| inline constexpr noexcept |
Compares two handles by entity ID (greater-than).
- Parameters
-
entityHandle The handle to compare against.
- Returns
True if this handle's entity ID is greater than the other.
Definition at line 91 of file EntityHandle.ixx.
Reference helios::ecs::types::EntityHandle< TStrongId >::entityId.
Public Member Functions
isValid()
| inline nodiscard noexcept |
Checks if this handle is potentially valid.
- Returns
True if the version is at least 1 (initial version).
Definition at line 101 of file EntityHandle.ixx.
Reference helios::ecs::types::EntityHandle< TStrongId >::versionId.
Public Member Attributes
entityId
|
The unique identifier for the entity within the registry.
Definition at line 54 of file EntityHandle.ixx.
Referenced by helios::ecs::EntityRegistry< TStrongId, TLookupStrategy, TAllowRemoval, TCapacity >::destroy, helios::ecs::types::EntityHandle< TStrongId >::operator< and helios::ecs::types::EntityHandle< TStrongId >::operator>.
strongId
|
The domain-specific strong ID associated with this handle.
Definition at line 66 of file EntityHandle.ixx.
Referenced by helios::ecs::EntityRegistry< TStrongId, TLookupStrategy, TAllowRemoval, TCapacity >::destroy.
versionId
|
The version number for stale handle detection.
Incremented when an entity is removed from the registry.
Definition at line 61 of file EntityHandle.ixx.
Referenced by helios::ecs::types::EntityHandle< TStrongId >::isValid.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.