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

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

Loading...
Searching...
No Matches
Macros
Value API
C API » Macro API » Type Safe API
Collaboration diagram for Value API:

## Macros
#define | ecs_ids(...)
| Convenience macro for creating compound literal id array.
#define | ecs_values(...)
| Convenience macro for creating compound literal values array.
#define | ecs_value_ptr(T, ptr)
| Convenience macro for creating compound literal value.
#define | ecs_value_pair(R, t, ...)
| Convenience macro for creating compound literal pair value.
#define | ecs_value_pair_2nd(r, T, ...)
| Convenience macro for creating compound literal pair value.
#define | ecs_value_new_t(world, T)
| Convenience macro for creating heap allocated value.
#define | ecs_value(T, ...)
| Convenience macro for creating 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:340

Convenience macro for creating compound literal id array.

Definition at line 720 of file flecs_c.h.

## ◆ ecs_value

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

Value:
((ecs_value_t){ecs_id(T), &(T)__VA_ARGS__})
ecs_value_t
struct ecs_value_t ecs_value_t
Utility to hold a value of a dynamic type.
ecs_id
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component id for EcsDocDescription.

Convenience macro for creating compound literal value literal.

Definition at line 738 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 heap allocated value.

Definition at line 735 of file flecs_c.h.

## ◆ ecs_value_pair

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

Value:
((ecs_value_t){ecs_pair_t(R, t), &(R)__VA_ARGS__})

Convenience macro for creating compound literal pair value.

Definition at line 729 of file flecs_c.h.

## ◆ ecs_value_pair_2nd

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

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

Convenience macro for creating compound literal pair value.

Definition at line 732 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 compound literal value.

Definition at line 726 of file flecs_c.h.

## ◆ ecs_values

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

Value:
(ecs_value_t[]){ __VA_ARGS__, {0, 0}}
ecs_value_t
Utility to hold a value of a dynamic type.
Definition flecs.h:929

Convenience macro for creating compound literal values array.

Definition at line 723 of file flecs_c.h.