Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::ArchetypeMatchStamps Struct Reference

Public Member Functions

 ArchetypeMatchStamps (const ArchetypeMatchStamps &)=delete
 
ArchetypeMatchStampsoperator= (const ArchetypeMatchStamps &)=delete
 
 ArchetypeMatchStamps (ArchetypeMatchStamps &&other) noexcept
 
ArchetypeMatchStampsoperator= (ArchetypeMatchStamps &&other) noexcept
 
GAIA_NODISCARD bool has (uint32_t sid) const
 
GAIA_NODISCARD uint32_t get (uint32_t sid) const
 
void set (uint32_t sid, uint32_t version)
 
void clear ()
 

Public Attributes

cnt::darray< uint32_t * > pages
 Lazily allocated pages keyed by archetype id >> PageBits.
 

Static Public Attributes

static constexpr uint32_t PageBits = 10
 Keep stamp pages small enough to avoid dense high-water-mark allocations while still preserving O(1) indexing by world-local archetype id.
 
static constexpr uint32_t PageSize = 1U << PageBits
 
static constexpr uint32_t PageMask = PageSize - 1
 

Member Function Documentation

◆ clear()

void gaia::ecs::ArchetypeMatchStamps::clear ( )
inline

Reuse allocated pages across matcher runs. Only the stored stamp values need to be reset; freeing the pages here would put heap churn back into the hot path.


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