Function ecs_iter_column_w_size


#include <include/flecs.h>

FLECS_API void * ecs_iter_column_w_size(const ecs_iter_t *it, size_t size, int32_t index)


Obtain data for a column index. This operation can be used with the id obtained from ecs_iter_find_column to request data from the currently iterated over entity/entities that is not requested by the query.

The data in the returned pointer can be accessed using the same index as the one used to access the arrays returned by the ecs_field function.

The provided size must be either 0 or must match the size of the datatype of the returned array. If the size does not match, the operation may assert. The size can be dynamically obtained with ecs_iter_column_size.

Note that this function can be used together with iter::type to dynamically iterate all data that the matched entities have. An application can use the ecs_vector_count function to obtain the number of elements in a type. All indices from 0..type->count are valid column indices.

Additionally, note that this provides unprotected access to the column data. An iterator cannot know or prevent accessing columns that are not queried for and thus applications should only use this when it can be guaranteed that there are no other threads reading/writing the same column data.


it - The iterator.

size - The size of the column.

index - The index of the column.

The data belonging to the column.


Line 4118 in include/flecs.h.