39 "cannot create ref to empty type");
69 if (!world_ || !ref_.entity) {
95 T* result =
static_cast<T*
>(get());
97 ecs_assert(result != NULL, ECS_INVALID_PARAMETER,
98 "nullptr dereference by flecs::ref");
104 return static_cast<T*
>(untyped_ref::get());
108 return static_cast<T*
>(untyped_ref::try_get());
#define ecs_assert(condition, error_code,...)
Assert.
const ecs_type_info_t * ecs_get_type_info(const ecs_world_t *world, ecs_id_t id)
Get the type for an id.
ecs_ref_t ecs_ref_init_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)
Create a component ref.
void * ecs_ref_get_id(const ecs_world_t *world, ecs_ref_t *ref, ecs_id_t id)
Get component from ref.
ecs_entity_t ecs_get_typeid(const ecs_world_t *world, ecs_id_t id)
Get the type for an id.
const ecs_world_t * ecs_get_world(const ecs_poly_t *poly)
Get world from poly.
Type that contains component information (passed to ctors/dtors/...)
ecs_size_t size
Size of type.
Class that wraps around a flecs::id_t.
Untyped component reference.
flecs::id component() const
Return component associated with reference.
flecs::entity entity() const
Return entity associated with reference.