MaterialResolver

The effective binding of each node, memoized (§RVM-4).

In the namespace construct::model. Declared in src/libs/libconstruct/construct/model/MaterialInheritance.hpp.

Detailed description

A lookup walks up from a node until it meets a node with a binding, the root, or a node it already resolved, and remembers the answer for every node on the way. So a resolve of every node of a tree visits each node once, whatever its depth, and a later lookup of one node is one hash lookup.

invalidate() forgets every answer. The document calls it when a binding, a parent or the root changes, and then resolves every item again, so the two costs are of one size. forget() drops one node that left the tree. A walk that meets a missing parent is not remembered, because the parent can arrive later, for example in a file whose child comes before its parent.

In this section