class BoundedListNode
Defined at line 45 of file ../../sdk/lib/inspect/contrib/cpp/bounded_list_node.h
`BoundedListNode` is a list of Inspect nodes with a maximum capacity.
Nodes are rolled out in FIFO order as new nodes beyond `capacity()` are created.
Nodes are named by insertion order: "0", "1", "2", ... For example,
``` auto list = BoundedListNode(inspector.GetRoot().CreateChild("list"), 3); list.CreateEntry([](Node& n) { n.RecordInt("first", 1); }); list.CreateEntry([](Node& n) { n.RecordInt("second", 2); }); list.CreateEntry([](Node& n) { n.RecordInt("third", 3); }); ```
Would create the hierarchy: { root: { list: { "0": { "first": 1 }, "1": { "second": 2 }, "2": { "third": 3 }, }, }, }
On a subsequent call to `list.CreateEntry(...)`, the node `"0"` would get pushed out, and node `"3"` would be inserted, representing that most recent call.
`BoundedListNode` is thread-safe.
Functions
capacity
public uint64_t capacity()
Defined at line 8 of file ../../sdk/lib/inspect/contrib/cpp/bounded_list_node.cc
Check the max capacity of `this`.
CreateEntry
public void CreateEntry(std::function<void (inspect::Node &)> cb)
Defined at line 10 of file ../../sdk/lib/inspect/contrib/cpp/bounded_list_node.cc
Create a new entry at the end of `this`, popping from the front if necessary.
Safety: the reference passed to the provided callback will be valid so long as the referent is present in `this`.
BoundedListNode
public void BoundedListNode(inspect::Node && n, uint64_t max_capacity)
Defined at line 48 of file ../../sdk/lib/inspect/contrib/cpp/bounded_list_node.h
Construct a `BoundedListNode` with a fixed max capacity.
BoundedListNode
public void BoundedListNode(BoundedListNode && n)
Defined at line 51 of file ../../sdk/lib/inspect/contrib/cpp/bounded_list_node.h
BoundedListNode
public void BoundedListNode(const BoundedListNode & )
Defined at line 54 of file ../../sdk/lib/inspect/contrib/cpp/bounded_list_node.h
Copying inspect::Node is not allowed
BoundedListNode
public void BoundedListNode()
Defined at line 55 of file ../../sdk/lib/inspect/contrib/cpp/bounded_list_node.h
~BoundedListNode
public void ~BoundedListNode()
Defined at line 56 of file ../../sdk/lib/inspect/contrib/cpp/bounded_list_node.h