cubos::core::ecs::DenseTableRegistry class final

Stores the dense tables of a given world.

Constructors, destructors, conversion operators

DenseTableRegistry()
Constructs.

Public functions

void reset()
Resets the registry to its initial state.
auto contains(ArchetypeId archetype) const -> bool
Checks if the given archetype has a dense table.
auto create(ArchetypeId archetype, ArchetypeGraph& graph, Types& types) -> DenseTable&
Returns a reference to the dense table of the given archetype.
auto at(ArchetypeId archetype) -> DenseTable&
Returns a reference to the dense table of the given archetype.

Function documentation

void cubos::core::ecs::DenseTableRegistry::reset()

Resets the registry to its initial state.

Previously returned identifiers become invalid, as they might be reused.

bool cubos::core::ecs::DenseTableRegistry::contains(ArchetypeId archetype) const

Checks if the given archetype has a dense table.

Parameters
archetype Archetype identifier.
Returns WHether it contains a table or not.

DenseTable& cubos::core::ecs::DenseTableRegistry::create(ArchetypeId archetype, ArchetypeGraph& graph, Types& types)

Returns a reference to the dense table of the given archetype.

Parameters
archetype Archetype identifier.
graph Archetype graph used to initialize the table, if necessary.
types Type registry used to initialize the table, if necessary.
Returns Reference to table.

Creates the table if it doesn't exist already.

DenseTable& cubos::core::ecs::DenseTableRegistry::at(ArchetypeId archetype)

Returns a reference to the dense table of the given archetype.

Parameters
archetype Archetype identifier.
Returns Reference to table.

Aborts if the table doesn't exist.