Flecs v3.2
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::system_builder_i< Base, Components > Struct Template Referenceabstract

System builder interface. More...

#include <builder_i.hpp>

Inheritance diagram for flecs::system_builder_i< Base, Components >:
flecs::query_builder_i< Base, Components ... > flecs::filter_builder_i< Base, Components ... > flecs::term_builder_i< Base > flecs::term_id_builder_i< Base >

Public Member Functions

 system_builder_i (ecs_system_desc_t *desc)
 
Base & kind (entity_t phase)
 Specify in which phase the system should run. More...
 
template<typename Phase >
Base & kind ()
 Specify in which phase the system should run. More...
 
Base & multi_threaded (bool value=true)
 Specify whether system can run on multiple threads. More...
 
Base & no_readonly (bool value=true)
 Specify whether system should be ran in staged context. More...
 
Base & interval (ecs_ftime_t interval)
 Set system interval. More...
 
Base & rate (const entity_t tick_source, int32_t rate)
 Set system rate. More...
 
Base & rate (int32_t rate)
 Set system rate. More...
 
Base & tick_source (flecs::entity_t tick_source)
 Set tick source. More...
 
Base & ctx (void *ptr)
 Set system context. More...
 
Base & run (ecs_iter_action_t action)
 Set system run callback. More...
 
- Public Member Functions inherited from flecs::query_builder_i< Base, Components ... >
 query_builder_i (ecs_query_desc_t *desc, int32_t term_index=0)
 
Base & order_by (int(*compare)(flecs::entity_t, const T *, flecs::entity_t, const T *))
 Sort the output of a query. More...
 
Base & order_by (flecs::entity_t component, int(*compare)(flecs::entity_t, const void *, flecs::entity_t, const void *))
 Sort the output of a query. More...
 
Base & group_by (uint64_t(*group_by_action)(flecs::world_t *, flecs::table_t *table, flecs::id_t id, void *ctx))
 Group and sort matched tables. More...
 
Base & group_by (flecs::entity_t component, uint64_t(*group_by_action)(flecs::world_t *, flecs::table_t *table, flecs::id_t id, void *ctx))
 Group and sort matched tables. More...
 
Base & group_by ()
 Group and sort matched tables. More...
 
Base & group_by (flecs::entity_t component)
 Group and sort matched tables. More...
 
Base & group_by_ctx (void *ctx, ecs_ctx_free_t ctx_free=nullptr)
 Specify context to be passed to group_by function. More...
 
Base & on_group_create (ecs_group_create_action_t action)
 Specify on_group_create action. More...
 
Base & on_group_delete (ecs_group_delete_action_t action)
 Specify on_group_delete action. More...
 
Base & observable (const query_base &parent)
 Specify parent query (creates subquery) More...
 
- Public Member Functions inherited from flecs::filter_builder_i< Base, Components ... >
 filter_builder_i (ecs_filter_desc_t *desc, int32_t term_index=0)
 
Base & instanced ()
 
Base & filter_flags (ecs_flags32_t flags)
 
Base & expr (const char *expr)
 
Base & with (Args &&... args)
 
Base & with (Args &&... args)
 
Base & with ()
 
Base & without (Args &&... args)
 
Base & without (Args &&... args)
 
Base & without ()
 
Base & write ()
 
Base & write (Args &&... args)
 
Base & write (Args &&... args)
 
Base & write ()
 
Base & read ()
 
Base & read (Args &&... args)
 
Base & read (Args &&... args)
 
Base & read ()
 
Base & scope_open ()
 
Base & scope_close ()
 
Base & term ()
 
Base & term ()
 
Base & term (id_t id)
 
Base & term (const char *name)
 
Base & term (const char *first, const char *second)
 
Base & term (entity_t r, entity_t o)
 
Base & term (entity_t r, const char *o)
 
Base & term (id_t o)
 
Base & term (const char *second)
 
Base & term ()
 
Base & term (E value)
 
Base & term (flecs::term &term)
 
Base & term (flecs::term &&term)
 
Base & term_at (int32_t term_index)
 
Base & arg (int32_t term_index)
 
- Public Member Functions inherited from flecs::term_builder_i< Base >
 term_builder_i (ecs_term_t *term_ptr)
 
Base & term (id_t id)
 
Base & src ()
 
Base & first ()
 
Base & second ()
 
Base & src (flecs::entity_t id)
 
template<typename T >
Base & src ()
 
Base & src (const char *name)
 
Base & first (flecs::entity_t id)
 
template<typename T >
Base & first ()
 
Base & first (const char *name)
 
Base & second (flecs::entity_t id)
 
template<typename T >
Base & second ()
 
Base & second (const char *name)
 
Base & role (id_t role)
 Set role of term. More...
 
Base & inout (flecs::inout_kind_t inout)
 Set read/write access of term. More...
 
Base & inout_stage (flecs::inout_kind_t inout)
 Set read/write access for stage. More...
 
Base & write ()
 Short for inout_stage(flecs::Out). More...
 
Base & read ()
 Short for inout_stage(flecs::In). More...
 
Base & read_write ()
 Short for inout_stage(flecs::InOut). More...
 
Base & in ()
 Short for inout(flecs::In) More...
 
Base & out ()
 Short for inout(flecs::Out) More...
 
Base & inout ()
 Short for inout(flecs::InOut) More...
 
Base & inout_none ()
 Short for inout(flecs::In) More...
 
Base & oper (flecs::oper_kind_t oper)
 Set operator of term. More...
 
Base & and_ ()
 
Base & or_ ()
 
Base & not_ ()
 
Base & optional ()
 
Base & and_from ()
 
Base & or_from ()
 
Base & not_from ()
 
Base & singleton ()
 Match singleton. More...
 
Base & filter ()
 
- Public Member Functions inherited from flecs::term_id_builder_i< Base >
Base & self ()
 
Base & up (flecs::entity_t trav=0)
 
template<typename Trav >
Base & up ()
 
Base & cascade (flecs::entity_t trav=0)
 
template<typename Trav >
Base & cascade ()
 
Base & parent ()
 
Base & trav (flecs::entity_t trav, flecs::flags32_t flags=0)
 
Base & id (flecs::entity_t id)
 
Base & entity (flecs::entity_t entity)
 
Base & name (const char *name)
 
Base & var (const char *var_name)
 
Base & flags (flecs::flags32_t flags)
 

Protected Member Functions

virtual flecs::world_t * world_v ()=0
 
virtual flecs::world_t * world_v ()=0
 
virtual flecs::world_t * world_v ()=0
 
- Protected Member Functions inherited from flecs::term_builder_i< Base >
virtual flecs::world_t * world_v ()=0
 
void set_term (ecs_term_t *term)
 
virtual flecs::world_t * world_v ()=0
 

Additional Inherited Members

- Public Attributes inherited from flecs::term_builder_i< Base >
ecs_term_tm_term
 
- Public Attributes inherited from flecs::term_id_builder_i< Base >
ecs_term_id_tm_term_id
 
- Protected Attributes inherited from flecs::filter_builder_i< Base, Components ... >
int32_t m_term_index
 
int32_t m_expr_count
 

Detailed Description

template<typename Base, typename ... Components>
struct flecs::system_builder_i< Base, Components >

System builder interface.

Definition at line 18 of file builder_i.hpp.

Constructor & Destructor Documentation

◆ system_builder_i()

template<typename Base , typename ... Components>
flecs::system_builder_i< Base, Components >::system_builder_i ( ecs_system_desc_t desc)
inline

Definition at line 23 of file builder_i.hpp.

Member Function Documentation

◆ ctx()

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::ctx ( void *  ptr)
inline

Set system context.

Definition at line 121 of file builder_i.hpp.

◆ interval()

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::interval ( ecs_ftime_t  interval)
inline

Set system interval.

This operation will cause the system to be ran at the specified interval.

The timer is synchronous, and is incremented each frame by delta_time.

Parameters
intervalThe interval value.

Definition at line 79 of file builder_i.hpp.

◆ kind() [1/2]

template<typename Base , typename ... Components>
template<typename Phase >
Base & flecs::system_builder_i< Base, Components >::kind ( )
inline

Specify in which phase the system should run.

Template Parameters
PhaseThe phase.

Definition at line 50 of file builder_i.hpp.

◆ kind() [2/2]

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::kind ( entity_t  phase)
inline

Specify in which phase the system should run.

Parameters
phaseThe phase.

Definition at line 31 of file builder_i.hpp.

◆ multi_threaded()

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::multi_threaded ( bool  value = true)
inline

Specify whether system can run on multiple threads.

Parameters
valueIf false system will always run on a single thread.

Definition at line 58 of file builder_i.hpp.

◆ no_readonly()

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::no_readonly ( bool  value = true)
inline

Specify whether system should be ran in staged context.

Parameters
valueIf false system will always run staged.

Definition at line 67 of file builder_i.hpp.

◆ rate() [1/2]

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::rate ( const entity_t  tick_source,
int32_t  rate 
)
inline

Set system rate.

This operation will cause the system to be ran at a multiple of the provided tick source. The tick source may be any entity, including another system.

Parameters
tick_sourceThe tick source.
rateThe multiple at which to run the system.

Definition at line 92 of file builder_i.hpp.

◆ rate() [2/2]

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::rate ( int32_t  rate)
inline

Set system rate.

This operation will cause the system to be ran at a multiple of the frame tick frequency. If a tick source was provided, this just updates the rate of the system.

Parameters
rateThe multiple at which to run the system.

Definition at line 105 of file builder_i.hpp.

◆ run()

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::run ( ecs_iter_action_t  action)
inline

Set system run callback.

Definition at line 127 of file builder_i.hpp.

◆ tick_source()

template<typename Base , typename ... Components>
Base & flecs::system_builder_i< Base, Components >::tick_source ( flecs::entity_t  tick_source)
inline

Set tick source.

This operation sets a shared tick source for the system.

Parameters
tick_sourceThe tick source to use for the system.

Definition at line 115 of file builder_i.hpp.

◆ world_v()

template<typename Base , typename ... Components>
virtual flecs::world_t * flecs::system_builder_i< Base, Components >::world_v ( )
protectedpure virtual

The documentation for this struct was generated from the following file: