Skip to content
Flecs v4.1
impl.hpp
Go to the documentation of this file.
1/**
2 * @file addons/cpp/mixins/pipeline/impl.hpp
3 * @brief Pipeline module implementation.
4 */
5
6#pragma once
7
8#include "builder.hpp"
9
10namespace flecs {
11
12template <typename ... Components>
13struct pipeline : entity {
14 pipeline(world_t *world, const ecs_pipeline_desc_t *desc)
15 : entity(world)
16 {
18
19 if (!id_) {
21 }
22 }
23};
24
25inline flecs::pipeline_builder<> world::pipeline(const char *name) const {
27}
28
29template <typename Pipeline, if_not_t< is_enum<Pipeline>::value >>
32}
33
34inline void world::set_pipeline(const flecs::entity pip) const {
35 return ecs_set_pipeline(world_, pip);
36}
37
38template <typename Pipeline>
39inline void world::set_pipeline() const {
41}
42
45}
46
49}
50
53}
54
55template <typename Pipeline, if_not_t< is_enum<Pipeline>::value >>
58}
59
60inline void world::set_threads(int32_t threads) const {
61 ecs_set_threads(world_, threads);
62}
63
64inline int32_t world::get_threads() const {
66}
67
68inline void world::set_task_threads(int32_t task_threads) const {
69 ecs_set_task_threads(world_, task_threads);
70}
71
72inline bool world::using_task_threads() const {
74}
75
76}
#define ECS_INVALID_PARAMETER
Invalid parameter error code.
Definition log.h:671
#define ecs_abort(error_code,...)
Abort.
Definition log.h:464
FLECS_API void ecs_set_threads(ecs_world_t *world, int32_t threads)
Set number of worker threads.
FLECS_API void ecs_set_pipeline(ecs_world_t *world, ecs_entity_t pipeline)
Set a custom pipeline.
FLECS_API ecs_entity_t ecs_get_pipeline(const ecs_world_t *world)
Get the current pipeline.
FLECS_API bool ecs_progress(ecs_world_t *world, ecs_ftime_t delta_time)
Progress a world.
FLECS_API void ecs_run_pipeline(ecs_world_t *world, ecs_entity_t pipeline, ecs_ftime_t delta_time)
Run pipeline.
FLECS_API bool ecs_using_task_threads(ecs_world_t *world)
Return true if task thread use has been requested.
FLECS_API void ecs_set_task_threads(ecs_world_t *world, int32_t task_threads)
Set number of worker task threads.
FLECS_API ecs_entity_t ecs_pipeline_init(ecs_world_t *world, const ecs_pipeline_desc_t *desc)
Create a custom pipeline.
int32_t ecs_get_stage_count(const ecs_world_t *world)
Get the number of configured stages.
ecs_entity_t entity_t
Entity type.
Definition c_types.hpp:21
ecs_world_t world_t
World type.
Definition c_types.hpp:18
void set_threads(int32_t threads) const
Set the number of threads.
Definition impl.hpp:60
void set_pipeline() const
Set the pipeline.
Definition impl.hpp:39
void set_task_threads(int32_t task_threads) const
Set the number of task threads.
Definition impl.hpp:68
void run_pipeline(const flecs::entity_t pip, ecs_ftime_t delta_time=0.0) const
Run a pipeline.
Definition impl.hpp:51
flecs::pipeline_builder pipeline() const
Create a new pipeline.
Definition impl.hpp:30
bool using_task_threads() const
Return true if task thread use has been requested.
Definition impl.hpp:72
bool progress(ecs_ftime_t delta_time=0.0) const
Progress the world one tick.
Definition impl.hpp:47
int32_t get_threads() const
Get the number of threads.
Definition impl.hpp:64
flecs::entity get_pipeline() const
Get the pipeline.
Definition impl.hpp:43
#define ecs_ftime_t
Customizable precision for scalar time values.
Definition flecs.h:59
Pipeline builder.
Pipeline descriptor, used with ecs_pipeline_init().
Definition pipeline.h:88
Entity.
Definition entity.hpp:30
entity()
Default constructor.
Definition entity.hpp:32
flecs::id_t id_
The raw ID value.
Definition decl.hpp:154
Pipeline builder.
Definition builder.hpp:24
The world.
Definition world.hpp:129
world_t * world_
Pointer to the underlying C world.
Definition world.hpp:1009
ecs_ftime_t delta_time() const
Get delta_time.
Definition world.hpp:905