Function ecs_iter_column_w_size

Synopsis

#include <include/flecs.h>

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

Description

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_term 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..ecs_vector_count(type) 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.

Parameters

it - The iterator.

size - The size of the column.

index - The index of the column.

Returns
The data belonging to the column.

Source

Line 3024 in include/flecs.h.