Struct CellRegistryHooks¶
Defined in File cell_registry.hpp
Struct Documentation¶
-
struct CellRegistryHooks¶
Wiring
CellRegistryneeds from its owner (the ordered executor) but must not construct itself: the cross-callPersistentValueStore(aCacheManagermember, one instance per top-level evaluation call, outliving any oneCellRegistry), the map from a table value id to the canonical hash that the store and theCacheManagerscope caches both key persistence on, and an optional metering hook. Every field defaults to “off”: aCellRegistrybuilt with a default-constructedCellRegistryHooksdoes no persistence or bytes tracking (persistent cells are never seeded or published, andlive_bytesstays a bookkeeping-only counter nobody observes).Public Members
-
PersistentValueStore *persistent = nullptr¶
Cross-call persistence store;
seed_persistentreads it,setpublishes to it. Null disables both.
-
std::function<std::size_t(std::size_t value_id)> hash_of¶
A table value id’s canonical hash, the key
persistentis addressed by. Required (alongsidepersistent) for seeding/publishing; a null function disables both exactly as a nullpersistentdoes.
-
std::function<void(std::size_t live_bytes)> on_bytes_changed¶
Metering: invoked with the new
live_bytestotal after every change. May be empty –CellRegistrydoes not require a metering consumer. Must not throw: it is also called while cells are released, which happens during stack unwinding too.
-
std::function<ResultPtr(CellId, ResultPtr)> stored_form¶
Invoked with a value about to be stored in a cell (
set); what it returns is stored in its place. Lets the owner store a value in another form (on disk, seeResult::on_disk). May be empty.
-
std::function<bool(CellId)> assemble_on_disk¶
Whether the value of a cell that is assembled from the batches of a loop should be assembled in its on-disk form from the start (see
BackendArrayOps::make_zeros_on_disk). Empty means never.
-
std::function<void(CellId, ResultPtr const&)> on_set¶
Accounting: invoked after a value is stored in a cell (
set), with the cell and the value. May be empty.
-
std::function<void(CellId, ResultPtr const&)> on_read¶
Accounting: invoked when a consumer’s operand read is served from a cell (
CellReadResolver::fetch), with the cell and the whole value it holds, before any slicing. May be empty.
-
bool strict_fill_once = eval::strict_fill_once()¶
Whether a fill-once violation throws (see
CellRegistry::set). The default is the process-wide env gateeval::strict_fill_once(), which is latched on its first call anywhere in the process – so a test that needs strictness sets this field instead of the environment, which by then may be too late to have any effect.
-
PersistentValueStore *persistent = nullptr¶