Template Struct CachedValue

Struct Documentation

template<meta::eval_node Node>
struct CachedValue

The runtime-cache key: a non-owning handle to a forest node.

On the forest-descent path a cached value’s identity is its node’s canonical hash (hash::value) – exactly what CachedValueHasher / CachedValueEqual key CacheManager's map by. The batched (table-driven) executor never consults this map for values at all: it keys by cell id instead (see cell_table.hpp), so no per-scope slice coloring is threaded through here. Node-facing operations forward to the node via operator-> so CacheManager's internals retarget mechanically.

The key does NOT own its node. Copying an eval node deep-copies its whole subtree (binary_node.hpp), so an owning key made registering every internal node of an equation’s left-leaning Sum-tree (one spine node per summand, each subtree larger than the last) cost O(terms^2) node copies. A key is a pointer instead, so registration is O(1) per node at any min_repeats. Whoever builds the CacheManager guarantees that every keyed node outlives it and stays at its address (see cache_manager()). Node identity (hash, structure, connectivity graph) is fixed at construction; the batch annotations a node may receive later do not enter it.

Public Functions

inline explicit CachedValue(Node const &n) noexcept

Keys the map by n's identity; n must outlive the key.

CachedValue(Node const&&) = delete

A temporary would dangle.

inline auto operator->() const

The node’s payload (its EvalExpr), as on a bare node.

inline Node const &operator*() const noexcept

Public Members

Node const *node

the forest node; not owned