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
56
57#ifdef FLECS_META
58
66
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
96
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;
113
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;
130
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);
151
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 int64_t value;
277
279 uint64_t value_unsigned;
280
282 ecs_entity_t constant;
283} ecs_enum_constant_t;
284
286 typedef struct EcsEnum {
287 ecs_entity_t underlying_type;
288
290 ecs_map_t constants;
291} EcsEnum;
292
294 typedef struct ecs_bitmask_constant_t {
296 const char *name;
297
299 ecs_flags64_t value;
300
302 int64_t _unused;
303
305 ecs_entity_t constant;
306} ecs_bitmask_constant_t;
307
309 typedef struct EcsBitmask {
310 /* Populated from child entities with Constant component */
311 ecs_map_t constants;
312} EcsBitmask;
313
315 typedef struct EcsArray {
316 ecs_entity_t type;
317 int32_t count;
318} EcsArray;
319
321 typedef struct EcsVector {
322 ecs_entity_t type;
323} EcsVector;
324
325
326/* Opaque type support */
327
328#if !defined(__cplusplus) || !defined(FLECS_CPP)
329
331 typedef struct ecs_serializer_t {
332 /* Serialize value */
333 int (*value)(
334 const struct ecs_serializer_t *ser,
335 ecs_entity_t type,
336 const void *value);
337
338 /* Serialize member */
339 int (*member)(
340 const struct ecs_serializer_t *ser,
341 const char *member);
342
343 const ecs_world_t *world;
344 void *ctx;
345} ecs_serializer_t;
346
347#elif defined(__cplusplus)
348
349} /* extern "C" { */
350
352typedef struct ecs_serializer_t {
353 /* Serialize value */
354 int (*value_)(
355 const struct ecs_serializer_t *ser,
356 ecs_entity_t type,
357 const void *value);
358
359 /* Serialize member */
360 int (*member_)(
361 const struct ecs_serializer_t *ser,
362 const char *name);
363
364 /* Serialize value */
365 int value(ecs_entity_t type, const void *value) const;
366
367 /* Serialize value */
368 template <typename T>
369 int value(const T& value) const;
370
371 /* Serialize member */
372 int member(const char *name) const;
373
374 const ecs_world_t *world;
375 void *ctx;
376} ecs_serializer_t;
377
378extern "C" {
379#endif
380
382 typedef int (*ecs_meta_serialize_t)(
383 const ecs_serializer_t *ser,
384 const void *src);
385
390 typedef struct EcsOpaque {
391 ecs_entity_t as_type;
392 ecs_meta_serialize_t serialize;
393
394 /* Deserializer interface
395 * Only override the callbacks that are valid for the opaque type. If a
396 * deserializer attempts to assign a value type that is not supported by the
397 * interface, a conversion error is thrown.
398 */
399
401 void (*assign_bool)(
402 void *dst,
403 bool value);
404
406 void (*assign_char)(
407 void *dst,
408 char value);
409
411 void (*assign_int)(
412 void *dst,
413 int64_t value);
414
416 void (*assign_uint)(
417 void *dst,
418 uint64_t value);
419
421 void (*assign_float)(
422 void *dst,
423 double value);
424
426 void (*assign_string)(
427 void *dst,
428 const char *value);
429
431 void (*assign_entity)(
432 void *dst,
433 ecs_world_t *world,
434 ecs_entity_t entity);
435
437 void (*assign_id)(
438 void *dst,
439 ecs_world_t *world,
440 ecs_id_t id);
441
443 void (*assign_null)(
444 void *dst);
445
447 void (*clear)(
448 void *dst);
449
451 void* (*ensure_element)(
452 void *dst,
453 size_t elem);
454
456 void* (*ensure_member)(
457 void *dst,
458 const char *member);
459
461 size_t (*count)(
462 const void *dst);
463
465 void (*resize)(
466 void *dst,
467 size_t count);
468} EcsOpaque;
469
470
471/* Units */
472
480 typedef struct ecs_unit_translation_t {
481 int32_t factor;
482 int32_t power;
483} ecs_unit_translation_t;
484
486 typedef struct EcsUnit {
487 char *symbol;
488 ecs_entity_t prefix;
489 ecs_entity_t base;
490 ecs_entity_t over;
491 ecs_unit_translation_t translation;
492} EcsUnit;
493
495 typedef struct EcsUnitPrefix {
496 char *symbol;
497 ecs_unit_translation_t translation;
498} EcsUnitPrefix;
499
500
501/* Serializer utilities */
502
508 typedef enum ecs_meta_type_op_kind_t {
509 EcsOpArray,
510 EcsOpVector,
511 EcsOpOpaque,
512 EcsOpPush,
513 EcsOpPop,
514
515 EcsOpScope,
516
517 EcsOpEnum,
518 EcsOpBitmask,
519
520 EcsOpPrimitive,
521
522 EcsOpBool,
523 EcsOpChar,
524 EcsOpByte,
525 EcsOpU8,
526 EcsOpU16,
527 EcsOpU32,
528 EcsOpU64,
529 EcsOpI8,
530 EcsOpI16,
531 EcsOpI32,
532 EcsOpI64,
533 EcsOpF32,
534 EcsOpF64,
535 EcsOpUPtr,
536 EcsOpIPtr,
537 EcsOpString,
538 EcsOpEntity,
539 EcsOpId,
540 EcsMetaTypeOpKindLast = EcsOpId
541} ecs_meta_type_op_kind_t;
542
544 typedef struct ecs_meta_type_op_t {
545 ecs_meta_type_op_kind_t kind;
546 ecs_size_t offset;
547 int32_t count;
548 const char *name;
549 int32_t op_count;
550 ecs_size_t size;
551 ecs_entity_t type;
552 int32_t member_index;
553 ecs_hashmap_t *members;
554} ecs_meta_type_op_t;
555
559 typedef struct EcsTypeSerializer {
560 ecs_vec_t ops;
561} EcsTypeSerializer;
562
563
564/* Deserializer utilities */
565
569#define ECS_META_MAX_SCOPE_DEPTH (32)
570
572 typedef struct ecs_meta_scope_t {
573 ecs_entity_t type;
574 ecs_meta_type_op_t *ops;
575 int32_t op_count;
576 int32_t op_cur;
577 int32_t elem_cur;
578 int32_t prev_depth;
579 void *ptr;
580 const EcsComponent *comp;
581 const EcsOpaque *opaque;
582 ecs_vec_t *vector;
583 ecs_hashmap_t *members;
584 bool is_collection;
585 bool is_inline_array;
586 bool is_empty_scope;
587} ecs_meta_scope_t;
588
590 typedef struct ecs_meta_cursor_t {
591 const ecs_world_t *world;
592 ecs_meta_scope_t scope[ECS_META_MAX_SCOPE_DEPTH];
593 int32_t depth;
594 bool valid;
595 bool is_primitive_scope;
596
598 ecs_entity_t (*lookup_action)(const ecs_world_t*, const char*, void*);
599 void *lookup_ctx;
600} ecs_meta_cursor_t;
601
616FLECS_API
617 ecs_meta_cursor_t ecs_meta_cursor(
618 const ecs_world_t *world,
619 ecs_entity_t type,
620 void *ptr);
621
627FLECS_API
628 void* ecs_meta_get_ptr(
629 ecs_meta_cursor_t *cursor);
630
636FLECS_API
637 int ecs_meta_next(
638 ecs_meta_cursor_t *cursor);
639
645FLECS_API
646 int ecs_meta_elem(
647 ecs_meta_cursor_t *cursor,
648 int32_t elem);
649
656FLECS_API
657 int ecs_meta_member(
658 ecs_meta_cursor_t *cursor,
659 const char *name);
660
668FLECS_API
669 int ecs_meta_dotmember(
670 ecs_meta_cursor_t *cursor,
671 const char *name);
672
678FLECS_API
679 int ecs_meta_push(
680 ecs_meta_cursor_t *cursor);
681
687FLECS_API
688 int ecs_meta_pop(
689 ecs_meta_cursor_t *cursor);
690
696FLECS_API
697 bool ecs_meta_is_collection(
698 const ecs_meta_cursor_t *cursor);
699
705FLECS_API
706 ecs_entity_t ecs_meta_get_type(
707 const ecs_meta_cursor_t *cursor);
708
714FLECS_API
715 ecs_entity_t ecs_meta_get_unit(
716 const ecs_meta_cursor_t *cursor);
717
723FLECS_API
724 const char* ecs_meta_get_member(
725 const ecs_meta_cursor_t *cursor);
726
732FLECS_API
733 ecs_entity_t ecs_meta_get_member_id(
734 const ecs_meta_cursor_t *cursor);
735
736/* The set functions assign the field with the specified value. If the value
737 * does not have the same type as the field, it will be cased to the field type.
738 * If no valid conversion is available, the operation will fail. */
739
746FLECS_API
747 int ecs_meta_set_bool(
748 ecs_meta_cursor_t *cursor,
749 bool value);
750
757FLECS_API
758 int ecs_meta_set_char(
759 ecs_meta_cursor_t *cursor,
760 char value);
761
768FLECS_API
769 int ecs_meta_set_int(
770 ecs_meta_cursor_t *cursor,
771 int64_t value);
772
779FLECS_API
780 int ecs_meta_set_uint(
781 ecs_meta_cursor_t *cursor,
782 uint64_t value);
783
790FLECS_API
791 int ecs_meta_set_float(
792 ecs_meta_cursor_t *cursor,
793 double value);
794
801FLECS_API
802 int ecs_meta_set_string(
803 ecs_meta_cursor_t *cursor,
804 const char *value);
805
812FLECS_API
813 int ecs_meta_set_string_literal(
814 ecs_meta_cursor_t *cursor,
815 const char *value);
816
823FLECS_API
824 int ecs_meta_set_entity(
825 ecs_meta_cursor_t *cursor,
826 ecs_entity_t value);
827
834FLECS_API
835 int ecs_meta_set_id(
836 ecs_meta_cursor_t *cursor,
837 ecs_id_t value);
838
844FLECS_API
845 int ecs_meta_set_null(
846 ecs_meta_cursor_t *cursor);
847
854FLECS_API
855 int ecs_meta_set_value(
856 ecs_meta_cursor_t *cursor,
857 const ecs_value_t *value);
858
859/* Functions for getting members. */
860
866FLECS_API
867 bool ecs_meta_get_bool(
868 const ecs_meta_cursor_t *cursor);
869
875FLECS_API
876 char ecs_meta_get_char(
877 const ecs_meta_cursor_t *cursor);
878
884FLECS_API
885int64_t ecs_meta_get_int(
886 const ecs_meta_cursor_t *cursor);
887
893FLECS_API
894uint64_t ecs_meta_get_uint(
895 const ecs_meta_cursor_t *cursor);
896
902FLECS_API
903 double ecs_meta_get_float(
904 const ecs_meta_cursor_t *cursor);
905
913FLECS_API
914 const char* ecs_meta_get_string(
915 const ecs_meta_cursor_t *cursor);
916
923FLECS_API
924 ecs_entity_t ecs_meta_get_entity(
925 const ecs_meta_cursor_t *cursor);
926
933 ecs_id_t ecs_meta_get_id(
934 const ecs_meta_cursor_t *cursor);
935
942FLECS_API
943 double ecs_meta_ptr_to_float(
944 ecs_primitive_kind_t type_kind,
945 const void *ptr);
946
947/* API functions for creating meta types */
948
950 typedef struct ecs_primitive_desc_t {
951 ecs_entity_t entity;
952 ecs_primitive_kind_t kind;
953} ecs_primitive_desc_t;
954
961FLECS_API
962 ecs_entity_t ecs_primitive_init(
963 ecs_world_t *world,
964 const ecs_primitive_desc_t *desc);
965
966
968 typedef struct ecs_enum_desc_t {
969 ecs_entity_t entity;
970 ecs_enum_constant_t constants[ECS_MEMBER_DESC_CACHE_SIZE];
971 ecs_entity_t underlying_type;
972} ecs_enum_desc_t;
973
980FLECS_API
981 ecs_entity_t ecs_enum_init(
982 ecs_world_t *world,
983 const ecs_enum_desc_t *desc);
984
985
987 typedef struct ecs_bitmask_desc_t {
988 ecs_entity_t entity;
989 ecs_bitmask_constant_t constants[ECS_MEMBER_DESC_CACHE_SIZE];
990} ecs_bitmask_desc_t;
991
998FLECS_API
999 ecs_entity_t ecs_bitmask_init(
1000 ecs_world_t *world,
1001 const ecs_bitmask_desc_t *desc);
1002
1003
1005 typedef struct ecs_array_desc_t {
1006 ecs_entity_t entity;
1007 ecs_entity_t type;
1008 int32_t count;
1009} ecs_array_desc_t;
1010
1017FLECS_API
1018 ecs_entity_t ecs_array_init(
1019 ecs_world_t *world,
1020 const ecs_array_desc_t *desc);
1021
1022
1024 typedef struct ecs_vector_desc_t {
1025 ecs_entity_t entity;
1026 ecs_entity_t type;
1027} ecs_vector_desc_t;
1028
1035FLECS_API
1036 ecs_entity_t ecs_vector_init(
1037 ecs_world_t *world,
1038 const ecs_vector_desc_t *desc);
1039
1040
1042 typedef struct ecs_struct_desc_t {
1043 ecs_entity_t entity;
1044 ecs_member_t members[ECS_MEMBER_DESC_CACHE_SIZE];
1045} ecs_struct_desc_t;
1046
1053FLECS_API
1054 ecs_entity_t ecs_struct_init(
1055 ecs_world_t *world,
1056 const ecs_struct_desc_t *desc);
1057
1058
1060 typedef struct ecs_opaque_desc_t {
1061 ecs_entity_t entity;
1062 EcsOpaque type;
1063} ecs_opaque_desc_t;
1064
1087FLECS_API
1088 ecs_entity_t ecs_opaque_init(
1089 ecs_world_t *world,
1090 const ecs_opaque_desc_t *desc);
1091
1092
1094 typedef struct ecs_unit_desc_t {
1096 ecs_entity_t entity;
1097
1099 const char *symbol;
1100
1102 ecs_entity_t quantity;
1103
1105 ecs_entity_t base;
1106
1108 ecs_entity_t over;
1109
1111 ecs_unit_translation_t translation;
1112
1119 ecs_entity_t prefix;
1120} ecs_unit_desc_t;
1121
1128FLECS_API
1129 ecs_entity_t ecs_unit_init(
1130 ecs_world_t *world,
1131 const ecs_unit_desc_t *desc);
1132
1133
1135 typedef struct ecs_unit_prefix_desc_t {
1137 ecs_entity_t entity;
1138
1140 const char *symbol;
1141
1143 ecs_unit_translation_t translation;
1144} ecs_unit_prefix_desc_t;
1145
1152FLECS_API
1153 ecs_entity_t ecs_unit_prefix_init(
1154 ecs_world_t *world,
1155 const ecs_unit_prefix_desc_t *desc);
1156
1157
1164FLECS_API
1165 ecs_entity_t ecs_quantity_init(
1166 ecs_world_t *world,
1167 const ecs_entity_desc_t *desc);
1168
1169/* Convenience macros */
1170
1172#define ecs_primitive(world, ...)\
1173 ecs_primitive_init(world, &(ecs_primitive_desc_t) __VA_ARGS__ )
1174
1176#define ecs_enum(world, ...)\
1177 ecs_enum_init(world, &(ecs_enum_desc_t) __VA_ARGS__ )
1178
1180#define ecs_bitmask(world, ...)\
1181 ecs_bitmask_init(world, &(ecs_bitmask_desc_t) __VA_ARGS__ )
1182
1184#define ecs_array(world, ...)\
1185 ecs_array_init(world, &(ecs_array_desc_t) __VA_ARGS__ )
1186
1188#define ecs_vector(world, ...)\
1189 ecs_vector_init(world, &(ecs_vector_desc_t) __VA_ARGS__ )
1190
1192#define ecs_opaque(world, ...)\
1193 ecs_opaque_init(world, &(ecs_opaque_desc_t) __VA_ARGS__ )
1194
1196#define ecs_struct(world, ...)\
1197 ecs_struct_init(world, &(ecs_struct_desc_t) __VA_ARGS__ )
1198
1200#define ecs_unit(world, ...)\
1201 ecs_unit_init(world, &(ecs_unit_desc_t) __VA_ARGS__ )
1202
1204#define ecs_unit_prefix(world, ...)\
1205 ecs_unit_prefix_init(world, &(ecs_unit_prefix_desc_t) __VA_ARGS__ )
1206
1208#define ecs_quantity(world, ...)\
1209 ecs_quantity_init(world, &(ecs_entity_desc_t) __VA_ARGS__ )
1210
1211
1220FLECS_API
1221 void FlecsMetaImport(
1222 ecs_world_t *world);
1223
1224#ifdef __cplusplus
1225}
1226#endif
1227
1228#include "meta_c.h"
1229
1230#endif
1231
1233
1234#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.
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.
ecs_bool_t
bool ecs_bool_t
Primitive type definitions.
Definition meta.h:97
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.
ecs_u32_t
uint32_t ecs_u32_t
Builtin u32 type.
Definition meta.h:102
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_i16_t
int16_t ecs_i16_t
Builtin i16 type.
Definition meta.h:106
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_meta_dotmember
FLECS_API int ecs_meta_dotmember(ecs_meta_cursor_t *cursor, const char *name)
Move cursor to member.
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_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
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
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.
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:508
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_meta_elem
FLECS_API int ecs_meta_elem(ecs_meta_cursor_t *cursor, int32_t elem)
Move cursor to a field.
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_type_kind_t
ecs_type_kind_t
Type kinds supported by meta addon.
Definition meta.h:153
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:382
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_META_MAX_SCOPE_DEPTH
#define ECS_META_MAX_SCOPE_DEPTH
Maximum level of type nesting.
Definition meta.h:569
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.
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
ecs_meta_set_char
FLECS_API int ecs_meta_set_char(ecs_meta_cursor_t *cursor, char value)
Set field with char value.
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.
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_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:520
EcsOpScope
@ EcsOpScope
Marks last constant that can open/close a scope.
Definition meta.h:515
ecs_entity_t
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:346
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:390
ecs_id_t
uint64_t ecs_id_t
Ids are the things that can be added to an entity.
Definition flecs.h:339
meta_c.h
Utility macros for populating reflection data in C.
EcsArray
Component added to array type entities.
Definition meta.h:315
EcsArray::count
int32_t count
Number of elements.
Definition meta.h:317
EcsArray::type
ecs_entity_t type
Element type.
Definition meta.h:316
EcsBitmask
Component added to bitmask type entities.
Definition meta.h:309
EcsBitmask::constants
ecs_map_t constants
map<u32_t, ecs_bitmask_constant_t>
Definition meta.h:311
EcsComponent
Component information.
Definition flecs.h:1486
EcsEnum
Component added to enum type entities.
Definition meta.h:286
EcsEnum::constants
ecs_map_t constants
Populated from child entities with Constant component.
Definition meta.h:290
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:390
EcsOpaque::count
size_t(* count)(const void *dst)
Return number of elements.
Definition meta.h:461
EcsOpaque::assign_null
void(* assign_null)(void *dst)
Assign null value.
Definition meta.h:443
EcsOpaque::clear
void(* clear)(void *dst)
Clear collection elements.
Definition meta.h:447
EcsOpaque::assign_uint
void(* assign_uint)(void *dst, uint64_t value)
Assign unsigned int value.
Definition meta.h:416
EcsOpaque::serialize
ecs_meta_serialize_t serialize
Serialize action.
Definition meta.h:392
EcsOpaque::assign_char
void(* assign_char)(void *dst, char value)
Assign char value.
Definition meta.h:406
EcsOpaque::as_type
ecs_entity_t as_type
Type that describes the serialized output.
Definition meta.h:391
EcsOpaque::assign_bool
void(* assign_bool)(void *dst, bool value)
Assign bool value.
Definition meta.h:401
EcsOpaque::assign_string
void(* assign_string)(void *dst, const char *value)
Assign string value.
Definition meta.h:426
EcsOpaque::resize
void(* resize)(void *dst, size_t count)
Resize to number of elements.
Definition meta.h:465
EcsOpaque::assign_int
void(* assign_int)(void *dst, int64_t value)
Assign int value.
Definition meta.h:411
EcsOpaque::assign_float
void(* assign_float)(void *dst, double value)
Assign float value.
Definition meta.h:421
EcsOpaque::assign_entity
void(* assign_entity)(void *dst, ecs_world_t *world, ecs_entity_t entity)
Assign entity value.
Definition meta.h:431
EcsOpaque::assign_id
void(* assign_id)(void *dst, ecs_world_t *world, ecs_id_t id)
Assign (component) id value.
Definition meta.h:437
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:559
EcsTypeSerializer::ops
ecs_vec_t ops
vector<ecs_meta_type_op_t>
Definition meta.h:560
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:495
EcsUnitPrefix::translation
ecs_unit_translation_t translation
Translation of prefix.
Definition meta.h:497
EcsUnitPrefix::symbol
char * symbol
Symbol of prefix (e.g.
Definition meta.h:496
EcsUnit
Component that stores unit data.
Definition meta.h:486
EcsUnit::translation
ecs_unit_translation_t translation
Translation for derived unit.
Definition meta.h:491
EcsUnit::prefix
ecs_entity_t prefix
Order of magnitude prefix relative to derived.
Definition meta.h:488
EcsUnit::symbol
char * symbol
Unit symbol.
Definition meta.h:487
EcsUnit::base
ecs_entity_t base
Base unit (e.g.
Definition meta.h:489
EcsUnit::over
ecs_entity_t over
Over unit (e.g.
Definition meta.h:490
EcsVector
Component added to vector type entities.
Definition meta.h:321
EcsVector::type
ecs_entity_t type
Element type.
Definition meta.h:322
ecs_array_desc_t
Used with ecs_array_init().
Definition meta.h:1005
ecs_array_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:1006
ecs_array_desc_t::type
ecs_entity_t type
Element type.
Definition meta.h:1007
ecs_array_desc_t::count
int32_t count
Number of elements.
Definition meta.h:1008
ecs_bitmask_constant_t
Type that describes an bitmask constant.
Definition meta.h:294
ecs_bitmask_constant_t::value
ecs_flags64_t value
May be set when used with ecs_bitmask_desc_t.
Definition meta.h:299
ecs_bitmask_constant_t::_unused
int64_t _unused
Keep layout the same with ecs_enum_constant_t.
Definition meta.h:302
ecs_bitmask_constant_t::constant
ecs_entity_t constant
Should not be set by ecs_bitmask_desc_t.
Definition meta.h:305
ecs_bitmask_constant_t::name
const char * name
Must be set when used with ecs_bitmask_desc_t.
Definition meta.h:296
ecs_bitmask_desc_t
Used with ecs_bitmask_init().
Definition meta.h:987
ecs_bitmask_desc_t::constants
ecs_bitmask_constant_t constants[(32)]
Bitmask constants.
Definition meta.h:989
ecs_bitmask_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:988
ecs_entity_desc_t
Used with ecs_entity_init().
Definition flecs.h:975
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:282
ecs_enum_constant_t::value_unsigned
uint64_t value_unsigned
For when the underlying type is unsigned.
Definition meta.h:279
ecs_enum_constant_t::value
int64_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:968
ecs_enum_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:969
ecs_enum_desc_t::constants
ecs_enum_constant_t constants[(32)]
Enum constants.
Definition meta.h:970
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:590
ecs_meta_cursor_t::scope
ecs_meta_scope_t scope[(32)]
Cursor scope stack.
Definition meta.h:592
ecs_meta_cursor_t::valid
bool valid
Does the cursor point to a valid field.
Definition meta.h:594
ecs_meta_cursor_t::world
const ecs_world_t * world
The world.
Definition meta.h:591
ecs_meta_cursor_t::lookup_ctx
void * lookup_ctx
Context for lookup_action.
Definition meta.h:599
ecs_meta_cursor_t::depth
int32_t depth
Current scope depth.
Definition meta.h:593
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:595
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:598
ecs_meta_scope_t
Type with information about currently serialized scope.
Definition meta.h:572
ecs_meta_scope_t::opaque
const EcsOpaque * opaque
Opaque type interface.
Definition meta.h:581
ecs_meta_scope_t::prev_depth
int32_t prev_depth
Depth to restore, in case dotmember was used.
Definition meta.h:578
ecs_meta_scope_t::comp
const EcsComponent * comp
Pointer to component, in case size/alignment is needed.
Definition meta.h:580
ecs_meta_scope_t::ptr
void * ptr
Pointer to the value being iterated.
Definition meta.h:579
ecs_meta_scope_t::is_empty_scope
bool is_empty_scope
Was scope populated (for collections)
Definition meta.h:586
ecs_meta_scope_t::vector
ecs_vec_t * vector
Current vector, in case a vector is iterated.
Definition meta.h:582
ecs_meta_scope_t::elem_cur
int32_t elem_cur
Current element (for collections)
Definition meta.h:577
ecs_meta_scope_t::op_cur
int32_t op_cur
Current operation.
Definition meta.h:576
ecs_meta_scope_t::is_inline_array
bool is_inline_array
Is the scope iterating an inline array?
Definition meta.h:585
ecs_meta_scope_t::members
ecs_hashmap_t * members
string -> member index
Definition meta.h:583
ecs_meta_scope_t::ops
ecs_meta_type_op_t * ops
The type operations (see ecs_meta_type_op_t)
Definition meta.h:574
ecs_meta_scope_t::op_count
int32_t op_count
Number of operations in ops array to process.
Definition meta.h:575
ecs_meta_scope_t::type
ecs_entity_t type
The type being iterated.
Definition meta.h:573
ecs_meta_scope_t::is_collection
bool is_collection
Is the scope iterating elements?
Definition meta.h:584
ecs_meta_type_op_t
Meta type serializer instruction data.
Definition meta.h:544
ecs_meta_type_op_t::kind
ecs_meta_type_op_kind_t kind
Instruction opcode.
Definition meta.h:545
ecs_meta_type_op_t::type
ecs_entity_t type
Type entity.
Definition meta.h:551
ecs_meta_type_op_t::count
int32_t count
Number of elements (for inline arrays).
Definition meta.h:547
ecs_meta_type_op_t::size
ecs_size_t size
Size of type of operation.
Definition meta.h:550
ecs_meta_type_op_t::offset
ecs_size_t offset
Offset of current field.
Definition meta.h:546
ecs_meta_type_op_t::name
const char * name
Name of value (only used for struct members)
Definition meta.h:548
ecs_meta_type_op_t::member_index
int32_t member_index
Index of member in struct.
Definition meta.h:552
ecs_meta_type_op_t::members
ecs_hashmap_t * members
string -> member index (structs only)
Definition meta.h:553
ecs_meta_type_op_t::op_count
int32_t op_count
Number of operations until next field or end.
Definition meta.h:549
ecs_opaque_desc_t
Used with ecs_opaque_init().
Definition meta.h:1060
ecs_opaque_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:1061
ecs_opaque_desc_t::type
EcsOpaque type
Type that the opaque type maps to.
Definition meta.h:1062
ecs_primitive_desc_t
Used with ecs_primitive_init().
Definition meta.h:950
ecs_primitive_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:951
ecs_primitive_desc_t::kind
ecs_primitive_kind_t kind
Primitive type kind.
Definition meta.h:952
ecs_serializer_t
Serializer interface.
Definition meta.h:331
ecs_serializer_t::ctx
void * ctx
Serializer context.
Definition meta.h:344
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:333
ecs_serializer_t::member
int(* member)(const struct ecs_serializer_t *ser, const char *member)
Member name.
Definition meta.h:339
ecs_serializer_t::world
const ecs_world_t * world
The world.
Definition meta.h:343
ecs_struct_desc_t
Used with ecs_struct_init().
Definition meta.h:1042
ecs_struct_desc_t::members
ecs_member_t members[(32)]
Struct members.
Definition meta.h:1044
ecs_struct_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:1043
ecs_unit_desc_t
Used with ecs_unit_init().
Definition meta.h:1094
ecs_unit_desc_t::base
ecs_entity_t base
Base unit, e.g.
Definition meta.h:1105
ecs_unit_desc_t::over
ecs_entity_t over
Over unit, e.g.
Definition meta.h:1108
ecs_unit_desc_t::symbol
const char * symbol
Unit symbol, e.g.
Definition meta.h:1099
ecs_unit_desc_t::prefix
ecs_entity_t prefix
Prefix indicating order of magnitude relative to the derived unit.
Definition meta.h:1119
ecs_unit_desc_t::quantity
ecs_entity_t quantity
Unit quantity, e.g.
Definition meta.h:1102
ecs_unit_desc_t::translation
ecs_unit_translation_t translation
Translation to apply to derived unit (optional).
Definition meta.h:1111
ecs_unit_desc_t::entity
ecs_entity_t entity
Existing entity to associate with unit (optional).
Definition meta.h:1096
ecs_unit_prefix_desc_t
Used with ecs_unit_prefix_init().
Definition meta.h:1135
ecs_unit_prefix_desc_t::entity
ecs_entity_t entity
Existing entity to associate with unit prefix (optional).
Definition meta.h:1137
ecs_unit_prefix_desc_t::symbol
const char * symbol
Unit symbol, e.g.
Definition meta.h:1140
ecs_unit_prefix_desc_t::translation
ecs_unit_translation_t translation
Translation to apply to derived unit (optional).
Definition meta.h:1143
ecs_unit_translation_t
Helper type to describe translation between two units.
Definition meta.h:480
ecs_unit_translation_t::power
int32_t power
Power to apply to factor (e.g.
Definition meta.h:482
ecs_unit_translation_t::factor
int32_t factor
Factor to apply (e.g.
Definition meta.h:481
ecs_value_t
Utility to hold a value of a dynamic type.
Definition flecs.h:966
ecs_vector_desc_t
Used with ecs_vector_init().
Definition meta.h:1024
ecs_vector_desc_t::entity
ecs_entity_t entity
Existing entity to use for type (optional).
Definition meta.h:1025
ecs_vector_desc_t::type
ecs_entity_t type
Element type.
Definition meta.h:1026