An object whose keys are layered over the keys of a parent.
Synopsis
Declared in <mrdocs/Dom/OverlayObject.hpp>
class OverlayObjectImpl
: public ObjectImpl
Description
The keys of the child shadow the keys of the parent: a read finds the child's value first, and falls back to the parent for any other key. A write goes to the child, so the parent is never changed. size and visit count each key once, even when both layers have it, and visit gives the keys of the child first.
An overlay of an overlay is flattened into one list of layers, so a chain of any depth costs one level of lookup per layer and never a chain of nested calls.
dom::Object parent;
parent.set("a", 1);
parent.set("b", 2);
dom::Object child;
child.set("b", 20);
dom::Object const frame = dom::overlayObject(child, parent);
// frame.get("a") is 1, frame.get("b") is 20, frame.size() is 2
Base Classes
Name |
Description |
Abstract object interface. |
Type Aliases
Name |
Description |
A reference to an element. |
|
The type of storage used by the default implementation. |
Member Functions
Name |
Description |
|
Constructors |
|
Destructor. |
|
Determine if a key exists. |
|
Return the value for the specified key, or null. |
|
Insert or set the given key/value pair. |
|
Return the number of properties in the object. |
|
Return the type key of the implementation. |
|
Invoke the visitor for each key/value pair. |
See Also
overlayObject
Created with MrDocs