Function ecs_read_begin

Synopsis

#include <include/flecs.h>

FLECS_API const ecs_record_t * ecs_read_begin(ecs_world_t *world, ecs_entity_t entity)

Description

Begin read access to entity. This operation provides safe read access to the components of an entity. Multiple simultaneous reads are allowed per entity.

This operation ensures that code attempting to mutate the entity's table will throw an assert. Note that for this to happen, asserts must be enabled. It is up to the application to ensure that this does not happen, for example by using a read-write mutex.

This operation does not provide the same guarantees as a read-write mutex, as it is possible to call ecs_read_begin after calling ecs_write_begin. It is up to application has to ensure that this does not happen.

This operation must be followed up with ecs_read_end.

Parameters

world - The world.

entity - The entity.

Returns
A record to the entity.

Source

Line 2013 in include/flecs.h.