Compiles query terms into matching bytecode and evaluates that bytecode against archetypes. The VM owns query matching and cache construction only. Row, chunk, entity-seed, sorted, traversal, and mapped typed callback dispatch are selected later by QueryImpl::QueryPlan.
More...
#include <vm.h>
|
| GAIA_NODISCARD util::str | bytecode (const World &world) const |
| | Formats the compiled query bytecode for diagnostics.
|
| |
| void | compile (const EntityToArchetypeMap &entityToArchetypeMap, std::span< const Archetype * > allArchetypes, QueryCtx &queryCtx) |
| | Transforms inputs into virtual machine opcodes.
|
| |
| GAIA_NODISCARD bool | is_compiled () const |
| | Returns whether this VM contains compiled executable opcodes.
|
| |
| GAIA_NODISCARD uint32_t | op_count () const |
| | Returns the total number of compiled opcodes.
|
| |
| GAIA_NODISCARD uint64_t | op_signature () const |
| | Computes a stable signature of the compiled opcode stream.
|
| |
| void | exec (MatchingCtx &ctx) |
| | Executes compiled query-matching opcodes.
|
| |
Compiles query terms into matching bytecode and evaluates that bytecode against archetypes. The VM owns query matching and cache construction only. Row, chunk, entity-seed, sorted, traversal, and mapped typed callback dispatch are selected later by QueryImpl::QueryPlan.
◆ bytecode()
| GAIA_NODISCARD util::str gaia::ecs::vm::VirtualMachine::bytecode |
( |
const World & |
world | ) |
const |
|
inline |
Formats the compiled query bytecode for diagnostics.
- Parameters
-
| world | World used to resolve entity names in the output. |
- Returns
- Human-readable bytecode and operand metadata.
◆ compile()
Transforms inputs into virtual machine opcodes.
- Parameters
-
| entityToArchetypeMap | Component-to-archetype lookup available during compilation. |
| allArchetypes | Archetypes available during compilation. |
| queryCtx | Query definition and dependency metadata to compile. |
◆ exec()
| void gaia::ecs::vm::VirtualMachine::exec |
( |
MatchingCtx & |
ctx | ) |
|
|
inline |
Executes compiled query-matching opcodes.
- Parameters
-
| ctx | Matching state updated with the resulting archetypes. |
◆ is_compiled()
| GAIA_NODISCARD bool gaia::ecs::vm::VirtualMachine::is_compiled |
( |
| ) |
const |
|
inline |
Returns whether this VM contains compiled executable opcodes.
- Returns
- True when compilation produced at least one opcode.
◆ op_count()
| GAIA_NODISCARD uint32_t gaia::ecs::vm::VirtualMachine::op_count |
( |
| ) |
const |
|
inline |
Returns the total number of compiled opcodes.
- Returns
- Number of compiled opcodes, including variable-search programs.
◆ op_signature()
| GAIA_NODISCARD uint64_t gaia::ecs::vm::VirtualMachine::op_signature |
( |
| ) |
const |
|
inline |
Computes a stable signature of the compiled opcode stream.
- Returns
- Hash of opcode kinds, control-flow targets, operands, and costs.
The documentation for this class was generated from the following file:
- /home/runner/work/gaia-ecs/gaia-ecs/include/gaia/ecs/vm.h