20 return flecs::id(m_iter->world, m_iter->event_id);
28 ecs_assert(row <
static_cast<size_t>(m_iter->count),
29 ECS_COLUMN_INDEX_OUT_OF_RANGE, NULL);
43 ecs_check(ECS_HAS_ID_FLAG(
id, PAIR), ECS_INVALID_PARAMETER, NULL);
59 m_iter->offset, m_iter->count);
62template <
typename T,
typename A,
63 typename std::enable_if<std::is_const<T>::value,
void>::type*>
65 ecs_assert(!(m_iter->flags & EcsIterCppEach), ECS_INVALID_OPERATION,
66 "cannot .field from .each, use .field_at<const %s>(%d, row) instead",
67 _::type_name<T>(), index);
68 return get_field<A>(index);
71template <
typename T,
typename A,
72 typename std::enable_if<
73 std::is_const<T>::value ==
false,
void>::type*>
75 ecs_assert(!(m_iter->flags & EcsIterCppEach), ECS_INVALID_OPERATION,
76 "cannot .field from .each, use .field_at<%s>(%d, row) instead",
77 _::type_name<T>(), index);
79 ECS_ACCESS_VIOLATION, NULL);
80 return get_field<A>(index);
85 ecs_assert(var_id != -1, ECS_INVALID_PARAMETER, 0);
93 ecs_rule_iter_t *rit = &m_iter->priv.iter.rule;
94 const flecs::rule_t *r = rit->rule;
96 ecs_assert(var_id != -1, ECS_INVALID_PARAMETER, name);
#define ecs_assert(condition, error_code,...)
Assert.
#define ecs_check(condition, error_code,...)
Check.
FLECS_API int32_t ecs_rule_find_var(const ecs_rule_t *rule, const char *name)
Find variable index.
ecs_id_t ecs_field_id(const ecs_iter_t *it, int32_t index)
Return id matched for field.
bool ecs_field_is_readonly(const ecs_iter_t *it, int32_t index)
Test whether the field is readonly.
ecs_entity_t ecs_iter_get_var(ecs_iter_t *it, int32_t var_id)
Get value of iterator variable as entity.
ecs_entity_t ecs_field_src(const ecs_iter_t *it, int32_t index)
Return field source.
const ecs_type_t * ecs_table_get_type(const ecs_table_t *table)
Get type for table.
Wrapper class around a field.
Class that wraps around a flecs::id_t.
flecs::id id(int32_t index) const
Obtain id matched for field.
flecs::entity src(int32_t index) const
Obtain field source (0 if This).
flecs::field< A > field(int32_t index) const
Get readonly access to field data.
flecs::entity entity(size_t row) const
Obtain mutable handle to entity being iterated over.
flecs::id pair(int32_t index) const
Obtain pair id matched for field.
flecs::entity get_var(int var_id) const
Get value of variable by id.