Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
ecs_system_desc_t Struct Reference

Use with ecs_system_init() to create or update a system. More...

#include <system.h>

Public Attributes

int32_t _canary
 
ecs_entity_t entity
 Existing entity to associate with system (optional)
 
ecs_query_desc_t query
 System query parameters.
 
ecs_iter_action_t callback
 Callback that is ran for each result returned by the system's query.
 
ecs_run_action_t run
 Callback that is invoked when a system is ran.
 
void * ctx
 Context to be passed to callback (as ecs_iter_t::param)
 
ecs_ctx_free_t ctx_free
 Callback to free ctx.
 
void * callback_ctx
 Context associated with callback (for language bindings).
 
ecs_ctx_free_t callback_ctx_free
 Callback to free callback ctx.
 
void * run_ctx
 Context associated with run (for language bindings).
 
ecs_ctx_free_t run_ctx_free
 Callback to free run ctx.
 
ecs_ftime_t interval
 Interval in seconds at which the system should run.
 
int32_t rate
 Rate at which the system should run.
 
ecs_entity_t tick_source
 External tick source that determines when system ticks.
 
bool multi_threaded
 If true, system will be ran on multiple threads.
 
bool immediate
 If true, system will have access to the actual world.
 

Detailed Description

Use with ecs_system_init() to create or update a system.

Definition at line 38 of file system.h.

Member Data Documentation

◆ _canary

int32_t ecs_system_desc_t::_canary

Definition at line 39 of file system.h.

◆ callback

ecs_iter_action_t ecs_system_desc_t::callback

Callback that is ran for each result returned by the system's query.

This means that this callback can be invoked multiple times per system per frame, typically once for each matching table.

Definition at line 50 of file system.h.

◆ callback_ctx

void* ecs_system_desc_t::callback_ctx

Context associated with callback (for language bindings).

Definition at line 72 of file system.h.

◆ callback_ctx_free

ecs_ctx_free_t ecs_system_desc_t::callback_ctx_free

Callback to free callback ctx.

Definition at line 75 of file system.h.

◆ ctx

void* ecs_system_desc_t::ctx

Context to be passed to callback (as ecs_iter_t::param)

Definition at line 66 of file system.h.

◆ ctx_free

ecs_ctx_free_t ecs_system_desc_t::ctx_free

Callback to free ctx.

Definition at line 69 of file system.h.

◆ entity

ecs_entity_t ecs_system_desc_t::entity

Existing entity to associate with system (optional)

Definition at line 42 of file system.h.

◆ immediate

bool ecs_system_desc_t::immediate

If true, system will have access to the actual world.

Cannot be true at the same time as multi_threaded.

Definition at line 97 of file system.h.

◆ interval

ecs_ftime_t ecs_system_desc_t::interval

Interval in seconds at which the system should run.

Definition at line 84 of file system.h.

◆ multi_threaded

bool ecs_system_desc_t::multi_threaded

If true, system will be ran on multiple threads.

Definition at line 93 of file system.h.

◆ query

ecs_query_desc_t ecs_system_desc_t::query

System query parameters.

Definition at line 45 of file system.h.

◆ rate

int32_t ecs_system_desc_t::rate

Rate at which the system should run.

Definition at line 87 of file system.h.

◆ run

ecs_run_action_t ecs_system_desc_t::run

Callback that is invoked when a system is ran.

When left to NULL, the default system runner is used, which calls the "callback" action for each result returned from the system's query.

It should not be assumed that the input iterator can always be iterated with ecs_query_next(). When a system is multithreaded and/or paged, the iterator can be either a worker or paged iterator. The correct function to use for iteration is ecs_iter_next().

An implementation can test whether the iterator is a query iterator by testing whether the it->next value is equal to ecs_query_next().

Definition at line 63 of file system.h.

◆ run_ctx

void* ecs_system_desc_t::run_ctx

Context associated with run (for language bindings).

Definition at line 78 of file system.h.

◆ run_ctx_free

ecs_ctx_free_t ecs_system_desc_t::run_ctx_free

Callback to free run ctx.

Definition at line 81 of file system.h.

◆ tick_source

ecs_entity_t ecs_system_desc_t::tick_source

External tick source that determines when system ticks.

Definition at line 90 of file system.h.


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