Flecs: include/flecs/addons/meta.h Source File
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
meta.h
Go to the documentation of this file.
1
57#ifdef FLECS_META
58
67#include <stddef.h>
68
69#ifndef FLECS_MODULE
70#define FLECS_MODULE
71#endif
72
73#ifndef FLECS_META_H
74#define FLECS_META_H
75
76#ifdef __cplusplus
77extern "C" {
78#endif
79
81#define ECS_MEMBER_DESC_CACHE_SIZE (32)
82
97 typedef bool ecs_bool_t;
98 typedef char ecs_char_t;
99 typedef unsigned char ecs_byte_t;
100 typedef uint8_t ecs_u8_t;
101 typedef uint16_t ecs_u16_t;
102 typedef uint32_t ecs_u32_t;
103 typedef uint64_t ecs_u64_t;
104 typedef uintptr_t ecs_uptr_t;
105 typedef int8_t ecs_i8_t;
106 typedef int16_t ecs_i16_t;
107 typedef int32_t ecs_i32_t;
108 typedef int64_t ecs_i64_t;
109 typedef intptr_t ecs_iptr_t;
110 typedef float ecs_f32_t;
111 typedef double ecs_f64_t;
112 typedef char* ecs_string_t;
114/* Meta module component ids */
115FLECS_API extern const ecs_entity_t ecs_id(EcsType);
116FLECS_API extern const ecs_entity_t ecs_id(EcsTypeSerializer);
117FLECS_API extern const ecs_entity_t ecs_id(EcsPrimitive);
118FLECS_API extern const ecs_entity_t ecs_id(EcsEnum);
119FLECS_API extern const ecs_entity_t ecs_id(EcsBitmask);
120FLECS_API extern const ecs_entity_t ecs_id(EcsMember);
121FLECS_API extern const ecs_entity_t ecs_id(EcsMemberRanges);
122FLECS_API extern const ecs_entity_t ecs_id(EcsStruct);
123FLECS_API extern const ecs_entity_t ecs_id(EcsArray);
124FLECS_API extern const ecs_entity_t ecs_id(EcsVector);
125FLECS_API extern const ecs_entity_t ecs_id(EcsOpaque);
126FLECS_API extern const ecs_entity_t ecs_id(EcsUnit);
127FLECS_API extern const ecs_entity_t ecs_id(EcsUnitPrefix);
128FLECS_API extern const ecs_entity_t EcsConstant;
129FLECS_API extern const ecs_entity_t EcsQuantity;
131/* Primitive type component ids */
132
133FLECS_API extern const ecs_entity_t ecs_id(ecs_bool_t);
134FLECS_API extern const ecs_entity_t ecs_id(ecs_char_t);
135FLECS_API extern const ecs_entity_t ecs_id(ecs_byte_t);
136FLECS_API extern const ecs_entity_t ecs_id(ecs_u8_t);
137FLECS_API extern const ecs_entity_t ecs_id(ecs_u16_t);
138FLECS_API extern const ecs_entity_t ecs_id(ecs_u32_t);
139FLECS_API extern const ecs_entity_t ecs_id(ecs_u64_t);
140FLECS_API extern const ecs_entity_t ecs_id(ecs_uptr_t);
141FLECS_API extern const ecs_entity_t ecs_id(ecs_i8_t);
142FLECS_API extern const ecs_entity_t ecs_id(ecs_i16_t);
143FLECS_API extern const ecs_entity_t ecs_id(ecs_i32_t);
144FLECS_API extern const ecs_entity_t ecs_id(ecs_i64_t);
145FLECS_API extern const ecs_entity_t ecs_id(ecs_iptr_t);
146FLECS_API extern const ecs_entity_t ecs_id(ecs_f32_t);
147FLECS_API extern const ecs_entity_t ecs_id(ecs_f64_t);
148FLECS_API extern const ecs_entity_t ecs_id(ecs_string_t);
149FLECS_API extern const ecs_entity_t ecs_id(ecs_entity_t);
150FLECS_API extern const ecs_entity_t ecs_id(ecs_id_t);
153 typedef enum ecs_type_kind_t {
154 EcsPrimitiveType,
155 EcsBitmaskType,
156 EcsEnumType,
157 EcsStructType,
158 EcsArrayType,
159 EcsVectorType,
160 EcsOpaqueType,
161 EcsTypeKindLast = EcsOpaqueType
162} ecs_type_kind_t;
163
165 typedef struct EcsType {
166 ecs_type_kind_t kind;
167 bool existing;
168 bool partial;
169} EcsType;
170
172 typedef enum ecs_primitive_kind_t {
173 EcsBool = 1,
174 EcsChar,
175 EcsByte,
176 EcsU8,
177 EcsU16,
178 EcsU32,
179 EcsU64,
180 EcsI8,
181 EcsI16,
182 EcsI32,
183 EcsI64,
184 EcsF32,
185 EcsF64,
186 EcsUPtr,
187 EcsIPtr,
188 EcsString,
189 EcsEntity,
190 EcsId,
191 EcsPrimitiveKindLast = EcsId
192} ecs_primitive_kind_t;
193
195 typedef struct EcsPrimitive {
196 ecs_primitive_kind_t kind;
197} EcsPrimitive;
198
200 typedef struct EcsMember {
201 ecs_entity_t type;
202 int32_t count;
203 ecs_entity_t unit;
204 int32_t offset;
205 bool use_offset;
206} EcsMember;
207
209 typedef struct ecs_member_value_range_t {
210 double min;
211 double max;
212} ecs_member_value_range_t;
213
215 typedef struct EcsMemberRanges {
216 ecs_member_value_range_t value;
217 ecs_member_value_range_t warning;
218 ecs_member_value_range_t error;
219} EcsMemberRanges;
220
222 typedef struct ecs_member_t {
224 const char *name;
225
227 ecs_entity_t type;
228
230 int32_t count;
231
233 int32_t offset;
234
237 ecs_entity_t unit;
238
242 bool use_offset;
243
247 ecs_member_value_range_t range;
248
251 ecs_member_value_range_t error_range;
252
255 ecs_member_value_range_t warning_range;
256
258 ecs_size_t size;
259
261 ecs_entity_t member;
262} ecs_member_t;
263
265 typedef struct EcsStruct {
267 ecs_vec_t members; /* vector<ecs_member_t> */
268} EcsStruct;
269
271 typedef struct ecs_enum_constant_t {
273 const char *name;
274
276 int32_t value;
277
279 ecs_entity_t constant;
280} ecs_enum_constant_t;
281
283 typedef struct EcsEnum {
285 ecs_map_t constants;
286} EcsEnum;
287
289 typedef struct ecs_bitmask_constant_t {
291 const char *name;
292
294 ecs_flags32_t value;
295
297 ecs_entity_t constant;
298} ecs_bitmask_constant_t;
299
301 typedef struct EcsBitmask {
302 /* Populated from child entities with Constant component */
303 ecs_map_t constants;
304} EcsBitmask;
305
307 typedef struct EcsArray {
308 ecs_entity_t type;
309 int32_t count;
310} EcsArray;
311
313 typedef struct EcsVector {
314 ecs_entity_t type;
315} EcsVector;
316
317
318/* Opaque type support */
319
320#if !defined(__cplusplus) || !defined(FLECS_CPP)
321
323 typedef struct ecs_serializer_t {
324 /* Serialize value */
325 int (*value)(
326 const struct ecs_serializer_t *ser,
327 ecs_entity_t type,
328 const void *value);
330 /* Serialize member */
331 int (*member)(
332 const struct ecs_serializer_t *ser,
333 const char *member);
335 const ecs_world_t *world;
336 void *ctx;
337} ecs_serializer_t;
338
339#elif defined(__cplusplus)
340
341} /* extern "C" { */
342
344typedef struct ecs_serializer_t {
345 /* Serialize value */
346 int (*value_)(
347 const struct ecs_serializer_t *ser,
348 ecs_entity_t type,
349 const void *value);
350
351 /* Serialize member */
352 int (*member_)(
353 const struct ecs_serializer_t *ser,
354 const char *name);
355
356 /* Serialize value */
357 int value(ecs_entity_t type, const void *value) const;
358
359 /* Serialize value */
360 template <typename T>
361 int value(const T& value) const;
362
363 /* Serialize member */
364 int member(const char *name) const;
365
366 const ecs_world_t *world;
367 void *ctx;
368} ecs_serializer_t;
369
370extern "C" {
371#endif
372
374 typedef int (*ecs_meta_serialize_t)(
375 const ecs_serializer_t *ser,
376 const void *src);
382 typedef struct EcsOpaque {
383 ecs_entity_t as_type;
384 ecs_meta_serialize_t serialize;
386 /* Deserializer interface
387 * Only override the callbacks that are valid for the opaque type. If a
388 * deserializer attempts to assign a value type that is not supported by the
389 * interface, a conversion error is thrown.
390 */
391
393 void (*assign_bool)(
394 void *dst,
395 bool value);
396
398 void (*assign_char)(
399 void *dst,
400 char value);
401
403 void (*assign_int)(
404 void *dst,
405 int64_t value);
406
408 void (*assign_uint)(
409 void *dst,
410 uint64_t value);
411
413 void (*assign_float)(
414 void *dst,
415 double value);
416
418 void (*assign_string)(
419 void *dst,
420 const char *value);
421
423 void (*assign_entity)(
424 void *dst,
425 ecs_world_t *world,
426 ecs_entity_t entity);
427
429 void (*assign_id)(
430 void *dst,
431 ecs_world_t *world,
432 ecs_id_t id);
433
435 void (*assign_null)(
436 void *dst);
437
439 void (*clear)(
440 void *dst);
441
443 void* (*ensure_element)(
444 void *dst,
445 size_t elem);
446
448 void* (*ensure_member)(
449 void *dst,
450 const char *member);
451
453 size_t (*count)(
454 const void *dst);
455
457 void (*resize)(
458 void *dst,
459 size_t count);
460} EcsOpaque;
461
462
463/* Units */
464
472 typedef struct ecs_unit_translation_t {
473 int32_t factor;
474 int32_t power;
475} ecs_unit_translation_t;
476
478 typedef struct EcsUnit {
479 char *symbol;
480 ecs_entity_t prefix;
481 ecs_entity_t base;
482 ecs_entity_t over;
483 ecs_unit_translation_t translation;
484} EcsUnit;
485
487 typedef struct EcsUnitPrefix {
488 char *symbol;
489 ecs_unit_translation_t translation;
490} EcsUnitPrefix;
491
492
493/* Serializer utilities */
494
500 typedef enum ecs_meta_type_op_kind_t {
501 EcsOpArray,
502 EcsOpVector,
503 EcsOpOpaque,
504 EcsOpPush,
505 EcsOpPop,
506
507 EcsOpScope,
509 EcsOpEnum,
510 EcsOpBitmask,
511
512 EcsOpPrimitive,
514 EcsOpBool,
515 EcsOpChar,
516 EcsOpByte,
517 EcsOpU8,
518 EcsOpU16,
519 EcsOpU32,
520 EcsOpU64,
521 EcsOpI8,
522 EcsOpI16,
523 EcsOpI32,
524 EcsOpI64,
525 EcsOpF32,
526 EcsOpF64,
527 EcsOpUPtr,
528 EcsOpIPtr,
529 EcsOpString,
530 EcsOpEntity,
531 EcsOpId,
532 EcsMetaTypeOpKindLast = EcsOpId
533} ecs_meta_type_op_kind_t;
534
536 typedef struct ecs_meta_type_op_t {
537 ecs_meta_type_op_kind_t kind;
538 ecs_size_t offset;
539 int32_t count;
540 const char *name;
541 int32_t op_count;
542 ecs_size_t size;
543 ecs_entity_t type;
544 int32_t member_index;
545 ecs_hashmap_t *members;
546} ecs_meta_type_op_t;
547
551 typedef struct EcsTypeSerializer {
552 ecs_vec_t ops;
553} EcsTypeSerializer;
554
555
556/* Deserializer utilities */
557
561#define ECS_META_MAX_SCOPE_DEPTH (32)
562
564 typedef struct ecs_meta_scope_t {
565 ecs_entity_t type;
566 ecs_meta_type_op_t *ops;
567 int32_t op_count;
568 int32_t op_cur;
569 int32_t elem_cur;
570 int32_t prev_depth;
571 void *ptr;
572 const EcsComponent *comp;
573 const EcsOpaque *opaque;
574 ecs_vec_t *vector;
575 ecs_hashmap_t *members;
576 bool is_collection;
577 bool is_inline_array;
578 bool is_empty_scope;
579} ecs_meta_scope_t;
580
582 typedef struct ecs_meta_cursor_t {
583 const ecs_world_t *world;
584 ecs_meta_scope_t scope[ECS_META_MAX_SCOPE_DEPTH];
585 int32_t depth;
586 bool valid;
587 bool is_primitive_scope;
590 ecs_entity_t (*lookup_action)(const ecs_world_t*, const char*, void*);
591 void *lookup_ctx;
592} ecs_meta_cursor_t;
593
608FLECS_API
609 ecs_meta_cursor_t ecs_meta_cursor(
610 const ecs_world_t *world,
611 ecs_entity_t type,
612 void *ptr);
613
619FLECS_API
620 void* ecs_meta_get_ptr(
621 ecs_meta_cursor_t *cursor);
622
628FLECS_API
629 int ecs_meta_next(
630 ecs_meta_cursor_t *cursor);
631
637FLECS_API
638 int ecs_meta_elem(
639 ecs_meta_cursor_t *cursor,
640 int32_t elem);
641
648FLECS_API
649 int ecs_meta_member(
650 ecs_meta_cursor_t *cursor,
651 const char *name);
652
660FLECS_API
661 int ecs_meta_dotmember(
662 ecs_meta_cursor_t *cursor,
663 const char *name);
664
670FLECS_API
671 int ecs_meta_push(
672 ecs_meta_cursor_t *cursor);
673
679FLECS_API
680 int ecs_meta_pop(
681 ecs_meta_cursor_t *cursor);
682
688FLECS_API
689 bool ecs_meta_is_collection(
690 const ecs_meta_cursor_t *cursor);
691
697FLECS_API
698 ecs_entity_t ecs_meta_get_type(
699 const ecs_meta_cursor_t *cursor);
700
706FLECS_API
707 ecs_entity_t ecs_meta_get_unit(
708 const ecs_meta_cursor_t *cursor);
709
715FLECS_API
716 const char* ecs_meta_get_member(
717 const ecs_meta_cursor_t *cursor);
718
724FLECS_API
725 ecs_entity_t ecs_meta_get_member_id(
726 const ecs_meta_cursor_t *cursor);
727
728/* The set functions assign the field with the specified value. If the value
729 * does not have the same type as the field, it will be cased to the field type.
730 * If no valid conversion is available, the operation will fail. */
731
738FLECS_API
739 int ecs_meta_set_bool(
740 ecs_meta_cursor_t *cursor,
741 bool value);
742
749FLECS_API
750 int ecs_meta_set_char(
751 ecs_meta_cursor_t *cursor,
752 char value);
753
760FLECS_API
761 int ecs_meta_set_int(
762 ecs_meta_cursor_t *cursor,
763 int64_t value);
764
771FLECS_API
772 int ecs_meta_set_uint(
773 ecs_meta_cursor_t *cursor,
774 uint64_t value);
775
782FLECS_API
783 int ecs_meta_set_float(
784 ecs_meta_cursor_t *cursor,
785 double value);
786
793FLECS_API
794 int ecs_meta_set_string(
795 ecs_meta_cursor_t *cursor,
796 const char *value);
797
804FLECS_API
805 int ecs_meta_set_string_literal(
806 ecs_meta_cursor_t *cursor,
807 const char *value);
808
815FLECS_API
816 int ecs_meta_set_entity(
817 ecs_meta_cursor_t *cursor,
818 ecs_entity_t value);
819
826FLECS_API
827 int ecs_meta_set_id(
828 ecs_meta_cursor_t *cursor,
829 ecs_id_t value);
830
836FLECS_API
837 int ecs_meta_set_null(
838 ecs_meta_cursor_t *cursor);
839
846FLECS_API
847 int ecs_meta_set_value(
848 ecs_meta_cursor_t *cursor,
849 const ecs_value_t *value);
850
851/* Functions for getting members. */
852
858FLECS_API
859 bool ecs_meta_get_bool(
860 const ecs_meta_cursor_t *cursor);
861
867FLECS_API
868 char ecs_meta_get_char(
869 const ecs_meta_cursor_t *cursor);
870
876FLECS_API
877int64_t ecs_meta_get_int(
878 const ecs_meta_cursor_t *cursor);
879
885FLECS_API
886uint64_t ecs_meta_get_uint(
887 const ecs_meta_cursor_t *cursor);
888
894FLECS_API
895 double ecs_meta_get_float(
896 const ecs_meta_cursor_t *cursor);
897
905FLECS_API
906 const char* ecs_meta_get_string(
907 const ecs_meta_cursor_t *cursor);
908
915FLECS_API
916 ecs_entity_t ecs_meta_get_entity(
917 const ecs_meta_cursor_t *cursor);
918
925 ecs_id_t ecs_meta_get_id(
926 const ecs_meta_cursor_t *cursor);
927
934FLECS_API
935 double ecs_meta_ptr_to_float(
936 ecs_primitive_kind_t type_kind,
937 const void *ptr);
938
939/* API functions for creating meta types */
940
942 typedef struct ecs_primitive_desc_t {
943 ecs_entity_t entity;
944 ecs_primitive_kind_t kind;
945} ecs_primitive_desc_t;
946
953FLECS_API
954 ecs_entity_t ecs_primitive_init(
955 ecs_world_t *world,
956 const ecs_primitive_desc_t *desc);
957
958
960 typedef struct ecs_enum_desc_t {
961 ecs_entity_t entity;
962 ecs_enum_constant_t constants[ECS_MEMBER_DESC_CACHE_SIZE];
963} ecs_enum_desc_t;
964
971FLECS_API
972 ecs_entity_t ecs_enum_init(
973 ecs_world_t *world,
974 const ecs_enum_desc_t *desc);
975
976
978 typedef struct ecs_bitmask_desc_t {
979 ecs_entity_t entity;
980 ecs_bitmask_constant_t constants[ECS_MEMBER_DESC_CACHE_SIZE];
981} ecs_bitmask_desc_t;
982
989FLECS_API
990 ecs_entity_t ecs_bitmask_init(
991 ecs_world_t *world,
992 const ecs_bitmask_desc_t *desc);
993
994
996 typedef struct ecs_array_desc_t {
997 ecs_entity_t entity;
998 ecs_entity_t type;
999 int32_t count;
1000} ecs_array_desc_t;
1001
1008FLECS_API
1009 ecs_entity_t ecs_array_init(
1010 ecs_world_t *world,
1011 const ecs_array_desc_t *desc);
1012
1013
1015 typedef struct ecs_vector_desc_t {
1016 ecs_entity_t entity;
1017 ecs_entity_t type;
1018} ecs_vector_desc_t;
1019
1026FLECS_API
1027 ecs_entity_t ecs_vector_init(
1028 ecs_world_t *world,
1029 const ecs_vector_desc_t *desc);
1030
1031
1033 typedef struct ecs_struct_desc_t {
1034 ecs_entity_t entity;
1035 ecs_member_t members[ECS_MEMBER_DESC_CACHE_SIZE];
1036} ecs_struct_desc_t;
1037
1044FLECS_API
1045 ecs_entity_t ecs_struct_init(
1046 ecs_world_t *world,
1047 const ecs_struct_desc_t *desc);
1048
1049
1051 typedef struct ecs_opaque_desc_t {
1052 ecs_entity_t entity;
1053 EcsOpaque type;
1054} ecs_opaque_desc_t;
1055
1078FLECS_API
1079 ecs_entity_t ecs_opaque_init(
1080 ecs_world_t *world,
1081 const ecs_opaque_desc_t *desc);
1082
1083
1085 typedef struct ecs_unit_desc_t {
1087 ecs_entity_t entity;
1088
1090 const char *symbol;
1091
1093 ecs_entity_t quantity;
1094
1096 ecs_entity_t base;
1097
1099 ecs_entity_t over;
1100
1102 ecs_unit_translation_t translation;
1103
1110 ecs_entity_t prefix;
1111} ecs_unit_desc_t;
1112
1119FLECS_API
1120 ecs_entity_t ecs_unit_init(
1121 ecs_world_t *world,
1122 const ecs_unit_desc_t *desc);
1123
1124
1126 typedef struct ecs_unit_prefix_desc_t {
1128 ecs_entity_t entity;
1129
1131 const char *symbol;
1132
1134 ecs_unit_translation_t translation;
1135} ecs_unit_prefix_desc_t;
1136
1143FLECS_API
1144 ecs_entity_t ecs_unit_prefix_init(
1145 ecs_world_t *world,
1146 const ecs_unit_prefix_desc_t *desc);
1147
1148
1155FLECS_API
1156 ecs_entity_t ecs_quantity_init(
1157 ecs_world_t *world,
1158 const ecs_entity_desc_t *desc);
1159
1160/* Convenience macros */
1161
1163#define ecs_primitive(world, ...)\
1164 ecs_primitive_init(world, &(ecs_primitive_desc_t) __VA_ARGS__ )
1165
1167#define ecs_enum(world, ...)\
1168 ecs_enum_init(world, &(ecs_enum_desc_t) __VA_ARGS__ )
1169
1171#define ecs_bitmask(world, ...)\
1172 ecs_bitmask_init(world, &(ecs_bitmask_desc_t) __VA_ARGS__ )
1173
1175#define ecs_array(world, ...)\
1176 ecs_array_init(world, &(ecs_array_desc_t) __VA_ARGS__ )
1177
1179#define ecs_vector(world, ...)\
1180 ecs_vector_init(world, &(ecs_vector_desc_t) __VA_ARGS__ )
1181
1183#define ecs_opaque(world, ...)\
1184 ecs_opaque_init(world, &(ecs_opaque_desc_t) __VA_ARGS__ )
1185
1187#define ecs_struct(world, ...)\
1188 ecs_struct_init(world, &(ecs_struct_desc_t) __VA_ARGS__ )
1189
1191#define ecs_unit(world, ...)\
1192 ecs_unit_init(world, &(ecs_unit_desc_t) __VA_ARGS__ )
1193
1195#define ecs_unit_prefix(world, ...)\
1196 ecs_unit_prefix_init(world, &(ecs_unit_prefix_desc_t) __VA_ARGS__ )
1197
1199#define ecs_quantity(world, ...)\
1200 ecs_quantity_init(world, &(ecs_entity_desc_t) __VA_ARGS__ )
1201
1202
1211FLECS_API
1212 void FlecsMetaImport(
1213 ecs_world_t *world);
1214
1215#ifdef __cplusplus
1216}
1217#endif
1218
1219#include "meta_c.h"
1220
1221#endif
1222
1225#endif
ecs_meta_set_int
FLECS_API int ecs_meta_set_int(ecs_meta_cursor_t *cursor, int64_t value)
Set field with int value.
ecs_meta_next
FLECS_API int ecs_meta_next(ecs_meta_cursor_t *cursor)
Move cursor to next field.
ecs_meta_set_uint
FLECS_API int ecs_meta_set_uint(ecs_meta_cursor_t *cursor, uint64_t value)
Set field with uint value.
EcsMember
struct EcsMember EcsMember
Component added to member entities.
ecs_meta_get_id
ecs_id_t ecs_meta_get_id(const ecs_meta_cursor_t *cursor)
Get field value as (component) id.
ecs_meta_get_bool
FLECS_API bool ecs_meta_get_bool(const ecs_meta_cursor_t *cursor)
Get field value as boolean.
EcsPrimitive
struct EcsPrimitive EcsPrimitive
Component added to primitive types.
ecs_bool_t
bool ecs_bool_t
Primitive type definitions.
Definition meta.h:97
ecs_vector_desc_t
struct ecs_vector_desc_t ecs_vector_desc_t
Used with ecs_vector_init().
ecs_id
FLECS_API const ecs_entity_t ecs_id(EcsType)
Id for component added to all types with reflection data.
ecs_bitmask_init
FLECS_API ecs_entity_t ecs_bitmask_init(ecs_world_t *world, const ecs_bitmask_desc_t *desc)
Create a new bitmask type.
EcsEnum
struct EcsEnum EcsEnum
Component added to enum type entities.
ecs_u32_t
uint32_t ecs_u32_t
Builtin u32 type.
Definition meta.h:102
ecs_meta_type_op_t
struct ecs_meta_type_op_t ecs_meta_type_op_t
Meta type serializer instruction data.
ecs_meta_ptr_to_float
FLECS_API double ecs_meta_ptr_to_float(ecs_primitive_kind_t type_kind, const void *ptr)
Convert pointer of primitive kind to float.
ecs_bitmask_constant_t
struct ecs_bitmask_constant_t ecs_bitmask_constant_t
Type that describes an bitmask constant.
ecs_i16_t
int16_t ecs_i16_t
Builtin i16 type.
Definition meta.h:106
ecs_meta_cursor_t
struct ecs_meta_cursor_t ecs_meta_cursor_t
Type that enables iterating/populating a value using reflection data.
ecs_meta_set_string_literal
FLECS_API int ecs_meta_set_string_literal(ecs_meta_cursor_t *cursor, const char *value)
Set field with string literal value (has enclosing "").
ecs_opaque_init
FLECS_API ecs_entity_t ecs_opaque_init(ecs_world_t *world, const ecs_opaque_desc_t *desc)
Create a new opaque type.
ecs_meta_set_float
FLECS_API int ecs_meta_set_float(ecs_meta_cursor_t *cursor, double value)
Set field with float value.
ecs_enum_desc_t
struct ecs_enum_desc_t ecs_enum_desc_t
Used with ecs_enum_init().
ecs_meta_dotmember
FLECS_API int ecs_meta_dotmember(ecs_meta_cursor_t *cursor, const char *name)
Move cursor to member.
EcsStruct
struct EcsStruct EcsStruct
Component added to struct type entities.
ecs_meta_get_entity
FLECS_API ecs_entity_t ecs_meta_get_entity(const ecs_meta_cursor_t *cursor)
Get field value as entity.
ecs_u8_t
uint8_t ecs_u8_t
Builtin u8 type.
Definition meta.h:100
ecs_member_t
struct ecs_member_t ecs_member_t
Element type of members vector in EcsStruct.
EcsVector
struct EcsVector EcsVector
Component added to vector type entities.
ecs_i64_t
int64_t ecs_i64_t
Builtin i64 type.
Definition meta.h:108
ecs_meta_is_collection
FLECS_API bool ecs_meta_is_collection(const ecs_meta_cursor_t *cursor)
Is the current scope a collection?.
ecs_serializer_t
struct ecs_serializer_t ecs_serializer_t
Serializer interface.
ecs_string_t
char * ecs_string_t
Builtin string type.
Definition meta.h:112
EcsBitmask
struct EcsBitmask EcsBitmask
Component added to bitmask type entities.
ecs_member_value_range_t
struct ecs_member_value_range_t ecs_member_value_range_t
Type expressing a range for a member value.
EcsConstant
FLECS_API const ecs_entity_t EcsConstant
Tag added to enum/bitmask constants.
ecs_u64_t
uint64_t ecs_u64_t
Builtin u64 type.
Definition meta.h:103
ecs_iptr_t
intptr_t ecs_iptr_t
Builtin iptr type.
Definition meta.h:109
EcsOpaque
struct EcsOpaque EcsOpaque
Opaque type reflection data.
ecs_quantity_init
FLECS_API ecs_entity_t ecs_quantity_init(ecs_world_t *world, const ecs_entity_desc_t *desc)
Create a new quantity.
ecs_meta_set_id
FLECS_API int ecs_meta_set_id(ecs_meta_cursor_t *cursor, ecs_id_t value)
Set field with (component) id value.
ecs_uptr_t
uintptr_t ecs_uptr_t
Builtin uptr type.
Definition meta.h:104
ecs_meta_cursor
FLECS_API ecs_meta_cursor_t ecs_meta_cursor(const ecs_world_t *world, ecs_entity_t type, void *ptr)
Create meta cursor.
ecs_meta_get_unit
FLECS_API ecs_entity_t ecs_meta_get_unit(const ecs_meta_cursor_t *cursor)
Get unit of current field.
EcsQuantity
FLECS_API const ecs_entity_t EcsQuantity
Tag added to unit quantities.
ecs_f32_t
float ecs_f32_t
Builtin f32 type.
Definition meta.h:110
FlecsMetaImport
FLECS_API void FlecsMetaImport(ecs_world_t *world)
Meta module import function.
ecs_primitive_kind_t
ecs_primitive_kind_t
Primitive type kinds supported by meta addon.
Definition meta.h:172
ecs_meta_get_member_id
FLECS_API ecs_entity_t ecs_meta_get_member_id(const ecs_meta_cursor_t *cursor)
Get member entity of current field.
ecs_meta_get_string
FLECS_API const char * ecs_meta_get_string(const ecs_meta_cursor_t *cursor)
Get field value as string.
ecs_meta_get_member
FLECS_API const char * ecs_meta_get_member(const ecs_meta_cursor_t *cursor)
Get member name of current field.
EcsArray
struct EcsArray EcsArray
Component added to array type entities.
ecs_array_desc_t
struct ecs_array_desc_t ecs_array_desc_t
Used with ecs_array_init().
ecs_meta_get_float
FLECS_API double ecs_meta_get_float(const ecs_meta_cursor_t *cursor)
Get field value as float.
ecs_meta_pop
FLECS_API int ecs_meta_pop(ecs_meta_cursor_t *cursor)
Pop a struct or collection scope (must follow a push).
ecs_meta_get_type
FLECS_API ecs_entity_t ecs_meta_get_type(const ecs_meta_cursor_t *cursor)
Get type of current field.
ecs_meta_get_uint
FLECS_API uint64_t ecs_meta_get_uint(const ecs_meta_cursor_t *cursor)
Get field value as unsigned integer.
ecs_vector_init
FLECS_API ecs_entity_t ecs_vector_init(ecs_world_t *world, const ecs_vector_desc_t *desc)
Create a new vector type.
ecs_meta_get_char
FLECS_API char ecs_meta_get_char(const ecs_meta_cursor_t *cursor)
Get field value as char.
ecs_meta_type_op_kind_t
ecs_meta_type_op_kind_t
Serializer instruction opcodes.
Definition meta.h:500
ecs_f64_t
double ecs_f64_t
Builtin f64 type.
Definition meta.h:111
ecs_char_t
char ecs_char_t
Builtin char type.
Definition meta.h:98
ecs_unit_prefix_init
FLECS_API ecs_entity_t ecs_unit_prefix_init(ecs_world_t *world, const ecs_unit_prefix_desc_t *desc)
Create a new unit prefix.
ecs_opaque_desc_t
struct ecs_opaque_desc_t ecs_opaque_desc_t
Used with ecs_opaque_init().
ecs_meta_elem
FLECS_API int ecs_meta_elem(ecs_meta_cursor_t *cursor, int32_t elem)
Move cursor to a field.
ecs_enum_constant_t
struct ecs_enum_constant_t ecs_enum_constant_t
Type that describes an enum constant.
ecs_meta_get_int
FLECS_API int64_t ecs_meta_get_int(const ecs_meta_cursor_t *cursor)
Get field value as signed integer.
ecs_primitive_desc_t
struct ecs_primitive_desc_t ecs_primitive_desc_t
Used with ecs_primitive_init().
ecs_type_kind_t
ecs_type_kind_t
Type kinds supported by meta addon.
Definition meta.h:153
ecs_unit_translation_t
struct ecs_unit_translation_t ecs_unit_translation_t
Helper type to describe translation between two units.
ecs_primitive_init
FLECS_API ecs_entity_t ecs_primitive_init(ecs_world_t *world, const ecs_primitive_desc_t *desc)
Create a new primitive type.
ecs_unit_init
FLECS_API ecs_entity_t ecs_unit_init(ecs_world_t *world, const ecs_unit_desc_t *desc)
Create a new unit.
ecs_u16_t
uint16_t ecs_u16_t
Builtin u16 type.
Definition meta.h:101
ecs_meta_serialize_t
int(* ecs_meta_serialize_t)(const ecs_serializer_t *ser, const void *src)
Callback invoked serializing an opaque type.
Definition meta.h:374
ecs_meta_set_string
FLECS_API int ecs_meta_set_string(ecs_meta_cursor_t *cursor, const char *value)
Set field with string value.
ecs_struct_desc_t
struct ecs_struct_desc_t ecs_struct_desc_t
Used with ecs_struct_init().
ECS_META_MAX_SCOPE_DEPTH
#define ECS_META_MAX_SCOPE_DEPTH
Maximum level of type nesting.
Definition meta.h:561
ecs_i32_t
int32_t ecs_i32_t
Builtin i32 type.
Definition meta.h:107
ecs_meta_member
FLECS_API int ecs_meta_member(ecs_meta_cursor_t *cursor, const char *name)
Move cursor to member.
ecs_enum_init
FLECS_API ecs_entity_t ecs_enum_init(ecs_world_t *world, const ecs_enum_desc_t *desc)
Create a new enum type.
ecs_struct_init
FLECS_API ecs_entity_t ecs_struct_init(ecs_world_t *world, const ecs_struct_desc_t *desc)
Create a new struct type.
EcsType
struct EcsType EcsType
Component that is automatically added to every type with the right kind.
ecs_meta_set_bool
FLECS_API int ecs_meta_set_bool(ecs_meta_cursor_t *cursor, bool value)
Set field with boolean value.
ecs_i8_t
int8_t ecs_i8_t
Builtin i8 type.
Definition meta.h:105
ecs_byte_t
unsigned char ecs_byte_t
Builtin ecs_byte type.
Definition meta.h:99
EcsUnitPrefix
struct EcsUnitPrefix EcsUnitPrefix
Component that stores unit prefix data.
ecs_meta_set_char
FLECS_API int ecs_meta_set_char(ecs_meta_cursor_t *cursor, char value)
Set field with char value.
ecs_unit_desc_t
struct ecs_unit_desc_t ecs_unit_desc_t
Used with ecs_unit_init().
ecs_meta_scope_t
struct ecs_meta_scope_t ecs_meta_scope_t
Type with information about currently serialized scope.
ECS_MEMBER_DESC_CACHE_SIZE
#define ECS_MEMBER_DESC_CACHE_SIZE
Max number of constants/members that can be specified in desc structs.
Definition meta.h:81
ecs_meta_get_ptr
FLECS_API void * ecs_meta_get_ptr(ecs_meta_cursor_t *cursor)
Get pointer to current field.
EcsMemberRanges
struct EcsMemberRanges EcsMemberRanges
Component added to member entities to express valid value ranges.
EcsTypeSerializer
struct EcsTypeSerializer EcsTypeSerializer
Component that stores the type serializer.
EcsUnit
struct EcsUnit EcsUnit
Component that stores unit data.
ecs_meta_set_value
FLECS_API int ecs_meta_set_value(ecs_meta_cursor_t *cursor, const ecs_value_t *value)
Set field with dynamic value.
ecs_meta_set_null
FLECS_API int ecs_meta_set_null(ecs_meta_cursor_t *cursor)
Set field with null value.
ecs_array_init
FLECS_API ecs_entity_t ecs_array_init(ecs_world_t *world, const ecs_array_desc_t *desc)
Create a new array type.
ecs_meta_set_entity
FLECS_API int ecs_meta_set_entity(ecs_meta_cursor_t *cursor, ecs_entity_t value)
Set field with entity value.
ecs_unit_prefix_desc_t
struct ecs_unit_prefix_desc_t ecs_unit_prefix_desc_t
Used with ecs_unit_prefix_init().
ecs_bitmask_desc_t
struct ecs_bitmask_desc_t ecs_bitmask_desc_t
Used with ecs_bitmask_init().
ecs_meta_push
FLECS_API int ecs_meta_push(ecs_meta_cursor_t *cursor)
Push a scope (required/only valid for structs & collections).
EcsOpPrimitive
@ EcsOpPrimitive
Marks first constant that's a primitive.
Definition meta.h:512
EcsOpScope
@ EcsOpScope
Marks last constant that can open/close a scope.
Definition meta.h:507
ecs_entity_t
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:347
ecs_world_t
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:391
ecs_id_t
uint64_t ecs_id_t
Ids are the things that can be added to an entity.
Definition flecs.h:340
meta_c.h
Utility macros for populating reflection data in C.
EcsArray
Component added to array type entities.
Definition meta.h:307
EcsArray::count
int32_t count
Number of elements.
Definition meta.h:309
EcsArray::type
ecs_entity_t type
Element type.
Definition meta.h:308
EcsBitmask
Component added to bitmask type entities.
Definition meta.h:301
EcsBitmask::constants
ecs_map_t constants
map<u32_t, ecs_bitmask_constant_t>
Definition meta.h:303
EcsComponent
Component information.
Definition flecs.h:1450
EcsEnum
Component added to enum type entities.
Definition meta.h:283
EcsEnum::constants
ecs_map_t constants
Populated from child entities with Constant component.
Definition meta.h:285
EcsMemberRanges
Component added to member entities to express valid value ranges.
Definition meta.h:215
EcsMemberRanges::warning
ecs_member_value_range_t warning
Member value warning range.
Definition meta.h:217
EcsMemberRanges::value
ecs_member_value_range_t value
Member value range.
Definition meta.h:216
EcsMemberRanges::error
ecs_member_value_range_t error
Member value error range.
Definition meta.h:218
EcsMember
Component added to member entities.
Definition meta.h:200
EcsMember::unit
ecs_entity_t unit
Member unit.
Definition meta.h:203
EcsMember::use_offset
bool use_offset
If offset should be explicitly used.
Definition meta.h:205
EcsMember::type
ecs_entity_t type
Member type.
Definition meta.h:201
EcsMember::offset
int32_t offset
Member offset.
Definition meta.h:204
EcsMember::count
int32_t count
Number of elements (for inline arrays).
Definition meta.h:202
EcsOpaque
Opaque type reflection data.
Definition meta.h:382
EcsOpaque::count
size_t(* count)(const void *dst)
Return number of elements.
Definition meta.h:453
EcsOpaque::assign_null
void(* assign_null)(void *dst)
Assign null value.
Definition meta.h:435
EcsOpaque::clear
void(* clear)(void *dst)
Clear collection elements.
Definition meta.h:439
EcsOpaque::assign_uint
void(* assign_uint)(void *dst, uint64_t value)
Assign unsigned int value.
Definition meta.h:408
EcsOpaque::serialize
ecs_meta_serialize_t serialize
Serialize action.
Definition meta.h:384
EcsOpaque::assign_char
void(* assign_char)(void *dst, char value)
Assign char value.
Definition meta.h:398
EcsOpaque::as_type
ecs_entity_t as_type
Type that describes the serialized output.
Definition meta.h:383
EcsOpaque::assign_bool
void(* assign_bool)(void *dst, bool value)
Assign bool value.
Definition meta.h:393
EcsOpaque::assign_string
void(* assign_string)(void *dst, const char *value)
Assign string value.
Definition meta.h:418
EcsOpaque::resize
void(* resize)(void *dst, size_t count)
Resize to number of elements.
Definition meta.h:457
EcsOpaque::assign_int
void(* assign_int)(void *dst, int64_t value)
Assign int value.
Definition meta.h:403
EcsOpaque::assign_float
void(* assign_float)(void *dst, double value)
Assign float value.
Definition meta.h:413
EcsOpaque::assign_entity
void(* assign_entity)(void *dst, ecs_world_t *world, ecs_entity_t entity)
Assign entity value.
Definition meta.h:423
EcsOpaque::assign_id
void(* assign_id)(void *dst, ecs_world_t *world, ecs_id_t id)
Assign (component) id value.
Definition meta.h:429
EcsPrimitive
Component added to primitive types.
Definition meta.h:195
EcsPrimitive::kind
ecs_primitive_kind_t kind
Primitive type kind.
Definition meta.h:196
EcsStruct
Component added to struct type entities.
Definition meta.h:265
EcsStruct::members
ecs_vec_t members
Populated from child entities with Member component.
Definition meta.h:267
EcsTypeSerializer
Component that stores the type serializer.
Definition meta.h:551
EcsTypeSerializer::ops
ecs_vec_t ops
vector<ecs_meta_type_op_t>
Definition meta.h:552
EcsType
Component that is automatically added to every type with the right kind.
Definition meta.h:165
EcsType::existing
bool existing
Did the type exist or is it populated from reflection.
Definition meta.h:167
EcsType::partial
bool partial
Is the reflection data a partial type description.
Definition meta.h:168
EcsType::kind
ecs_type_kind_t kind
Type kind.
Definition meta.h:166
EcsUnitPrefix
Component that stores unit prefix data.
Definition meta.h:487
EcsUnitPrefix::translation
ecs_unit_translation_t translation
Translation of prefix.
Definition meta.h:489
EcsUnitPrefix::symbol
char * symbol
Symbol of prefix (e.g.
Definition meta.h:488
EcsUnit
Component that stores unit data.
Definition meta.h:478
EcsUnit::translation
ecs_unit_translation_t translation
Translation for derived unit.
Definition meta.h:483
EcsUnit::prefix
ecs_entity_t prefix
Order of magnitude prefix relative to derived.
Definition meta.h:480
EcsUnit::symbol
char * symbol
Unit symbol.
Definition meta.h:479
EcsUnit::base
ecs_entity_t base
Base unit (e.g.
Definition meta.h:481
EcsUnit::over
ecs_entity_t over
Over unit (e.g.
Definition meta.h:482
EcsVector
Component added to vector type entities.
Definition meta.h:313
EcsVector::type
ecs_entity_t type
Element type.
Definition meta.h:314
ecs_array_desc_t
Used with ecs_array_init().
Definition meta.h:996
ecs_array_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:997
ecs_array_desc_t::type
ecs_entity_t type
Element type.
Definition meta.h:998
ecs_array_desc_t::count
int32_t count
Number of elements.
Definition meta.h:999
ecs_bitmask_constant_t
Type that describes an bitmask constant.
Definition meta.h:289
ecs_bitmask_constant_t::constant
ecs_entity_t constant
Should not be set by ecs_bitmask_desc_t.
Definition meta.h:297
ecs_bitmask_constant_t::value
ecs_flags32_t value
May be set when used with ecs_bitmask_desc_t.
Definition meta.h:294
ecs_bitmask_constant_t::name
const char * name
Must be set when used with ecs_bitmask_desc_t.
Definition meta.h:291
ecs_bitmask_desc_t
Used with ecs_bitmask_init().
Definition meta.h:978
ecs_bitmask_desc_t::constants
ecs_bitmask_constant_t constants[(32)]
Bitmask constants.
Definition meta.h:980
ecs_bitmask_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:979
ecs_entity_desc_t
Used with ecs_entity_init().
Definition flecs.h:938
ecs_enum_constant_t
Type that describes an enum constant.
Definition meta.h:271
ecs_enum_constant_t::constant
ecs_entity_t constant
Should not be set by ecs_enum_desc_t.
Definition meta.h:279
ecs_enum_constant_t::value
int32_t value
May be set when used with ecs_enum_desc_t.
Definition meta.h:276
ecs_enum_constant_t::name
const char * name
Must be set when used with ecs_enum_desc_t.
Definition meta.h:273
ecs_enum_desc_t
Used with ecs_enum_init().
Definition meta.h:960
ecs_enum_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:961
ecs_enum_desc_t::constants
ecs_enum_constant_t constants[(32)]
Enum constants.
Definition meta.h:962
ecs_member_t
Element type of members vector in EcsStruct.
Definition meta.h:222
ecs_member_t::warning_range
ecs_member_value_range_t warning_range
Numerical range outside of which the value represents an warning.
Definition meta.h:255
ecs_member_t::name
const char * name
Must be set when used with ecs_struct_desc_t.
Definition meta.h:224
ecs_member_t::size
ecs_size_t size
Should not be set by ecs_struct_desc_t.
Definition meta.h:258
ecs_member_t::use_offset
bool use_offset
Set to true to prevent automatic offset computation.
Definition meta.h:242
ecs_member_t::type
ecs_entity_t type
Member type.
Definition meta.h:227
ecs_member_t::member
ecs_entity_t member
Should not be set by ecs_struct_desc_t.
Definition meta.h:261
ecs_member_t::offset
int32_t offset
May be set when used with ecs_struct_desc_t.
Definition meta.h:233
ecs_member_t::unit
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.
Definition meta.h:237
ecs_member_t::range
ecs_member_value_range_t range
Numerical range that specifies which values member can assume.
Definition meta.h:247
ecs_member_t::count
int32_t count
Element count (for inline arrays).
Definition meta.h:230
ecs_member_t::error_range
ecs_member_value_range_t error_range
Numerical range outside of which the value represents an error.
Definition meta.h:251
ecs_member_value_range_t
Type expressing a range for a member value.
Definition meta.h:209
ecs_member_value_range_t::min
double min
Min member value.
Definition meta.h:210
ecs_member_value_range_t::max
double max
Max member value.
Definition meta.h:211
ecs_meta_cursor_t
Type that enables iterating/populating a value using reflection data.
Definition meta.h:582
ecs_meta_cursor_t::scope
ecs_meta_scope_t scope[(32)]
Cursor scope stack.
Definition meta.h:584
ecs_meta_cursor_t::valid
bool valid
Does the cursor point to a valid field.
Definition meta.h:586
ecs_meta_cursor_t::world
const ecs_world_t * world
The world.
Definition meta.h:583
ecs_meta_cursor_t::lookup_ctx
void * lookup_ctx
Context for lookup_action.
Definition meta.h:591
ecs_meta_cursor_t::depth
int32_t depth
Current scope depth.
Definition meta.h:585
ecs_meta_cursor_t::is_primitive_scope
bool is_primitive_scope
If in root scope, this allows for a push for primitive types.
Definition meta.h:587
ecs_meta_cursor_t::lookup_action
ecs_entity_t(* lookup_action)(const ecs_world_t *, const char *, void *)
Custom entity lookup action for overriding default ecs_lookup.
Definition meta.h:590
ecs_meta_scope_t
Type with information about currently serialized scope.
Definition meta.h:564
ecs_meta_scope_t::opaque
const EcsOpaque * opaque
Opaque type interface.
Definition meta.h:573
ecs_meta_scope_t::prev_depth
int32_t prev_depth
Depth to restore, in case dotmember was used.
Definition meta.h:570
ecs_meta_scope_t::comp
const EcsComponent * comp
Pointer to component, in case size/alignment is needed.
Definition meta.h:572
ecs_meta_scope_t::ptr
void * ptr
Pointer to the value being iterated.
Definition meta.h:571
ecs_meta_scope_t::is_empty_scope
bool is_empty_scope
Was scope populated (for collections)
Definition meta.h:578
ecs_meta_scope_t::vector
ecs_vec_t * vector
Current vector, in case a vector is iterated.
Definition meta.h:574
ecs_meta_scope_t::elem_cur
int32_t elem_cur
Current element (for collections)
Definition meta.h:569
ecs_meta_scope_t::op_cur
int32_t op_cur
Current operation.
Definition meta.h:568
ecs_meta_scope_t::is_inline_array
bool is_inline_array
Is the scope iterating an inline array?
Definition meta.h:577
ecs_meta_scope_t::members
ecs_hashmap_t * members
string -> member index
Definition meta.h:575
ecs_meta_scope_t::ops
ecs_meta_type_op_t * ops
The type operations (see ecs_meta_type_op_t)
Definition meta.h:566
ecs_meta_scope_t::op_count
int32_t op_count
Number of operations in ops array to process.
Definition meta.h:567
ecs_meta_scope_t::type
ecs_entity_t type
The type being iterated.
Definition meta.h:565
ecs_meta_scope_t::is_collection
bool is_collection
Is the scope iterating elements?
Definition meta.h:576
ecs_meta_type_op_t
Meta type serializer instruction data.
Definition meta.h:536
ecs_meta_type_op_t::kind
ecs_meta_type_op_kind_t kind
Instruction opcode.
Definition meta.h:537
ecs_meta_type_op_t::type
ecs_entity_t type
Type entity.
Definition meta.h:543
ecs_meta_type_op_t::count
int32_t count
Number of elements (for inline arrays).
Definition meta.h:539
ecs_meta_type_op_t::size
ecs_size_t size
Size of type of operation.
Definition meta.h:542
ecs_meta_type_op_t::offset
ecs_size_t offset
Offset of current field.
Definition meta.h:538
ecs_meta_type_op_t::name
const char * name
Name of value (only used for struct members)
Definition meta.h:540
ecs_meta_type_op_t::member_index
int32_t member_index
Index of member in struct.
Definition meta.h:544
ecs_meta_type_op_t::members
ecs_hashmap_t * members
string -> member index (structs only)
Definition meta.h:545
ecs_meta_type_op_t::op_count
int32_t op_count
Number of operations until next field or end.
Definition meta.h:541
ecs_opaque_desc_t
Used with ecs_opaque_init().
Definition meta.h:1051
ecs_opaque_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:1052
ecs_opaque_desc_t::type
EcsOpaque type
Type that the opaque type maps to.
Definition meta.h:1053
ecs_primitive_desc_t
Used with ecs_primitive_init().
Definition meta.h:942
ecs_primitive_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:943
ecs_primitive_desc_t::kind
ecs_primitive_kind_t kind
Primitive type kind.
Definition meta.h:944
ecs_serializer_t
Serializer interface.
Definition meta.h:323
ecs_serializer_t::ctx
void * ctx
Serializer context.
Definition meta.h:336
ecs_serializer_t::value
int(* value)(const struct ecs_serializer_t *ser, ecs_entity_t type, const void *value)
Pointer to the value to serialize.
Definition meta.h:325
ecs_serializer_t::member
int(* member)(const struct ecs_serializer_t *ser, const char *member)
Member name.
Definition meta.h:331
ecs_serializer_t::world
const ecs_world_t * world
The world.
Definition meta.h:335
ecs_struct_desc_t
Used with ecs_struct_init().
Definition meta.h:1033
ecs_struct_desc_t::members
ecs_member_t members[(32)]
Struct members.
Definition meta.h:1035
ecs_struct_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:1034
ecs_unit_desc_t
Used with ecs_unit_init().
Definition meta.h:1085
ecs_unit_desc_t::base
ecs_entity_t base
Base unit, e.g.
Definition meta.h:1096
ecs_unit_desc_t::over
ecs_entity_t over
Over unit, e.g.
Definition meta.h:1099
ecs_unit_desc_t::symbol
const char * symbol
Unit symbol, e.g.
Definition meta.h:1090
ecs_unit_desc_t::prefix
ecs_entity_t prefix
Prefix indicating order of magnitude relative to the derived unit.
Definition meta.h:1110
ecs_unit_desc_t::quantity
ecs_entity_t quantity
Unit quantity, e.g.
Definition meta.h:1093
ecs_unit_desc_t::translation
ecs_unit_translation_t translation
Translation to apply to derived unit (optional).
Definition meta.h:1102
ecs_unit_desc_t::entity
ecs_entity_t entity
Existing entity to associate with unit (optional).
Definition meta.h:1087
ecs_unit_prefix_desc_t
Used with ecs_unit_prefix_init().
Definition meta.h:1126
ecs_unit_prefix_desc_t::entity
ecs_entity_t entity
Existing entity to associate with unit prefix (optional).
Definition meta.h:1128
ecs_unit_prefix_desc_t::symbol
const char * symbol
Unit symbol, e.g.
Definition meta.h:1131
ecs_unit_prefix_desc_t::translation
ecs_unit_translation_t translation
Translation to apply to derived unit (optional).
Definition meta.h:1134
ecs_unit_translation_t
Helper type to describe translation between two units.
Definition meta.h:472
ecs_unit_translation_t::power
int32_t power
Power to apply to factor (e.g.
Definition meta.h:474
ecs_unit_translation_t::factor
int32_t factor
Factor to apply (e.g.
Definition meta.h:473
ecs_value_t
Utility to hold a value of a dynamic type.
Definition flecs.h:929
ecs_vector_desc_t
Used with ecs_vector_init().
Definition meta.h:1015
ecs_vector_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:1016
ecs_vector_desc_t::type
ecs_entity_t type
Element type.
Definition meta.h:1017