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

Use with ecs_system_init() 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_run_action_t run
 Callback that is invoked when a system is ran.
 
ecs_iter_action_t callback
 Callback that is ran for each result returned by the system's query.
 
void * ctx
 Context to be passed to callback (as ecs_iter_t::param)
 
void * binding_ctx
 Binding context, for when system is implemented in other language.
 
ecs_ctx_free_t ctx_free
 Functions that are invoked during system cleanup to free context data.
 
ecs_ctx_free_t binding_ctx_free
 
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 no_readonly
 If true, system will have access to the actual world.
 

Detailed Description

Use with ecs_system_init()

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.

◆ binding_ctx

void* ecs_system_desc_t::binding_ctx

Binding context, for when system is implemented in other language.

Definition at line 70 of file system.h.

◆ binding_ctx_free

ecs_ctx_free_t ecs_system_desc_t::binding_ctx_free

Definition at line 76 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 64 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 67 of file system.h.

◆ ctx_free

ecs_ctx_free_t ecs_system_desc_t::ctx_free

Functions that are invoked during system cleanup to free context data.

When set, functions are called unconditionally, even when the ctx pointers are NULL.

Definition at line 75 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.

◆ interval

ecs_ftime_t ecs_system_desc_t::interval

Interval in seconds at which the system should run.

Definition at line 79 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 88 of file system.h.

◆ no_readonly

bool ecs_system_desc_t::no_readonly

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

Cannot be true at the same time as multi_threaded.

Definition at line 92 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 82 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. Future use cases may introduce additional inputs for a system, such as rules and filters. 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 59 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 85 of file system.h.


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