EntityHandle Struct Template
A versioned handle for referencing entities in a registry. More...
Declaration
Public Member Typedefs Index
template <typename TDomainTag> | |
| using | DomainTag_type = TDomainTag |
template <typename TDomainTag> | |
| using | StrongId_type = StrongId< TDomainTag > |
Public Operators Index
template <typename TDomainTag> | |
| bool | operator== (const EntityHandle< TDomainTag > &) const =default |
|
Compares two handles for equality. More... | |
template <typename TDomainTag> | |
| constexpr bool | operator< (const EntityHandle< TDomainTag > &entityHandle) const noexcept |
|
Compares two handles by entity ID (less-than). More... | |
template <typename TDomainTag> | |
| constexpr bool | operator> (const EntityHandle< TDomainTag > &entityHandle) const noexcept |
|
Compares two handles by entity ID (greater-than). More... | |
Public Member Functions Index
template <typename TDomainTag> | |
| bool | isValid () const noexcept |
|
Checks if this handle is potentially valid. More... | |
Public Member Attributes Index
template <typename TDomainTag> | |
| EntityId | entityId {0} |
|
The unique identifier for the entity within the registry. More... | |
template <typename TDomainTag> | |
| VersionId | versionId = InvalidVersion |
|
The version number for stale handle detection. More... | |
template <typename TDomainTag> | |
| StrongId< TDomainTag > | 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
-
TDomainTag Domain tag used to derive StrongId<TDomainTag>.
- See Also
Definition at line 47 of file EntityHandle.ixx.
Public Member Typedefs
DomainTag_type
|
Definition at line 66 of file EntityHandle.ixx.
StrongId_type
|
Definition at line 68 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 82 of file EntityHandle.ixx.
Reference helios::ecs::types::EntityHandle< TDomainTag >::entityId.
operator==()
| default |
Compares two handles for equality.
Definition at line 73 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 93 of file EntityHandle.ixx.
Reference helios::ecs::types::EntityHandle< TDomainTag >::entityId.
Public Member Functions
isValid()
| inline noexcept |
Checks if this handle is potentially valid.
- Returns
True if the version is at least 1 (initial version).
Definition at line 103 of file EntityHandle.ixx.
Reference helios::ecs::types::EntityHandle< TDomainTag >::versionId.
Public Member Attributes
entityId
|
The unique identifier for the entity within the registry.
Definition at line 52 of file EntityHandle.ixx.
Referenced by helios::ecs::EntityRegistry< TDomainTag, TLookupStrategy, TAllowRemoval, TCapacity >::destroy, helios::ecs::types::EntityHandle< TDomainTag >::operator< and helios::ecs::types::EntityHandle< TDomainTag >::operator>.
strongId
|
The domain-specific strong ID associated with this handle.
Definition at line 64 of file EntityHandle.ixx.
Referenced by helios::ecs::EntityRegistry< TDomainTag, TLookupStrategy, TAllowRemoval, TCapacity >::destroy.
versionId
|
The version number for stale handle detection.
Incremented when an entity is removed from the registry.
Definition at line 59 of file EntityHandle.ixx.
Referenced by helios::ecs::types::EntityHandle< TDomainTag >::isValid.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.