Flecs: include/flecs/addons/cpp/mixins/meta/decl.hpp 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
decl.hpp
Go to the documentation of this file.
1
5
6#pragma once
7
8namespace flecs {
9
17
18/* Primitive type aliases */
19using bool_t = ecs_bool_t;
20using char_t = ecs_char_t;
21using u8_t = ecs_u8_t;
22using u16_t = ecs_u16_t;
23using u32_t = ecs_u32_t;
24using u64_t = ecs_u64_t;
25using uptr_t = ecs_uptr_t;
26using i8_t = ecs_i8_t;
27using i16_t = ecs_i16_t;
28using i32_t = ecs_i32_t;
29using i64_t = ecs_i64_t;
30using iptr_t = ecs_iptr_t;
31using f32_t = ecs_f32_t;
32using f64_t = ecs_f64_t;
33
34/* Embedded type aliases */
35using member_t = ecs_member_t;
36using enum_constant_t = ecs_enum_constant_t;
37using bitmask_constant_t = ecs_bitmask_constant_t;
38
39/* Components */
40using Type = EcsType;
41using TypeSerializer = EcsTypeSerializer;
42using Primitive = EcsPrimitive;
43using Enum = EcsEnum;
44using Bitmask = EcsBitmask;
45using Member = EcsMember;
46using MemberRanges = EcsMemberRanges;
47using Struct = EcsStruct;
48using Array = EcsArray;
49using Vector = EcsVector;
50using Unit = EcsUnit;
51
53 struct bitmask {
54 uint32_t value;
55};
56
57/* Handles to builtin reflection types */
58static const flecs::entity_t Bool = ecs_id(ecs_bool_t);
59static const flecs::entity_t Char = ecs_id(ecs_char_t);
60static const flecs::entity_t Byte = ecs_id(ecs_byte_t);
61static const flecs::entity_t U8 = ecs_id(ecs_u8_t);
62static const flecs::entity_t U16 = ecs_id(ecs_u16_t);
63static const flecs::entity_t U32 = ecs_id(ecs_u32_t);
64static const flecs::entity_t U64 = ecs_id(ecs_u64_t);
65static const flecs::entity_t Uptr = ecs_id(ecs_uptr_t);
66static const flecs::entity_t I8 = ecs_id(ecs_i8_t);
67static const flecs::entity_t I16 = ecs_id(ecs_i16_t);
68static const flecs::entity_t I32 = ecs_id(ecs_i32_t);
69static const flecs::entity_t I64 = ecs_id(ecs_i64_t);
70static const flecs::entity_t Iptr = ecs_id(ecs_iptr_t);
71static const flecs::entity_t F32 = ecs_id(ecs_f32_t);
72static const flecs::entity_t F64 = ecs_id(ecs_f64_t);
73static const flecs::entity_t String = ecs_id(ecs_string_t);
74static const flecs::entity_t Entity = ecs_id(ecs_entity_t);
75static const flecs::entity_t Quantity = EcsQuantity;
76
77namespace meta {
78
79/* Type kinds supported by reflection system */
80using type_kind_t = ecs_type_kind_t;
81static const type_kind_t PrimitiveType = EcsPrimitiveType;
82static const type_kind_t BitmaskType = EcsBitmaskType;
83static const type_kind_t EnumType = EcsEnumType;
84static const type_kind_t StructType = EcsStructType;
85static const type_kind_t ArrayType = EcsArrayType;
86static const type_kind_t VectorType = EcsVectorType;
87static const type_kind_t CustomType = EcsOpaqueType;
88static const type_kind_t TypeKindLast = EcsTypeKindLast;
89
90/* Primitive type kinds supported by reflection system */
91using primitive_kind_t = ecs_primitive_kind_t;
92static const primitive_kind_t Bool = EcsBool;
93static const primitive_kind_t Char = EcsChar;
94static const primitive_kind_t Byte = EcsByte;
95static const primitive_kind_t U8 = EcsU8;
96static const primitive_kind_t U16 = EcsU16;
97static const primitive_kind_t U32 = EcsU32;
98static const primitive_kind_t U64 = EcsU64;
99static const primitive_kind_t I8 = EcsI8;
100static const primitive_kind_t I16 = EcsI16;
101static const primitive_kind_t I32 = EcsI32;
102static const primitive_kind_t I64 = EcsI64;
103static const primitive_kind_t F32 = EcsF32;
104static const primitive_kind_t F64 = EcsF64;
105static const primitive_kind_t UPtr = EcsUPtr;
106static const primitive_kind_t IPtr = EcsIPtr;
107static const primitive_kind_t String = EcsString;
108static const primitive_kind_t Entity = EcsEntity;
109static const primitive_kind_t PrimitiveKindLast = EcsPrimitiveKindLast;
110
111using op_t = ecs_meta_op_t;
112
114
115namespace _ {
116
117void init(flecs::world& world);
118
119} // namespace _
120} // namespace meta
121} // namespace flecs
122
123#include "cursor.hpp"
124#include "opaque.hpp"
ecs_id
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component id for EcsDocDescription.
EcsMember
struct EcsMember EcsMember
Component added to member entities.
EcsPrimitive
struct EcsPrimitive EcsPrimitive
Component added to primitive types.
ecs_bool_t
bool ecs_bool_t
Primitive type definitions.
Definition meta.h:95
EcsEnum
struct EcsEnum EcsEnum
Component added to enum type entities.
ecs_u32_t
uint32_t ecs_u32_t
Builtin u32 type.
Definition meta.h:100
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:104
EcsStruct
struct EcsStruct EcsStruct
Component added to struct type entities.
ecs_u8_t
uint8_t ecs_u8_t
Builtin u8 type.
Definition meta.h:98
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:106
ecs_string_t
char * ecs_string_t
Builtin string type.
Definition meta.h:110
EcsBitmask
struct EcsBitmask EcsBitmask
Component added to bitmask type entities.
ecs_u64_t
uint64_t ecs_u64_t
Builtin u64 type.
Definition meta.h:101
ecs_iptr_t
intptr_t ecs_iptr_t
Builtin iptr type.
Definition meta.h:107
ecs_uptr_t
uintptr_t ecs_uptr_t
Builtin uptr type.
Definition meta.h:102
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:108
ecs_primitive_kind_t
ecs_primitive_kind_t
Primitive type kinds supported by meta addon.
Definition meta.h:170
EcsArray
struct EcsArray EcsArray
Component added to array type entities.
ecs_f64_t
double ecs_f64_t
Builtin f64 type.
Definition meta.h:109
ecs_char_t
char ecs_char_t
Builtin char type.
Definition meta.h:96
ecs_enum_constant_t
struct ecs_enum_constant_t ecs_enum_constant_t
Type that describes an enum constant.
ecs_type_kind_t
ecs_type_kind_t
Type kinds supported by meta addon.
Definition meta.h:151
ecs_u16_t
uint16_t ecs_u16_t
Builtin u16 type.
Definition meta.h:99
ecs_i32_t
int32_t ecs_i32_t
Builtin i32 type.
Definition meta.h:105
EcsType
struct EcsType EcsType
Component that is automatically added to every type with the right kind.
ecs_i8_t
int8_t ecs_i8_t
Builtin i8 type.
Definition meta.h:103
ecs_byte_t
unsigned char ecs_byte_t
Builtin ecs_byte type.
Definition meta.h:97
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_entity_t
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:361
flecs::_
Int to enum.
Definition component.hpp:18
opaque.hpp
Helpers for opaque type registration.
ecs_meta_op_t
Meta type serializer instruction data.
Definition meta.h:568
flecs::bitmask
Base type for bitmasks.
Definition decl.hpp:53
flecs::world
The world.
Definition world.hpp:158