30 , m_is_shared(is_shared) {}
39 ecs_assert(index < m_count, ECS_COLUMN_INDEX_OUT_OF_RANGE, NULL);
40 ecs_assert(!m_is_shared, ECS_INVALID_PARAMETER, NULL);
41 return ECS_OFFSET(m_array, m_size * index);
59 static_assert(std::is_empty<T>::value ==
false,
60 "invalid type for column, cannot iterate empty type");
71 , m_is_shared(is_shared) {}
87 ecs_assert(index < m_count, ECS_COLUMN_INDEX_OUT_OF_RANGE, NULL);
88 ecs_assert(!index || !m_is_shared, ECS_INVALID_PARAMETER, NULL);
89 ecs_assert(m_array !=
nullptr, ECS_COLUMN_INDEX_OUT_OF_RANGE, NULL);
90 return m_array[index];
99 ecs_assert(m_array !=
nullptr, ECS_COLUMN_INDEX_OUT_OF_RANGE, NULL);
109 ecs_assert(m_array !=
nullptr, ECS_COLUMN_INDEX_OUT_OF_RANGE, NULL);
138 return m_value != other.m_value;
141 T
const& operator*()
const
179 iter(ecs_iter_t *it) : m_iter(it) {
181 m_end =
static_cast<std::size_t
>(it->count);
184 row_iterator begin()
const {
185 return row_iterator(m_begin);
188 row_iterator end()
const {
189 return row_iterator(m_end);
200 const flecs::iter_t* c_ptr()
const {
204 size_t count()
const {
205 return static_cast<size_t>(m_iter->count);
209 return m_iter->delta_time;
213 return m_iter->delta_system_time;
237 template <
typename T>
239 return static_cast<T*
>(m_iter->ctx);
246 return m_iter->param;
252 template <
typename T>
255 return static_cast<T*
>(m_iter->param);
291 return m_iter->field_count;
298 size_t size(int32_t index)
const {
336 template <
typename T,
typename A = actual_type_t<T>,
337 typename std::enable_if<std::is_const<T>::value,
void>::type* =
nullptr>
339 return get_field<A>(index);
350 template <
typename T,
typename A = actual_type_t<T>,
351 typename std::enable_if<
352 std::is_const<T>::value == false,
void>::type* =
nullptr>
355 ECS_ACCESS_VIOLATION, NULL);
356 return get_field<A>(index);
366 return get_unchecked_field(index);
371 return m_iter->table_count;
392 uint64_t group_id()
const {
393 return m_iter->group_id;
410 template <
typename T,
typename A = actual_type_t<T>>
416 term_id == _::cpp_type<T>::id(m_iter->world),
417 ECS_COLUMN_TYPE_MISMATCH, NULL);
431 count =
static_cast<size_t>(m_iter->count);
452 count =
static_cast<size_t>(m_iter->count);
459 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.
#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.
bool ecs_table_has_module(ecs_table_t *table)
Returns whether table is a module or contains module contents Returns true for tables that have modul...
Iterate over an integer range (used to iterate over entity range).
Wrapper class around a column.
T & operator[](size_t index) const
Return element in component array.
T * operator->() const
Return first element of component array.
column(T *array, size_t count, bool is_shared=false)
Create column from component array.
T & operator*() const
Return first element of component array.
column(iter &iter, int column)
Create column from iterator.
Class that wraps around a flecs::id_t.
Class for iterating over query results.
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 iteator.
void * param()
Access param.
bool changed()
Check if the current table has changed since the last iteration.
flecs::untyped_column field(int32_t index) const
Get unchecked access to field data.
flecs::entity src(int32_t index) const
Obtain field source (0 if This).
size_t size(int32_t index) const
Size of field data type.
flecs::entity get_var(int var_id) const
Get value of variable by id.
bool has_module() const
Is current type a module or does it contain module contents?
bool is_set(int32_t index) const
Returns whether field is set.
iter(ecs_iter_t *it)
Construct iterator from C iterator object.
flecs::column< A > field(int32_t index) const
Get readonly access to field data.
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.
Type that represents a pair.
Unsafe wrapper class around a column.
void * operator[](size_t index) const
Return element in component array.