Skip to content

Engine → ECS

archetype.h

One component set and the chunks holding its entities. Read-only outside the world; pointers to archetypes stay valid for the world's lifetime (the world's list is append-only).

Structs

File Description
archetype::archetype_edge Graph edge to the archetypes that differ by one component.
archetype::row_location Position of one row.
archetype::row_span Consecutive rows of one chunk: rows firstRow .. firstRow + rowCount - 1 of chunk chunkIndex.
chunk_layout Where each column of an archetype lives inside a chunk block. The entity column sits at offset 0; columns hold the non-tag components only.

Classes

File Description
archetype One component set and the chunks holding its entities. Read-only outside the world; pointers to archetypes stay valid for the world's lifetime (the world's list is append-only).

Forward Declarations

chunk

class chunk;

chunk_pool

class chunk_pool;

chunk_view

class chunk_view;

component_registry

class component_registry;

query

class query;

system_context

class system_context;

world

class world;

Constants

Name Type Value Description
CHUNK_ALIGNMENT inline constexpr u32 64 Alignment of every chunk block.
CHUNK_SIZE inline constexpr u32 16 * 1024 Bytes of one chunk block.
COLUMN_ALIGNMENT inline constexpr u32 16 Minimum alignment of a column start inside a chunk (SIMD-friendly loads).
SMALL_CAPACITY_WARNING inline constexpr u32 8 Fewest rows per chunk before compute() logs a warning about a wasteful archetype.