Skip to content

Engine → ECS

query.h

Queries. A query is a value type that caches the archetypes matching its description and refreshes incrementally (new archetypes only). Iteration locks the world for its duration, so structural calls made from a callback fail with STRUCTURE_LOCKED and the callback must use a command_buffer instead.

Structs

File Description
query_desc What a query matches: archetypes containing every bit of with and none of without; with a non-empty changed mask a chunk is visited only when one of the listed columns changed after sinceVersion. optional and writes record what a view's pack reads when present and what it writes; the query itself does not consult them. Stamping follows the constness of the span a chunk_view hands out, and Debug write validation uses the bound system's system_desc.

Classes

File Description
query

Forward Declarations

component_registry

class component_registry;

system_context

class system_context;

world

class world;

Constants

Name Type Value Description
QUERY_INLINE_MATCHES inline constexpr usize 16 Matching archetypes a query stores inline before it touches the heap. A view built per system run (the documented context.view<...>().for_each idiom, system.h) therefore allocates nothing while it matches at most this many archetypes; beyond that the first refresh of each new query allocates once.

Functions

Public

detail::registry_of

[[nodiscard]] CONJURE_API const component_registry &registry_of(const world &target) noexcept;

The registry a world was created on; lets headers that cannot include world.h build masks.