Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::aot::CallArena Class Reference

#include <AotHost.hpp>

Public Member Functions

 CallArena (std::uint32_t cmdCap=256)
std::uint32_t commandCapacity () const
std::uint32_t candidatesWalked () const
std::uint32_t rowsPacked () const

Friends

std::span< const EsCmd > run (SystemFn fn, std::span< const std::uint32_t > fallback, std::span< const QuerySpec > queries, std::span< void *const > resources, CallArena &arena, WorldStamp world={})
std::span< const EsCmd > runBound (const BoundSystem &bound, std::span< const std::uint32_t > fallback, const ResourceLookup &resources, CallArena &arena, WorldStamp world={}, bool *runnable=nullptr)

Detailed Description

The scratch a call needs. Held by the caller so the vectors keep their capacity between frames; every run overwrites it and nothing survives.

Definition at line 126 of file AotHost.hpp.

Constructor & Destructor Documentation

◆ CallArena()

esengine::aot::CallArena::CallArena ( std::uint32_t cmdCap = 256)
inlineexplicit

Definition at line 128 of file AotHost.hpp.

Referenced by run, and runBound.

Member Function Documentation

◆ candidatesWalked()

std::uint32_t esengine::aot::CallArena::candidatesWalked ( ) const
inline

Entities the last run covered, summed across its queries.

The query's BREADTH, counted whether or not the rows were repacked — it is what a system would be paid over, and a ceiling on it is what says the dispatcher is not scanning the world (bench/aot-native/frame-bench.mjs).

Definition at line 140 of file AotHost.hpp.

◆ commandCapacity()

std::uint32_t esengine::aot::CallArena::commandCapacity ( ) const
inline

How many command records the system may write before it must stop.

Definition at line 131 of file AotHost.hpp.

◆ rowsPacked()

std::uint32_t esengine::aot::CallArena::rowsPacked ( ) const
inline

Rows the last run actually wrote. Zero when it reused last frame's, which is the whole saving and the only way to see it happen.

Definition at line 144 of file AotHost.hpp.

◆ run

std::span< const EsCmd > run ( SystemFn fn,
std::span< const std::uint32_t > fallback,
std::span< const QuerySpec > queries,
std::span< void *const > resources,
CallArena & arena,
WorldStamp world = {} )
friend

Materialise, call, and return the commands the system produced. A row is kept only when every component resolves — an absent one is the filter.

fallback is walked only by a query that cannot narrow itself; ask narrows first, since building it is O(world). Applying the commands is the CALLER's job: a despawn here invalidates the rows just handed over.

Definition at line 181 of file AotHost.hpp.

References CallArena().

◆ runBound

std::span< const EsCmd > runBound ( const BoundSystem & bound,
std::span< const std::uint32_t > fallback,
const ResourceLookup & resources,
CallArena & arena,
WorldStamp world = {},
bool * runnable = nullptr )
friend

Run a bound system, resolving its resources for this call. fallback is for the queries that cannot narrow themselves; see run.

Definition at line 404 of file AotHost.hpp.

References CallArena().


The documentation for this class was generated from the following file:
  • /home/runner/work/estella/estella/src/esengine/aot/AotHost.hpp