ECS

ECS module API reference: 11 headers · 20 types · 263 symbols.

Generated from ecs.json · Nov 4, 2026Version 1.0.0
Build name
MowoEngine.ECS
Source
Engine/Source/Runtime/ECS/Public
Category
Runtime
Contents
11 headers · 20 types · 263 symbols

ECS/Archetype.h

KindTypeSummary
structBitsetHashbitset<MAX_COMPONENTS> has no built-in std::hash, so the archetype map keys on this: 64-bit chunks mixed boost-style. Runs on archetype lookup only, never in the GetComponent hot path.
classIComponentColumnType-erased column: one per ComponentID an Archetype tracks. Components are stored contiguously and matched 1:1 with the archetype's entity list by row index, so World can hold heterogeneous columns in one map without lo
classComponentColumnOne per (Archetype, ComponentID) pair.
structArchetypeEntities sharing a component signature. Every entity with signature S lives in exactly one Archetype keyed by S, and its columns are the only storage for those components. AddComponent / RemoveComponent migrate the entit

ECS/Component.h

KindTypeSummary
structComponentBaseOptional — components are plain structs and need not derive from this.

ECS/ComponentOps.h

KindTypeSummary
classFComponentOps

ECS/Entity.h

KindTypeSummary
classEntityLightweight entity handle.

ECS/EntityCommandBuffer.h

KindTypeSummary
classFEntityCommandBufferStructural changes recorded now and applied later, on the main thread, in one go — the Mass command buffer. A worker or a ForEach that needs to add, remove or destroy records here instead of submitting one std::function

ECS/EntitySlotMap.h

KindTypeSummary
classFEntitySlotMapEntityID → 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 6

ECS/Query.h

KindTypeSummary
classQuery

Free functions

SignatureDescription
template<typename... Ts> inline auto World::MakeQuery()The World.h declaration returns auto because it can't name Query yet, so this definition must deduce too — spelling Query<Ts...> as the return type is a declaration mismatch under MSVC.

ECS/SceneSystemRegistry.h

KindTypeSummary
structFModularSceneSystemOne world system contributed by a plugin (or a below-Game module). Mirrors Scene's internal SceneSystemEntry: which registration set the system belongs to (base = edit mode, simulation, runtime), where it ticks outside W
classFSceneSystemRegistry

ECS/System.h

KindTypeSummary
enumSystemPhaseWorld::Update runs systems phase by phase in this order, preserving registration order within a phase. Mirrors AActor::ETickGroup. The default is PrePhysics, so systems that don't opt into a later phase keep their relati
structFSystemResourcesWorld state that lives outside the component arrays. A system that declares its component access declares these too, so two systems that both reach the physics world (or a shared navmesh query) never share a batch; befor
classSystem

Free functions

SignatureDescription
using ComponentMask = std::bitset<MAX_COMPONENTS>Same bitset the world uses for entity signatures, indexed by FComponentRegistry::GetComponentID<T>().

ECS/Types.h

KindTypeSummary
structFEntityHandleRuntime handle into a World's dense slot table: no hash on the way to the components. The UUID stays the identity that is saved, sent and compared; a handle is valid only in the World that issued it and only until that e
classFComponentRegistryRegistration lives in the ECS DLL so ids stay consistent across DLL boundaries.

Free functions

SignatureDescription
using EntityID = uint64_tRandom 64-bit UUID that survives save/load. Zero means invalid.
constexpr EntityID INVALID_ENTITY = 0
using ComponentID = uint32_t
constexpr std::size_t MAX_COMPONENTS = 512Distinct component *types*, not instances — sizes World's per-entity signature bitset (64 bytes) and every archetype's dense column index. The engine registers ~120 reflected types plus unreflected ones before a game or plugin adds any, so 256 left too little room; registration past the cap is a fatal error at the type that crosses it, not a later out_of_range.
static_assert(MAX_COMPONENTS % 64 == 0, "MAX_COMPONENTS must stay a whole number of 64-bit words for BitsetHash")
static_assert(MAX_COMPONENTS < 0x1000, "component ids must stay below the RPC wire-id range (FReplicatedComponentRegistry::kRpcWireFirst)")
constexpr std::size_t MAX_ENTITIES = 100000Advisory only: archetype columns grow on demand and never preallocate a slot pool of this size.

ECS/World.h

KindTypeSummary
structWorldArchetypeSnapshot
structWorldSnapshot
classWorld

Free functions

SignatureDescription
template<typename T, typename... Args> T& World::AddComponent(EntityID entity, Args&&... args)
template<typename T> void World::RemoveComponent(EntityID entity)
template<typename T> T* World::GetComponent(EntityID entity)
template<typename T> const T* World::GetComponent(EntityID entity) const
template<typename T> T* World::GetComponent(FEntityHandle handle)
template<typename T> const T* World::GetComponent(FEntityHandle handle) const
template<typename T> T* World::GetComponentHinted(EntityID entity, uint32_t& slotHint)
inline FEntityHandle World::GetHandle(EntityID entity) const
inline bool World::IsHandleValid(FEntityHandle handle) const
inline EntityID World::GetEntityID(FEntityHandle handle) const
template<typename... Ts> void World::GetComponents(EntityID entity, Ts*&... out)
template<typename... Ts> void World::GetComponents(FEntityHandle handle, Ts*&... out)
template<typename... Ts> void World::GetComponentsHinted(EntityID entity, uint32_t& slotHint, Ts*&... out)
template<typename T> bool World::HasComponent(EntityID entity) const
template<typename T> bool World::HasComponent(FEntityHandle handle) const
template<typename T> bool World::HasComponentHinted(EntityID entity, uint32_t slotHint) const
template<typename T, typename... Args> T* World::AddSystem(Args&&... args)
template<typename T> T* World::GetSystem()
template<typename T> void World::RemoveSystem()
template<typename T, typename... Args> T& Entity::AddComponent(Args&&... args)
template<typename T> void Entity::RemoveComponent()
template<typename T> T* Entity::GetComponent()
template<typename T> const T* Entity::GetComponent() const
template<typename T> bool Entity::HasComponent() const
inline void Entity::Destroy()
inline const std::vector<Archetype*>& World::GetMatchList(const ComponentID* ids, size_t count)The cache clear/build races only with itself (two iterations starting concurrently after a structural change), never with a live consumer: the version can only move via structural ops, which MOWO_CHECK !IsIterating(), so an in-flight pass pins the version and no concurrent GetMatchList can clear the entry it iterates. Mapped vectors are reference-stable across inserts, so the returned reference survives other lists being cached.
template<typename T, typename Func> void World::ForEach(Func&& func)
template<typename... Ts, typename Func> void World::ForEachWith(Func&& func)
template<typename... Ts, typename Func> void World::ForEachChunk(Func&& func)
template<typename... Ts, typename Func> void World::ParallelForEachWith(uint32_t rowsPerJob, Func&& func)
template<typename Func> void World::ForEachEntity(Func&& func) const
template<typename Func> void World::ForEachMatchingArchetype(const std::bitset<MAX_COMPONENTS>& required, Func&& func) const

Page feedback

Was this page helpful?