Engine → ECS → archetype.h
chunk_layout
| Type | Struct |
| Namespace | conjure::ecs |
| Include File Path | engine/include/conjure/ecs/archetype.h |
| Source File Path | engine/src/ecs/archetype.cpp |
| API ↗ | Archives and serialisation |
Syntax
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| public | capacity | u32 | 0 | |
| public | columnIndex | std:: | make_ | |
| public | column | core:: | {} | |
| public | columnSizes | core:: | {} | |
| public | components | core:: | {} | |
| public | NO_COLUMN | static constexpr u16 | 0xFFFF |
Functions
Public
block_end
block_end[[nodiscard]] u32 block_end() const noexcept;Byte offset one past the last column (the used part of the block).
column_count
column_count[[nodiscard]] u32 column_count() const noexcept;Number of data columns (tags excluded).
column_of
column_of[[nodiscard]] u16 column_of(
component_id id) const noexcept;The column of a component id, or NO_COLUMN when the archetype lacks it or it is a tag.
compute
compute[[nodiscard]] static core::result<chunk_layout> compute(
const component_mask &mask,
const component_registry ®istry);Computes the maximal layout for a mask: rowBytes = sizeof(entity) + sum of sizes, capacity starts at CHUNK_SIZE / rowBytes and decrements until every aligned column fits the block. ARCHETYPE_TOO_LARGE when not even one row fits, UNKNOWN_COMPONENT for an id the registry does not know. A capacity below SMALL_CAPACITY_WARNING logs one WARN.
make_empty_column_index
make_empty_column_index[[nodiscard]] static constexpr std::array<u16, MAX_COMPONENTS> make_empty_column_index() noexcept;An index table with every id mapped to NO_COLUMN.
row_bytes
row_bytes[[nodiscard]] u32 row_bytes() const noexcept;Bytes one row occupies across every column, entity included.