23 return flecs::id(iter_->stage, iter_->event_id);
37 ecs_assert(row <
static_cast<size_t>(iter_->count),
79 iter_->offset, iter_->count);
83template <
typename T,
typename A, if_t< is_const_v<T> >>
87 "cannot .field from .each, use .field_at<%s>(%d, row) instead",
88 _::type_name<T>(), index);
89 return get_field<A>(index);
93template <
typename T,
typename A, if_not_t< is_const_v<T> >>
97 "cannot .field from .each, use .field_at<%s>(%d, row) instead",
98 _::type_name<T>(), index);
101 return get_field<A>(index);
105template <
typename T,
typename A, if_t< is_const_v<T> >>
107 ecs_assert(!(iter_->flags & EcsIterCppEach) ||
109 "cannot .base_field from .each, use .field_at<%s>(%d, row) instead",
110 _::type_name<T>(), index);
111 return get_base_field<A>(index);
115template <
typename T,
typename A, if_not_t< is_const_v<T> >>
119 "cannot .base_field from .each, use .field_at<%s>(%d, row) instead",
120 _::type_name<T>(), index);
123 return get_base_field<A>(index);
126#ifdef FLECS_QUERY_PLANS
146template <
typename Func>
153 int32_t i = tr->index,
end = i + tr->count;
154 for (; i <
end; i ++) {
157 "field does not match a pair");
159 ecs_pair_second(iter_->world,
id));
#define ecs_assert(condition, error_code,...)
Assert.
#define ECS_ACCESS_VIOLATION
Access violation error code.
#define ECS_INVALID_OPERATION
Invalid operation error code.
#define ECS_INVALID_PARAMETER
Invalid parameter error code.
#define ECS_COLUMN_INDEX_OUT_OF_RANGE
Column index out of range error code.
#define ecs_check(condition, error_code,...)
Check.
struct ecs_table_record_t ecs_table_record_t
Opaque type for table record.
uint64_t ecs_id_t
IDs are the things that can be added to an entity.
ecs_query_t query_t
Query type.
ecs_entity_t ecs_field_src(const ecs_iter_t *it, int8_t index)
Return the field source.
bool ecs_field_is_readonly(const ecs_iter_t *it, int8_t index)
Test whether the field is read-only.
ecs_id_t ecs_field_id(const ecs_iter_t *it, int8_t index)
Return the ID matched for a field.
bool ecs_field_is_set(const ecs_iter_t *it, int8_t index)
Test whether a field is set.
ecs_entity_t ecs_iter_get_var(ecs_iter_t *it, int32_t var_id)
Get the value of an iterator variable as an entity.
int32_t ecs_query_find_var(const ecs_query_t *query, const char *name)
Find a variable index.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get the type for a table.
ecs_flags32_t flags
Iterator flags.
A type is a list of (component) IDs.
ecs_id_t * array
Array with IDs.
Wrapper class around a field matched through component inheritance.
Wrapper class around a field.
Class that wraps around a flecs::id_t.
flecs::id id(int8_t index) const
Obtain the ID matched for the field.
flecs::field< A > field(int8_t index) const
Get read-only access to field data.
flecs::entity event() const
Get the event entity associated with the iterator.
flecs::table table() const
Get the table for the current iterator result.
flecs::type type() const
Get the type of the iterated table.
int32_t field_count() const
Number of fields in the iterator.
row_iterator end() const
Get an iterator to the end of the entity range.
flecs::base_field< A > base_field(int8_t index) const
Get access to a field matched through component inheritance.
flecs::table other_table() const
Get the other table for the current iterator result.
flecs::entity entity(size_t row) const
Obtain a mutable handle to the entity being iterated over.
flecs::id pair(int8_t index) const
Obtain the pair ID matched for the field.
flecs::id event_id() const
Get the event ID associated with the iterator.
flecs::entity get_var(int var_id) const
Get value of variable by ID.
flecs::table_range range() const
Get the table range for the current iterator result.
void targets(int8_t index, const Func &func)
Iterate targets for pair field.
flecs::entity src(int8_t index) const
Obtain the field source (0 if This).
flecs::world world() const
Get the world associated with the iterator.
flecs::entity system() const
Get the system entity associated with the iterator.