37 return m_value != other.m_value;
40 T
const& operator*()
const
78 iter(ecs_iter_t *it) : m_iter(it) {
80 m_end =
static_cast<std::size_t
>(it->count);
83 row_iterator begin()
const {
84 return row_iterator(m_begin);
87 row_iterator end()
const {
88 return row_iterator(m_end);
99 const flecs::iter_t* c_ptr()
const {
103 size_t count()
const {
104 return static_cast<size_t>(m_iter->count);
108 return m_iter->delta_time;
112 return m_iter->delta_system_time;
131 template <
typename T>
133 return static_cast<T*
>(m_iter->ctx);
140 return m_iter->param;
146 template <
typename T>
149 return static_cast<T*
>(m_iter->param);
185 return m_iter->field_count;
192 size_t size(int32_t index)
const {
238 template <
typename T,
typename A = actual_type_t<T>,
239 typename std::enable_if<std::is_const<T>::value,
void>::type* =
nullptr>
250 template <
typename T,
typename A = actual_type_t<T>,
251 typename std::enable_if<
252 std::is_const<T>::value == false,
void>::type* =
nullptr>
262 ecs_assert(!(m_iter->flags & EcsIterCppEach), ECS_INVALID_OPERATION,
263 "cannot .field from .each, use .field_at(%d, row) instead", index);
264 return get_unchecked_field(index);
269 return get_unchecked_field(index)[row];
273 template <
typename T,
typename A = actual_type_t<T>,
274 typename std::enable_if<std::is_const<T>::value,
void>::type* =
nullptr>
275 const A&
field_at(int32_t index,
size_t row)
const {
276 return get_field<A>(index)[row];
280 template <
typename T,
typename A = actual_type_t<T>,
281 typename std::enable_if<
282 std::is_const<T>::value == false,
void>::type* =
nullptr>
285 ECS_ACCESS_VIOLATION, NULL);
286 return get_field<A>(index)[row];
299 return m_iter->table_count;
320 uint64_t group_id()
const {
321 return m_iter->group_id;
338 template <
typename T,
typename A = actual_type_t<T>>
344 term_id == _::cpp_type<T>::id(m_iter->world),
345 ECS_COLUMN_TYPE_MISMATCH, NULL);
359 count =
static_cast<size_t>(m_iter->count);
380 count =
static_cast<size_t>(m_iter->count);
387 flecs::iter_t *m_iter;
#define ecs_assert(condition, error_code,...)
Assert.
ecs_id_t ecs_entity_t
An entity identifier.
bool ecs_field_is_set(const ecs_iter_t *it, int32_t index)
Test whether field is set.
bool ecs_field_is_self(const ecs_iter_t *it, int32_t index)
Test whether the field is matched on self.
void * ecs_field_w_size(const ecs_iter_t *it, size_t size, int32_t index)
Obtain data for a query field.
size_t ecs_field_size(const ecs_iter_t *it, int32_t index)
Return field type size.
char * ecs_iter_str(const ecs_iter_t *it)
Convert iterator to string.
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.
int32_t ecs_field_column_index(const ecs_iter_t *it, int32_t index)
Return index of matched table column.
#define ecs_ftime_t
Customizable precision for scalar time values.
void ecs_query_skip(ecs_iter_t *it)
Skip a table while iterating.
bool ecs_query_changed(ecs_query_t *query, const ecs_iter_t *it)
Returns whether the query data changed since the last iteration.
Iterate over an integer range (used to iterate over entity range).
Wrapper class around a field.
Class that wraps around a flecs::id_t.
Class for iterating over query results.
flecs::id id(int32_t index) const
Obtain id matched for field.
int32_t table_count() const
Obtain the total number of tables the iterator will iterate over.
flecs::string str() const
Convert current iterator result to string.
int32_t field_count() const
Number of fields in iterator.
void * param()
Access param.
bool changed()
Check if the current table has changed since the last iteration.
const A & field_at(int32_t index, size_t row) const
Get reference to field at row.
A & field_at(int32_t index, size_t row) const
Get reference to field at row.
flecs::entity src(int32_t index) const
Obtain field source (0 if This).
void * field_at(int32_t index, size_t row) const
Get pointer to field at row.
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.
size_t size(int32_t index) const
Size of field data type.
flecs::id pair(int32_t index) const
Obtain pair id matched for field.
flecs::untyped_field field(int32_t index) const
Get unchecked access to field data.
flecs::entity get_var(int var_id) const
Get value of variable by id.
flecs::field< const flecs::entity_t > entities() const
Get readonly access to entity ids.
int32_t column_index(int32_t index) const
Obtain column index for field.
bool is_set(int32_t index) const
Returns whether field is set.
iter(ecs_iter_t *it)
Construct iterator from C iterator object.
bool is_self(int32_t index) const
Returns whether field is matched on self.
bool is_readonly(int32_t index) const
Returns whether field is readonly.
void skip()
Skip current table.
Unsafe wrapper class around a field.