Skip to content
Flecs v4.1

Macros

#define ecs_singleton_add(world, comp)
 Add a singleton component.
#define ecs_singleton_remove(world, comp)
 Remove a singleton component.
#define ecs_singleton_get(world, comp)
 Get a singleton component.
#define ecs_singleton_get_mut(world, comp)
 Get a mutable pointer to a singleton component.
#define ecs_singleton_set_ptr(world, comp, ptr)
 Set a singleton component using a pointer.
#define ecs_singleton_set(world, comp, ...)
 Set a singleton component value.
#define ecs_singleton_ensure(world, comp)
 Ensure a singleton component, return mutable pointer.
#define ecs_singleton_emplace(world, comp, is_new)
 Emplace a singleton component.
#define ecs_singleton_modified(world, comp)
 Signal that a singleton component has been modified.
#define ecs_singleton_has(world, comp)
 Test if world has a singleton component.
#define ecs_singleton_add_pair(world, rel, tgt)
 Add a singleton pair component.
#define ecs_singleton_remove_pair(world, rel, tgt)
 Remove a singleton pair component.
#define ecs_singleton_get_pair(world, rel, tgt)
 Get a singleton pair component.
#define ecs_singleton_get_mut_pair(world, rel, tgt)
 Get a mutable pointer to a singleton pair component.
#define ecs_singleton_set_pair(world, rel, tgt, ...)
 Set a singleton pair component value.
#define ecs_singleton_ensure_pair(world, rel, tgt)
 Ensure a singleton pair component, return mutable pointer.
#define ecs_singleton_emplace_pair(world, rel, tgt, is_new)
 Emplace a singleton pair component.
#define ecs_singleton_modified_pair(world, rel, tgt)
 Signal that a singleton pair component has been modified.
#define ecs_singleton_has_pair(world, rel, tgt)
 Test if world has a singleton pair component.

Detailed Description

Macro Definition Documentation

◆ ecs_singleton_add

#define ecs_singleton_add ( world,
comp )
Value:
ecs_add(world, ecs_id(comp), comp)
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.
#define ecs_add(world, entity, T)
Add a component to an entity.
Definition flecs_c.h:271

Add a singleton component.

Definition at line 440 of file flecs_c.h.

◆ ecs_singleton_add_pair

#define ecs_singleton_add_pair ( world,
rel,
tgt )
Value:
ecs_add_id(world, ecs_id(rel), ecs_pair_t(rel, tgt))
void ecs_add_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Add a (component) ID to an entity.

Add a singleton pair component.

Definition at line 480 of file flecs_c.h.

◆ ecs_singleton_emplace

#define ecs_singleton_emplace ( world,
comp,
is_new )
Value:
ecs_emplace(world, ecs_id(comp), comp, is_new)
#define ecs_emplace(world, entity, T, is_new)
Emplace a component.
Definition flecs_c.h:331

Emplace a singleton component.

Definition at line 468 of file flecs_c.h.

◆ ecs_singleton_emplace_pair

#define ecs_singleton_emplace_pair ( world,
rel,
tgt,
is_new )
Value:
ecs_emplace_pair(world, ecs_id(rel), rel, tgt, is_new)
#define ecs_emplace_pair(world, entity, First, second, is_new)
Emplace the first element of a pair.
Definition flecs_c.h:335

Emplace a singleton pair component.

Definition at line 504 of file flecs_c.h.

◆ ecs_singleton_ensure

#define ecs_singleton_ensure ( world,
comp )
Value:
ecs_ensure(world, ecs_id(comp), comp)
#define ecs_ensure(world, entity, T)
Ensure entity has a component, return mutable pointer.
Definition flecs_c.h:371

Ensure a singleton component, return mutable pointer.

Definition at line 464 of file flecs_c.h.

◆ ecs_singleton_ensure_pair

#define ecs_singleton_ensure_pair ( world,
rel,
tgt )
Value:
ecs_ensure_pair(world, ecs_id(rel), rel, tgt)
#define ecs_ensure_pair(world, subject, First, second)
Ensure entity has the first element of a pair, return mutable pointer.
Definition flecs_c.h:375

Ensure a singleton pair component, return mutable pointer.

Definition at line 500 of file flecs_c.h.

◆ ecs_singleton_get

#define ecs_singleton_get ( world,
comp )
Value:
ecs_get(world, ecs_id(comp), comp)
#define ecs_get(world, entity, T)
Get a component.
Definition flecs_c.h:339

Get a singleton component.

Definition at line 448 of file flecs_c.h.

◆ ecs_singleton_get_mut

#define ecs_singleton_get_mut ( world,
comp )
Value:
ecs_get_mut(world, ecs_id(comp), comp)
#define ecs_get_mut(world, entity, T)
Get a mutable pointer to a component.
Definition flecs_c.h:353

Get a mutable pointer to a singleton component.

Definition at line 452 of file flecs_c.h.

◆ ecs_singleton_get_mut_pair

#define ecs_singleton_get_mut_pair ( world,
rel,
tgt )
Value:
ecs_get_mut_pair(world, ecs_id(rel), rel, tgt)
#define ecs_get_mut_pair(world, subject, First, second)
Get a mutable pointer to the first element of a pair.
Definition flecs_c.h:357

Get a mutable pointer to a singleton pair component.

Definition at line 492 of file flecs_c.h.

◆ ecs_singleton_get_pair

#define ecs_singleton_get_pair ( world,
rel,
tgt )
Value:
ecs_get_pair(world, ecs_id(rel), rel, tgt)
#define ecs_get_pair(world, subject, First, second)
Get the first element of a pair.
Definition flecs_c.h:343

Get a singleton pair component.

Definition at line 488 of file flecs_c.h.

◆ ecs_singleton_has

#define ecs_singleton_has ( world,
comp )
Value:
ecs_has(world, ecs_id(comp), comp)
#define ecs_has(world, entity, T)
Test if an entity has a component.
Definition flecs_c.h:523

Test if world has a singleton component.

Definition at line 476 of file flecs_c.h.

◆ ecs_singleton_has_pair

#define ecs_singleton_has_pair ( world,
rel,
tgt )
Value:
ecs_has_id(world, ecs_id(rel), ecs_pair_t(rel, tgt))
bool ecs_has_id(const ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Test if an entity has a component.

Test if world has a singleton pair component.

Definition at line 512 of file flecs_c.h.

◆ ecs_singleton_modified

#define ecs_singleton_modified ( world,
comp )
Value:
ecs_modified(world, ecs_id(comp), comp)
#define ecs_modified(world, entity, component)
Signal that a component has been modified.
Definition flecs_c.h:385

Signal that a singleton component has been modified.

Definition at line 472 of file flecs_c.h.

◆ ecs_singleton_modified_pair

#define ecs_singleton_modified_pair ( world,
rel,
tgt )
Value:
ecs_modified_id(world, ecs_id(rel), ecs_pair_t(rel, tgt))
void ecs_modified_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Signal that a component has been modified.

Signal that a singleton pair component has been modified.

Definition at line 508 of file flecs_c.h.

◆ ecs_singleton_remove

#define ecs_singleton_remove ( world,
comp )
Value:
ecs_remove(world, ecs_id(comp), comp)
#define ecs_remove(world, entity, T)
Remove a component from an entity.
Definition flecs_c.h:279

Remove a singleton component.

Definition at line 444 of file flecs_c.h.

◆ ecs_singleton_remove_pair

#define ecs_singleton_remove_pair ( world,
rel,
tgt )
Value:
ecs_remove_id(world, ecs_id(rel), ecs_pair_t(rel, tgt))
void ecs_remove_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component)
Remove a component from an entity.

Remove a singleton pair component.

Definition at line 484 of file flecs_c.h.

◆ ecs_singleton_set

#define ecs_singleton_set ( world,
comp,
... )
Value:
ecs_set(world, ecs_id(comp), comp, __VA_ARGS__)
#define ecs_set(world, entity, component,...)
Set a component value.
Definition flecs_c.h:310

Set a singleton component value.

Definition at line 460 of file flecs_c.h.

◆ ecs_singleton_set_pair

#define ecs_singleton_set_pair ( world,
rel,
tgt,
... )
Value:
ecs_set_pair(world, ecs_id(rel), rel, tgt, __VA_ARGS__)
#define ecs_set_pair(world, subject, First, second,...)
Set the first element of a pair.
Definition flecs_c.h:314

Set a singleton pair component value.

Definition at line 496 of file flecs_c.h.

◆ ecs_singleton_set_ptr

#define ecs_singleton_set_ptr ( world,
comp,
ptr )
Value:
ecs_set_ptr(world, ecs_id(comp), comp, ptr)
#define ecs_set_ptr(world, entity, component, ptr)
Set a component using a pointer.
Definition flecs_c.h:306

Set a singleton component using a pointer.

Definition at line 456 of file flecs_c.h.