81#define ECS_MEMBER_DESC_CACHE_SIZE (32)
161 EcsTypeKindLast = EcsOpaqueType
191 EcsPrimitiveKindLast = EcsId
328#if !defined(__cplusplus) || !defined(FLECS_CPP)
347#elif defined(__cplusplus)
368 template <
typename T>
372 int member(
const char *name)
const;
451 void* (*ensure_element)(
456 void* (*ensure_member)(
540 EcsMetaTypeOpKindLast = EcsOpId
569#define ECS_META_MAX_SCOPE_DEPTH (32)
1172#define ecs_primitive(world, ...)\
1173 ecs_primitive_init(world, &(ecs_primitive_desc_t) __VA_ARGS__ )
1176#define ecs_enum(world, ...)\
1177 ecs_enum_init(world, &(ecs_enum_desc_t) __VA_ARGS__ )
1180#define ecs_bitmask(world, ...)\
1181 ecs_bitmask_init(world, &(ecs_bitmask_desc_t) __VA_ARGS__ )
1184#define ecs_array(world, ...)\
1185 ecs_array_init(world, &(ecs_array_desc_t) __VA_ARGS__ )
1188#define ecs_vector(world, ...)\
1189 ecs_vector_init(world, &(ecs_vector_desc_t) __VA_ARGS__ )
1192#define ecs_opaque(world, ...)\
1193 ecs_opaque_init(world, &(ecs_opaque_desc_t) __VA_ARGS__ )
1196#define ecs_struct(world, ...)\
1197 ecs_struct_init(world, &(ecs_struct_desc_t) __VA_ARGS__ )
1200#define ecs_unit(world, ...)\
1201 ecs_unit_init(world, &(ecs_unit_desc_t) __VA_ARGS__ )
1204#define ecs_unit_prefix(world, ...)\
1205 ecs_unit_prefix_init(world, &(ecs_unit_prefix_desc_t) __VA_ARGS__ )
1208#define ecs_quantity(world, ...)\
1209 ecs_quantity_init(world, &(ecs_entity_desc_t) __VA_ARGS__ )
ecs_id_t ecs_entity_t
An entity identifier.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
uint64_t ecs_id_t
Ids are the things that can be added to an entity.
Component added to array type entities.
int32_t count
Number of elements.
ecs_entity_t type
Element type.
Component added to bitmask type entities.
ecs_map_t constants
map<u32_t, ecs_bitmask_constant_t>
Component added to enum type entities.
ecs_map_t constants
Populated from child entities with Constant component.
Component added to member entities to express valid value ranges.
ecs_member_value_range_t warning
Member value warning range.
ecs_member_value_range_t value
Member value range.
ecs_member_value_range_t error
Member value error range.
Component added to member entities.
ecs_entity_t unit
Member unit.
bool use_offset
If offset should be explicitly used.
ecs_entity_t type
Member type.
int32_t offset
Member offset.
int32_t count
Number of elements (for inline arrays).
Opaque type reflection data.
size_t(* count)(const void *dst)
Return number of elements.
void(* assign_null)(void *dst)
Assign null value.
void(* clear)(void *dst)
Clear collection elements.
void(* assign_uint)(void *dst, uint64_t value)
Assign unsigned int value.
ecs_meta_serialize_t serialize
Serialize action.
void(* assign_char)(void *dst, char value)
Assign char value.
ecs_entity_t as_type
Type that describes the serialized output.
void(* assign_bool)(void *dst, bool value)
Assign bool value.
void(* assign_string)(void *dst, const char *value)
Assign string value.
void(* resize)(void *dst, size_t count)
Resize to number of elements.
void(* assign_int)(void *dst, int64_t value)
Assign int value.
void(* assign_float)(void *dst, double value)
Assign float value.
void(* assign_entity)(void *dst, ecs_world_t *world, ecs_entity_t entity)
Assign entity value.
void(* assign_id)(void *dst, ecs_world_t *world, ecs_id_t id)
Assign (component) id value.
Component added to primitive types.
ecs_primitive_kind_t kind
Primitive type kind.
Component added to struct type entities.
ecs_vec_t members
Populated from child entities with Member component.
Component that stores the type serializer.
ecs_vec_t ops
vector<ecs_meta_type_op_t>
Component that is automatically added to every type with the right kind.
bool existing
Did the type exist or is it populated from reflection.
bool partial
Is the reflection data a partial type description.
ecs_type_kind_t kind
Type kind.
Component that stores unit prefix data.
ecs_unit_translation_t translation
Translation of prefix.
char * symbol
Symbol of prefix (e.g.
Component that stores unit data.
ecs_unit_translation_t translation
Translation for derived unit.
ecs_entity_t prefix
Order of magnitude prefix relative to derived.
char * symbol
Unit symbol.
ecs_entity_t base
Base unit (e.g.
ecs_entity_t over
Over unit (e.g.
Component added to vector type entities.
ecs_entity_t type
Element type.
Used with ecs_array_init().
ecs_entity_t entity
Existing entity to use for type (optional).
ecs_entity_t type
Element type.
int32_t count
Number of elements.
Type that describes an bitmask constant.
ecs_flags64_t value
May be set when used with ecs_bitmask_desc_t.
int64_t _unused
Keep layout the same with ecs_enum_constant_t.
ecs_entity_t constant
Should not be set by ecs_bitmask_desc_t.
const char * name
Must be set when used with ecs_bitmask_desc_t.
Used with ecs_bitmask_init().
ecs_bitmask_constant_t constants[(32)]
Bitmask constants.
ecs_entity_t entity
Existing entity to use for type (optional).
Used with ecs_entity_init().
Type that describes an enum constant.
ecs_entity_t constant
Should not be set by ecs_enum_desc_t.
uint64_t value_unsigned
For when the underlying type is unsigned.
int64_t value
May be set when used with ecs_enum_desc_t.
const char * name
Must be set when used with ecs_enum_desc_t.
Used with ecs_enum_init().
ecs_entity_t entity
Existing entity to use for type (optional).
ecs_enum_constant_t constants[(32)]
Enum constants.
Element type of members vector in EcsStruct.
ecs_member_value_range_t warning_range
Numerical range outside of which the value represents an warning.
const char * name
Must be set when used with ecs_struct_desc_t.
ecs_size_t size
Should not be set by ecs_struct_desc_t.
bool use_offset
Set to true to prevent automatic offset computation.
ecs_entity_t type
Member type.
ecs_entity_t member
Should not be set by ecs_struct_desc_t.
int32_t offset
May be set when used with ecs_struct_desc_t.
ecs_entity_t unit
May be set when used with ecs_struct_desc_t, will be auto-populated if type entity is also a unit.
ecs_member_value_range_t range
Numerical range that specifies which values member can assume.
int32_t count
Element count (for inline arrays).
ecs_member_value_range_t error_range
Numerical range outside of which the value represents an error.
Type expressing a range for a member value.
double min
Min member value.
double max
Max member value.
Used with ecs_opaque_init().
ecs_entity_t entity
Existing entity to use for type (optional).
EcsOpaque type
Type that the opaque type maps to.
Used with ecs_primitive_init().
ecs_entity_t entity
Existing entity to use for type (optional).
ecs_primitive_kind_t kind
Primitive type kind.
void * ctx
Serializer context.
int(* value)(const struct ecs_serializer_t *ser, ecs_entity_t type, const void *value)
Pointer to the value to serialize.
int(* member)(const struct ecs_serializer_t *ser, const char *member)
Member name.
const ecs_world_t * world
The world.
Used with ecs_struct_init().
ecs_member_t members[(32)]
Struct members.
ecs_entity_t entity
Existing entity to use for type (optional).
Used with ecs_unit_init().
ecs_entity_t base
Base unit, e.g.
ecs_entity_t over
Over unit, e.g.
const char * symbol
Unit symbol, e.g.
ecs_entity_t prefix
Prefix indicating order of magnitude relative to the derived unit.
ecs_entity_t quantity
Unit quantity, e.g.
ecs_unit_translation_t translation
Translation to apply to derived unit (optional).
ecs_entity_t entity
Existing entity to associate with unit (optional).
Used with ecs_unit_prefix_init().
ecs_entity_t entity
Existing entity to associate with unit prefix (optional).
const char * symbol
Unit symbol, e.g.
ecs_unit_translation_t translation
Translation to apply to derived unit (optional).
Helper type to describe translation between two units.
int32_t power
Power to apply to factor (e.g.
int32_t factor
Factor to apply (e.g.
Utility to hold a value of a dynamic type.
Used with ecs_vector_init().
ecs_entity_t entity
Existing entity to use for type (optional).
ecs_entity_t type
Element type.