Flecs: Value API
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
Value API
C API » Macro API » Type-Safe API
Collaboration diagram for Value API:

## Macros
#define | ecs_ids(...)
| Convenience macro for creating a compound literal ID array.
#define | ecs_values(...)
| Convenience macro for creating a compound literal values array.
#define | ecs_value_ptr(T, ptr)
| Convenience macro for creating a compound literal value.
#define | ecs_pair_value(R, t, ...)
| Convenience macro for creating a compound literal pair value.
#define | ecs_pair_value_2nd(r, T, ...)
| Convenience macro for creating a compound literal pair value.
#define | ecs_value_new_t(world, T)
| Convenience macro for creating a heap-allocated value.
#define | ecs_value(T, ...)
| Convenience macro for creating a compound literal value literal.

## Detailed Description

## Macro Definition Documentation

## ◆ ecs_ids

#define ecs_ids | ( |  | ... | ) |

Value:
(ecs_id_t[]){ __VA_ARGS__, 0 }
ecs_id_t
uint64_t ecs_id_t
IDs are the things that can be added to an entity.
Definition flecs.h:374

Convenience macro for creating a compound literal ID array.

Definition at line 765 of file flecs_c.h.

## ◆ ecs_pair_value

#define ecs_pair_value | ( |  | R,
|  |  | t,
|  |  | ... )

Value:
((ecs_value_t){ecs_pair_t(R, t), &(R)__VA_ARGS__})
ecs_value_t
Utility to hold a value of a dynamic type.
Definition flecs.h:1033

Convenience macro for creating a compound literal pair value.

Definition at line 774 of file flecs_c.h.

## ◆ ecs_pair_value_2nd

#define ecs_pair_value_2nd | ( |  | r,
|  |  | T,
|  |  | ... )

Value:
((ecs_value_t){ecs_pair(r, ecs_id(T)), &(T)__VA_ARGS__})
ecs_id
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.

Convenience macro for creating a compound literal pair value.

Definition at line 777 of file flecs_c.h.

## ◆ ecs_value

#define ecs_value | ( |  | T,
|  |  | ... )

Value:
((ecs_value_t){ecs_id(T), &(T)__VA_ARGS__})

Convenience macro for creating a compound literal value literal.

Definition at line 783 of file flecs_c.h.

## ◆ ecs_value_new_t

#define ecs_value_new_t | ( |  | world,
|  |  | T )

Value:
ecs_value_new(world, ecs_id(T))
ecs_value_new
void * ecs_value_new(ecs_world_t *world, ecs_entity_t type)
Construct a value in new storage.

Convenience macro for creating a heap-allocated value.

Definition at line 780 of file flecs_c.h.

## ◆ ecs_value_ptr

#define ecs_value_ptr | ( |  | T,
|  |  | ptr )

Value:
((ecs_value_t){ecs_id(T), ptr})

Convenience macro for creating a compound literal value.

Definition at line 771 of file flecs_c.h.

## ◆ ecs_values

#define ecs_values | ( |  | ... | ) |

Value:
(ecs_value_t[]){ __VA_ARGS__, {0, 0}}

Convenience macro for creating a compound literal values array.

Definition at line 768 of file flecs_c.h.