class NodeValue

Defined at line 288 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

A Node parsed from a Hierarchy.

This is named NodeValue to differentiate it from Node, the write-side definition of nodes.

Public Methods

void NodeValue (std::string name)

Construct a NodeValue with a name and no properties.

Defined at line 42 of file ../../zircon/system/ulib/inspect/hierarchy.cc

void NodeValue (std::string name, std::vector<PropertyValue> properties)

Construct a NodeValue with a name and properties.

Defined at line 44 of file ../../zircon/system/ulib/inspect/hierarchy.cc

void Sort ()

Sorts the properties of this node by name.

See description of Hierarchy::Sort.

Defined at line 47 of file ../../zircon/system/ulib/inspect/hierarchy.cc

void NodeValue ()

Construct an empty NodeValue.

Defined at line 291 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

void NodeValue (const NodeValue & )

Allow moving, disallow copying.

Defined at line 300 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

void NodeValue (NodeValue && )

Defined at line 301 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

NodeValue & operator= (const NodeValue & )

Defined at line 302 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

NodeValue & operator= (NodeValue && )

Defined at line 303 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

const std::string & name ()

Obtains reference to name.

Defined at line 306 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

void set_name (std::string name)

Sets the name.

Defined at line 309 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

const std::vector<PropertyValue> & properties ()

Obtains reference to properties.

Defined at line 312 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

std::vector<PropertyValue> take_properties ()

Takes the properties, leaving the vector owned by this node blank.

Defined at line 315 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

template <typename T>
const T * get_property (const std::string & name)

Gets a pointer to the property with the given name and type.

Returns a pointer if the property exists and is the correct type, nullptr otherwise.

Note: The returned pointer is invalidated if any mutation occurs to this NodeValue.

Defined at line 327 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

void add_property (PropertyValue property)

Adds a property to this node.

Defined at line 338 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

const std::vector<LinkValue> & links ()

Obtains reference to links.

Defined at line 341 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

void add_link (LinkValue link)

Adds a link to this node.

Defined at line 344 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h

void set_links (std::vector<LinkValue> links)

Sets the vector of links for this node.

Defined at line 347 of file ../../zircon/system/ulib/inspect/include/lib/inspect/cpp/hierarchy.h