Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::ArchetypeLookupKey Class Referencefinal

Hashmap key for archetype lookup, combining a hash with the archetype base pointer. Hash collisions fall back to component-span comparison when no archetype id is set. More...

#include <archetype.h>

Public Member Functions

 ArchetypeLookupKey (Archetype::LookupHash hash, const ArchetypeBase *pArchetypeBase)
 
GAIA_NODISCARD size_t hash () const
 Hash of the archetype lookup value.
 
GAIA_NODISCARD Archetypearchetype () const
 Resolves the lookup key to its concrete archetype.
 
GAIA_NODISCARD bool operator== (const ArchetypeLookupKey &other) const
 

Static Public Attributes

static constexpr bool IsDirectHashKey = true
 Marks this key as a direct hash key.
 

Detailed Description

Hashmap key for archetype lookup, combining a hash with the archetype base pointer. Hash collisions fall back to component-span comparison when no archetype id is set.

Member Function Documentation

◆ archetype()

GAIA_NODISCARD Archetype * gaia::ecs::ArchetypeLookupKey::archetype ( ) const
inline

Resolves the lookup key to its concrete archetype.

Returns
Archetype pointer, or null when the key holds no archetype.

◆ hash()

GAIA_NODISCARD size_t gaia::ecs::ArchetypeLookupKey::hash ( ) const
inline

Hash of the archetype lookup value.

Returns
Archetype hash.

The documentation for this class was generated from the following file: