9FLECS_ENUM_LAST(flecs::meta::primitive_kind_t, flecs::meta::PrimitiveKindLast)
16template <
typename EntityType>
21 flecs::entity_t
id = data->id();
22 return ser->
value(flecs::Entity, &
id);
25 [](EntityType *dst, flecs::world_t *world, flecs::entity_t e) {
26 *dst = EntityType(world, e);
31 world.
component<bool_t>(
"flecs::meta::bool");
32 world.
component<char_t>(
"flecs::meta::char");
34 world.
component<u16_t>(
"flecs::meta::u16");
35 world.
component<u32_t>(
"flecs::meta::u32");
36 world.
component<u64_t>(
"flecs::meta::u64");
38 world.
component<i16_t>(
"flecs::meta::i16");
39 world.
component<i32_t>(
"flecs::meta::i32");
40 world.
component<i64_t>(
"flecs::meta::i64");
41 world.
component<f32_t>(
"flecs::meta::f32");
42 world.
component<f64_t>(
"flecs::meta::f64");
44 world.
component<type_kind_t>(
"flecs::meta::type_kind");
45 world.
component<primitive_kind_t>(
"flecs::meta::primitive_kind");
46 world.
component<member_t>(
"flecs::meta::member");
47 world.
component<enum_constant_t>(
"flecs::meta::enum_constant");
48 world.
component<bitmask_constant_t>(
"flecs::meta::bitmask_constant");
50 world.
component<MetaType>(
"flecs::meta::MetaType");
51 world.
component<MetaTypeSerialized>(
"flecs::meta::MetaTypeSerialized");
52 world.
component<Primitive>(
"flecs::meta::Primitive");
53 world.
component<Enum>(
"flecs::meta::Enum");
54 world.
component<Bitmask>(
"flecs::meta::Bitmask");
55 world.
component<Member>(
"flecs::meta::Member");
56 world.
component<Struct>(
"flecs::meta::Struct");
57 world.
component<Array>(
"flecs::meta::Array");
58 world.
component<Vector>(
"flecs::meta::Vector");
60 world.
component<Unit>(
"flecs::meta::Unit");
66 if (!flecs::is_same<i32_t, iptr_t>() && !flecs::is_same<i64_t, iptr_t>()) {
68 ecs_assert(flecs::type_id<iptr_t>() == flecs::Iptr,
69 ECS_INTERNAL_ERROR, NULL);
75 if (!flecs::is_same<u32_t, uptr_t>() && !flecs::is_same<u64_t, uptr_t>()) {
77 ecs_assert(flecs::type_id<uptr_t>() == flecs::Uptr,
78 ECS_INTERNAL_ERROR, NULL);
86 .
opaque(flecs_entity_support<flecs::entity_view>);
89 .
opaque(flecs_entity_support<flecs::entity>);
114 ecs_assert(eid != 0, ECS_INVALID_OPERATION, NULL);
122 desc.count = array_count;
124 ecs_assert(eid != 0, ECS_INVALID_OPERATION, NULL);
131 return this->
array(_::cpp_type<T>::id(m_world), array_count);
138 ecs_assert(eid != 0, ECS_INVALID_OPERATION, NULL);
144 return this->
vector(_::cpp_type<T>::id());
150 return this->value_(
this, type, v);
156 const_cast<flecs::world_t*
>(this->world)), &v);
160 return this->member_(
this, name);
component & opaque(const Func &type_support)
Register opaque type interface.
#define ecs_assert(condition, error_code,...)
Assert.
ecs_id_t ecs_entity_t
An entity identifier.
flecs::component< T > component(Args &&... args) const
Find or register component.
Used with ecs_array_init.
Used with ecs_primitive_init.
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.
Used with ecs_vector_init.
flecs::entity get_type() const
Get type of value.
ecs_meta_cursor_t m_cursor
Cursor object.
flecs::entity get_entity() const
Get entity value.
flecs::entity get_unit() const
Get unit of value.
Type safe interface for opaque types.
opaque & as_type(flecs::id_t func)
Type that describes the type kind/structure of the opaque type.
opaque & serialize(flecs::serialize< T > func)
Serialize function.