Skip to content

Engine → ECS → system.h

system_desc

Syntax

struct system_desc

Variables

AccessNameTypeDefaultDescription
publicaftercore::small_vector<core::string_id, 4>{}
publicbeforecore::small_vector<core::string_id, 4>{}
publicflagssystem_flagssystem_flags::NONE
publicnamecore::string_id{}
publicphasesystem_phasesystem_phase::UPDATE
publicreadscomponent_mask{}
publicwritescomponent_mask{}

Functions

Public

void

std::function<void(
    system_context &context)> run =;
std::function<void(
    const component_registry &registry,
    component_mask &reads,
    component_mask &writes)> resolveAccess =;

Optional: resolves component types into reads/writes once the registry is known (make_system fills this so a system_desc needs no registry at construction). Called by scheduler::add_system and merged into reads/writes, and called again, on the owner thread, whenever the registry has gained component types since: a type or name the registry did not know yet is left out and joins the access set once it is registered. The hook therefore only ever sets bits, gives the same answer for the same registry, and owns whatever it captures for as long as the system is registered.