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:274

Add a singleton component.

Definition at line 411 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 451 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:334

Emplace a singleton component.

Definition at line 439 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:338

Emplace a singleton pair component.

Definition at line 475 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:374

Ensure a singleton component, return mutable pointer.

Definition at line 435 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:378

Ensure a singleton pair component, return mutable pointer.

Definition at line 471 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:342

Get a singleton component.

Definition at line 419 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:356

Get a mutable pointer to a singleton component.

Definition at line 423 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:360

Get a mutable pointer to a singleton pair component.

Definition at line 463 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:346

Get a singleton pair component.

Definition at line 459 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:494

Test if world has a singleton component.

Definition at line 447 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 483 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:388

Signal that a singleton component has been modified.

Definition at line 443 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 479 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:282

Remove a singleton component.

Definition at line 415 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 455 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:313

Set a singleton component value.

Definition at line 431 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:317

Set a singleton pair component value.

Definition at line 467 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:309

Set a singleton component using a pointer.

Definition at line 427 of file flecs_c.h.