Skip to content

Engine → ECS

system.h

Systems.

Structs

File Description
system_desc Everything the scheduler needs to run one system.
system_scratch Per-system scratch storage reused across runs: grain command buffers and the chunk list of parallel_for_chunks. Owned by the scheduler's system record (or by the caller of a standalone system_context).
system_scratch::chunk_ref One flattened chunk of a parallel_for_chunks dispatch.

Classes

File Description
system_context The arguments of one system run.

Enumerations

system_flags

enum class system_flags : u32 {
    NONE = 0,
    MAIN_THREAD = 1 << 0,            // runs on the run_phase caller thread, last in its stage
    EXCLUSIVE = 1 << 1,              // alone in its stage, receives an unlocked world
    DISABLED = 1 << 2,
    RUNS_WHILE_PAUSED = 1 << 3       // selected by run_phase_filtered while the engine is PAUSED
};

Execution properties of a system. Neither thread bit set means PARALLEL: the system runs as a job alongside the other systems of its stage.

Forward Declarations

scheduler

class scheduler;

Macros

CONJURE_ENUM_FLAGS

CONJURE_ENUM_FLAGS(system_flags)

Functions

Public

detail::collect_pack_access

template <typename PackType> void collect_pack_access(const component_registry &registry, component_mask &reads, component_mask &writes);

make_system

template <typename... ComponentTypes> [[nodiscard]] system_desc make_system(
    core::string_id name,
    system_phase target,
    std::function<void(system_context &context)> run);

A system_desc whose reads/writes derive from the pack (const T read, T write, maybe<T> by constness) so the common one-view system declares nothing by hand. The pack is resolved against the world's registry when the system is added; a type that is not registered yet is left out and joins the access set once it is (the scheduler resolves again when the registry has grown).

parallel_for_each_chunk

template <typename... ComponentTypes> template <typename Callable> void view<ComponentTypes...>::parallel_for_each_chunk(
    system_context &context,
    Callable &&callable);