template<std::size_t N> asge::ecs::EntityAllocator
Fixed-capacity issuer and validator of generational Entity handles.
#include <EntityAllocator.hpp>Wraps a mem::FreeList<N> of slot indices with a per-slot generation counter. Create() claims a free index and pairs it with that slot's current generation; Destroy() returns the index to the free-list and then bumps the slot's generation, which invalidates every Entity handle previously issued for that slot. IsAlive() is the source of truth for handle validity: a handle is alive only while its slot is currently claimed and its generation matches the slot's current one — so a handle built for a never-allocated slot is correctly rejected too.
A slot whose generation reaches its maximum value is retired rather than recycled, so a still-held stale handle can never alias a future allocation once the counter would otherwise wrap back to a reused value.
N | Number of concurrently allocatable entities; fixed at compile time. |
Private Attributes
Public Member Functions
EntityAllocator()EntityAllocator(EntityAllocator const &)=deleteEntityAllocator(EntityAllocator &&)=defaultEntityAllocator & operator=(EntityAllocator const &)=deleteEntityAllocator & operator=(EntityAllocator &&)=defaultBoolResult Destroy(Entity inEntity) noexcept