Flecs: Singletons
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.1 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
Singletons
C API » Macro API » Type Safe API » Entity API
Collaboration diagram for Singletons:

## Macros
#define | ecs_singleton_add(world, comp)
#define | ecs_singleton_remove(world, comp)
#define | ecs_singleton_get(world, comp)
#define | ecs_singleton_get_mut(world, comp)
#define | ecs_singleton_set_ptr(world, comp, ptr)
#define | ecs_singleton_set(world, comp, ...)
#define | ecs_singleton_ensure(world, comp)
#define | ecs_singleton_emplace(world, comp, is_new)
#define | ecs_singleton_modified(world, comp)

## Detailed Description

## Macro Definition Documentation

## ◆ ecs_singleton_add

#define ecs_singleton_add | ( |  | world,
|  |  | comp )

Value:
ecs_add(world, ecs_id(comp), comp)
ecs_id
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component id for EcsDocDescription.

Definition at line 465 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)

Definition at line 486 of file flecs_c.h.

## ◆ ecs_singleton_ensure

#define ecs_singleton_ensure | ( |  | world,
|  |  | comp )

Value:
ecs_ensure(world, ecs_id(comp), comp)

Definition at line 483 of file flecs_c.h.

## ◆ ecs_singleton_get

#define ecs_singleton_get | ( |  | world,
|  |  | comp )

Value:
ecs_get(world, ecs_id(comp), comp)

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

Definition at line 474 of file flecs_c.h.

## ◆ ecs_singleton_modified

#define ecs_singleton_modified | ( |  | world,
|  |  | comp )

Value:
ecs_modified(world, ecs_id(comp), comp)

Definition at line 489 of file flecs_c.h.

## ◆ ecs_singleton_remove

#define ecs_singleton_remove | ( |  | world,
|  |  | comp )

Value:
ecs_remove(world, ecs_id(comp), comp)

Definition at line 468 of file flecs_c.h.

## ◆ ecs_singleton_set

#define ecs_singleton_set | ( |  | world,
|  |  | comp,
|  |  | ... )

Value:
ecs_set(world, ecs_id(comp), comp, __VA_ARGS__)

Definition at line 480 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)

Definition at line 477 of file flecs_c.h.