Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
builder.hpp
Go to the documentation of this file.
1
6#pragma once
7
9#include "builder_i.hpp"
10
11namespace flecs {
12namespace _ {
13 template <typename ... Components>
14 using pipeline_builder_base = builder<
15 pipeline, ecs_pipeline_desc_t, pipeline_builder<Components...>,
16 pipeline_builder_i, Components ...>;
17}
18
23template <typename ... Components>
24struct pipeline_builder final : _::pipeline_builder_base<Components...> {
27 : _::pipeline_builder_base<Components...>(world)
28 {
29 _::sig<Components...>(world).populate(this);
30 this->desc_.entity = id;
31 }
32
35 : _::pipeline_builder_base<Components...>(world)
36 {
37 _::sig<Components...>(world).populate(this);
38 if (name != nullptr) {
39 ecs_entity_desc_t entity_desc = {};
40 entity_desc.name = name;
41 entity_desc.sep = "::";
42 entity_desc.root_sep = "::";
43 this->desc_.entity = ecs_entity_init(world, &entity_desc);
44 }
45 }
46};
47
48}
struct ecs_pipeline_desc_t ecs_pipeline_desc_t
Pipeline descriptor, used with ecs_pipeline_init().
ecs_entity_t entity_t
Entity type.
Definition c_types.hpp:21
ecs_world_t world_t
World type.
Definition c_types.hpp:18
ecs_entity_t ecs_entity_init(ecs_world_t *world, const ecs_entity_desc_t *desc)
Find or create an entity.
Pipeline builder interface.
Used with ecs_entity_init().
Definition flecs.h:1075
const char * sep
Optional custom separator for hierarchical names.
Definition flecs.h:1087
const char * root_sep
Optional, used for identifiers relative to the root.
Definition flecs.h:1091
const char * name
Name of the entity.
Definition flecs.h:1082
Class that wraps around a flecs::id_t.
Definition decl.hpp:27
Pipeline builder.
Definition builder.hpp:24
pipeline_builder(flecs::world_t *world, const char *name)
Construct a named pipeline builder.
Definition builder.hpp:34
pipeline_builder(flecs::world_t *world, flecs::entity_t id=0)
Construct a pipeline builder.
Definition builder.hpp:26
The world.
Definition world.hpp:244
Builder base class.