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

#include <AotDispatcher.hpp>

Public Member Functions

bool install (const char *path, std::uint64_t expected, const ComponentLookup &components, const ResourceLookup &resources, std::string *why=nullptr, const CandidateLookup &candidates={}, std::optional< std::uint64_t > expectedContract=std::nullopt)
std::size_t count () const
std::uint64_t contract () const
const char * nameAt (std::size_t i) const
bool boundAt (std::size_t i) const
bool narrowsAt (std::size_t i) const
std::size_t indexOf (const char *name) const
std::span< const EsCmd > run (std::size_t i, std::span< const std::uint32_t > candidates, const ResourceLookup &resources, WorldStamp world={})
std::uint32_t candidatesWalked (std::size_t i) const
std::uint32_t rowsPacked (std::size_t i) const
void reset ()

Static Public Attributes

static constexpr std::size_t npos = static_cast<std::size_t>(-1)

Detailed Description

Definition at line 41 of file AotDispatcher.hpp.

Member Function Documentation

◆ boundAt()

bool esengine::aot::Dispatcher::boundAt ( std::size_t i) const
inline

Whether the system at that index resolved. An unbound one runs nothing.

Definition at line 92 of file AotDispatcher.hpp.

◆ candidatesWalked()

std::uint32_t esengine::aot::Dispatcher::candidatesWalked ( std::size_t i) const
inline

Entities that system's last run covered. See CallArena.

Definition at line 140 of file AotDispatcher.hpp.

◆ contract()

std::uint64_t esengine::aot::Dispatcher::contract ( ) const
inline

Which BUILD the open module is, or 0 where it cannot say. The SDK holds the sidecar and is the half that can compare.

Definition at line 86 of file AotDispatcher.hpp.

◆ count()

std::size_t esengine::aot::Dispatcher::count ( ) const
inline

How many systems the module declared — bound or not.

Definition at line 82 of file AotDispatcher.hpp.

◆ indexOf()

std::size_t esengine::aot::Dispatcher::indexOf ( const char * name) const
inline

The index of a declared name, or npos. Called at install, not per frame.

Definition at line 107 of file AotDispatcher.hpp.

References npos.

◆ install()

bool esengine::aot::Dispatcher::install ( const char * path,
std::uint64_t expected,
const ComponentLookup & components,
const ResourceLookup & resources,
std::string * why = nullptr,
const CandidateLookup & candidates = {},
std::optional< std::uint64_t > expectedContract = std::nullopt )
inline

Open path and bind every system it declares.

True when the module opened and agreed about the engine. A system this host cannot name every component of is left UNBOUND, not refused — the per-system fallback, one layer down; boundAt says which ones resolved.

Definition at line 50 of file AotDispatcher.hpp.

◆ nameAt()

const char * esengine::aot::Dispatcher::nameAt ( std::size_t i) const
inline

The declared name at that index, or an empty string out of range.

Definition at line 89 of file AotDispatcher.hpp.

◆ narrowsAt()

bool esengine::aot::Dispatcher::narrowsAt ( std::size_t i) const
inline

Whether every query of that system names its own candidates, and so whether run may be given an EMPTY fallback.

Asked per frame, not at install: a script pool exists only once an entity has that component. False when unbound — ignoring it is slow, never wrong.

Definition at line 101 of file AotDispatcher.hpp.

◆ reset()

void esengine::aot::Dispatcher::reset ( )
inline

Close the module and forget the bindings — they point into it.

Definition at line 151 of file AotDispatcher.hpp.

◆ rowsPacked()

std::uint32_t esengine::aot::Dispatcher::rowsPacked ( std::size_t i) const
inline

Rows that system's last run wrote — zero when it kept last frame's, which is the only way to see the saving happen.

Definition at line 146 of file AotDispatcher.hpp.

◆ run()

std::span< const EsCmd > esengine::aot::Dispatcher::run ( std::size_t i,
std::span< const std::uint32_t > candidates,
const ResourceLookup & resources,
WorldStamp world = {} )
inline

Run one system, and hand back what it wrote.

candidates is the FALLBACK, walked only by a query that could not name its own column — ask narrowsAt first. world decides whether last frame's rows still stand; an unknown stamp repacks. Resources are resolved per call because the contract promises an address for one call only.

Definition at line 122 of file AotDispatcher.hpp.

Member Data Documentation

◆ npos

std::size_t esengine::aot::Dispatcher::npos = static_cast<std::size_t>(-1)
staticconstexpr

Definition at line 161 of file AotDispatcher.hpp.

Referenced by indexOf().


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