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
171 using row_iterator = _::range_iterator<size_t>;
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;
232 template <
typename T>
234 return static_cast<T*
>(m_iter->ctx);
241 return m_iter->param;
247 template <
typename T>
250 return static_cast<T*
>(m_iter->param);
263 bool is_self(int32_t index)
const {
271 bool is_set(int32_t index)
const {
279 bool is_readonly(int32_t index)
const {
285 int32_t field_count()
const {
286 return m_iter->field_count;
293 size_t size(int32_t index)
const {
320 int32_t column_index(int32_t index)
const {
339 template <
typename T,
typename A = actual_type_t<T>,
340 typename std::enable_if<std::is_const<T>::value,
void>::type* =
nullptr>
342 return get_field<A>(index);
353 template <
typename T,
typename A = actual_type_t<T>,
354 typename std::enable_if<
355 std::is_const<T>::value == false,
void>::type* =
nullptr>
358 ECS_ACCESS_VIOLATION, NULL);
359 return get_field<A>(index);
369 return get_unchecked_field(index);
381 int32_t table_count()
const {
382 return m_iter->table_count;
403 uint64_t group_id()
const {
404 return m_iter->group_id;
421 template <
typename T,
typename A = actual_type_t<T>>
427 term_id == _::cpp_type<T>::id(m_iter->world),
428 ECS_COLUMN_TYPE_MISMATCH, NULL);
442 count =
static_cast<size_t>(m_iter->count);
463 count =
static_cast<size_t>(m_iter->count);
470 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 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.
Unsafe wrapper class around a column.
void * operator[](size_t index) const
Return element in component array.
flecs::system_builder< Components... > system(Args &&... args) const
Create a new system.