class ValueList
Defined at line 502 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h
A ValueList is a holder for arbitrary values that do not need to be explicitly named or modified
after creation.
This class is not thread-safe, and it requires external synchronization if accessed from multiple
threads.
Example:
struct Item {
// The inspect::Node for this item.
Node node;
// List of unnamed values that should be retained for this item.
ValueList values;
Item(Node* parent, const std::string
&
name, int value) {
node = parent->CreateChild(name);
// Expose the value, but enlist it in the ValueList so it doesn't need a name.
node.CreateInt("value", value,
&values
);
// "Stats" computes and stores some stats under the node it is given. Keep this in the
// ValueList as well since it doesn't need a name.
values.emplace(Stats(this, node.CreateChild("stats")));
}
}
Public Methods
void ValueList ()
Defined at line 504 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h
template <typename T>
void emplace (T value)
Emplaces a value in this ValueList.
Defined at line 514 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h
void clear ()
Defined at line 518 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/vmo/types.h