view
| Type | Class |
| Namespace | conjure::ecs |
| Include File Path | engine/include/conjure/ecs/view.h |
| Source File Path | N/A |
| API ↗ | Queries, views and systems |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | explicit view(
world &target); | A view over every entity of target holding the required components of the pack. |
| public | view(
const view &) = default; | |
| public | view(
view &&) noexcept = default; |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~view() = default; |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | MATCH_ | static constexpr component_ | ~component_ | A with mask no archetype satisfies: the match set of a view over an unregistered type. |
| private | mIds | std:: | {} | |
| private | mQuery | query | — | |
| private | mValid | bool | true | |
| private | PACK_SIZE | static constexpr usize | sizeof...(Component |
Functions
Public
access
access[[nodiscard]] view_access access() const noexcept;The read and write sets derived from the pack.
changed
changedVisits only chunks whose column of OtherType was stamped after sinceVersion. Narrows this named view in place and returns it for chaining.
Visits only chunks whose column of OtherType was stamped after sinceVersion. Narrows this temporary view and returns it by value (a move), so binding the chain to a reference cannot dangle; discarding the result warns.
for_each
for_eachtemplate <typename Callable> void for_each(
Callable &&callable);Invokes callable(entity, ComponentTypes&...) for every matching entity (maybe<T> as T *).
for_each_chunk
for_each_chunktemplate <typename Callable> void for_each_chunk(
Callable &&callable);Invokes callable(chunk_view &) for every matching chunk.
is_valid
is_valid[[nodiscard]] bool is_valid() const noexcept;False once the pack or a builder call required a type the registry does not know; such a view matches nothing.
parallel_for_each_chunk
parallel_for_each_chunktemplate <typename Callable> void parallel_for_each_chunk(
system_context &context,
Callable &&callable);Runs callable(chunk_view &, command_buffer &) over the matching chunks through the system's job system, one command buffer per grain (system_context::parallel_for_chunks). Defined in system.h, which callers using it must include.
with
withtemplate <typename TagType> view &with() &;Requires a component (typically a tag) without reading it. Narrows this named view in place and returns it for chaining.
template <typename TagType> [[nodiscard]] view with() &&;Requires a component (typically a tag) without reading it. Narrows this temporary view and returns it by value (a move), so binding the chain to a reference cannot dangle; discarding the result warns.
without
withouttemplate <typename OtherType> view &without() &;Excludes entities holding a component. Narrows this named view in place and returns it for chaining.
template <typename OtherType> [[nodiscard]] view without() &&;Excludes entities holding a component. Narrows this temporary view and returns it by value (a move), so binding the chain to a reference cannot dangle; discarding the result warns.
Private
collect_access
collect_accesstemplate <typename PackType> void collect_access(
view_access &result,
usize &slot) const noexcept;exclude
excludetemplate <typename OtherType> void exclude();fill_slot
fill_slottemplate <typename PackType> void fill_slot(
const component_registry ®istry,
query_desc &desc,
usize &slot);filter_changed
filter_changedtemplate <typename OtherType> void filter_changed(
u64 sinceVersion);invoke_row
invoke_rowrequire
requiretemplate <typename TagType> void require();require_unregistered
require_unregisteredtemplate <typename OtherType> void require_unregistered();