class

FEntitySlotMap

EntityID → World slot: open addressing with linear probing over a power-of-two table kept at most half full. std::unordered_map paid a node allocation per entity and a pointer chase per lookup; an entity id is a random 64-bit UUID, so here a lookup is almost always one probe into a flat array. Erase shifts the rest of the probe run back instead of leaving a tombstone, so a world that churns entities for hours never ends up probing over dead buckets.

Module
ECS
Header
#include "ECS/EntitySlotMap.h"
Namespace
Mowo

Concurrent Find calls are fine; every write is a World structural operation and runs under the World's mutex.

Public functions

ReturnsNameDescription
uint32_tFind
boolContains
uint32_t&FindOrAddThe value stored for id, inserting value first when it is absent.
boolErase
size_tSize
voidClearKeeps the table's capacity: a world that is cleared is usually refilled with as many entities.
size_tBucketCount

Function details

Find

C++
uint32_t Find(EntityID id) const

Contains

C++
bool Contains(EntityID id) const

FindOrAdd

C++
uint32_t& FindOrAdd(EntityID id, uint32_t value, bool& inserted)

The value stored for id, inserting value first when it is absent. The reference stays valid until the next FindOrAdd, Erase or Clear.

Erase

C++
bool Erase(EntityID id)

Size

C++
size_t Size() const

Clear

C++
void Clear()

Keeps the table's capacity: a world that is cleared is usually refilled with as many entities.

BucketCount

C++
size_t BucketCount() const
Generated from ECS/EntitySlotMap.h via ecs.json · Nov 4, 2026Version 1.0.0