[#BloombergLP-bslstl-TreeNode] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::TreeNode :relfileprefix: ../../ :mrdocs: POD‐like node for a red‐black tree of parameterized `VALUE` objects. == Synopsis Declared in `<bslstl_treenode.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class VALUE> class TreeNode : public xref:BloombergLP/bslalg/RbTreeNode.adoc[bslalg::RbTreeNode] ---- == Description This POD‐like `class` describes a node suitable for use in a red‐black binary search tree of values of the parameterized `VALUE`. This class is a "POD‐like" to facilitate efficient allocation and use in the context of a container implementation. In order to meet the essential requirements of a POD type, this `class` does not define a constructor or destructor. The manipulator, `value`, returns a modifiable reference to `d_value` so that it may be constructed in‐place by the appropriate `bsl::allocator_traits` object. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslalg/RbTreeNode.adoc[bslalg::RbTreeNode]` | A node in a red‐black binary search tree. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslalg/RbTreeNode/Color-048.adoc[`Color`] | Enumeration of the two colors used by red‐black tree nodes. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslalg/RbTreeNode/color-049.adoc[`color`] | Return the color of this node. | xref:BloombergLP/bslalg/RbTreeNode/isBlack.adoc[`isBlack`] | Return `true` if this node is black. | xref:BloombergLP/bslalg/RbTreeNode/isRed.adoc[`isRed`] | Return `true` if this node is red. | xref:BloombergLP/bslalg/RbTreeNode/leftChild-01.adoc[`leftChild`] | `leftChild` overloads | xref:BloombergLP/bslalg/RbTreeNode/makeBlack.adoc[`makeBlack`] | Set the color of this node to black. Note that this operation is at least as fast as (and potentially faster than) `setColor`. | xref:BloombergLP/bslalg/RbTreeNode/makeRed.adoc[`makeRed`] | Set the color of this node to red. Note that this operation is at least as fast as (and potentially faster than) `setColor`. | xref:BloombergLP/bslalg/RbTreeNode/parent-0ce.adoc[`parent`] | `parent` overloads | xref:BloombergLP/bslalg/RbTreeNode/reset.adoc[`reset`] | Reset this object to have the specified `parent`, `leftChild`, `rightChild`, and `color` property values. | xref:BloombergLP/bslalg/RbTreeNode/rightChild-06.adoc[`rightChild`] | `rightChild` overloads | xref:BloombergLP/bslalg/RbTreeNode/setColor.adoc[`setColor`] | Set the color of this node to the specified `value`. | xref:BloombergLP/bslalg/RbTreeNode/setLeftChild.adoc[`setLeftChild`] | Set the left child of this node to the specified `address`. If `address` is 0, then this node will not have a left child. | xref:BloombergLP/bslalg/RbTreeNode/setParent.adoc[`setParent`] | Set the parent of this node to the specified `address`. | xref:BloombergLP/bslalg/RbTreeNode/setRightChild.adoc[`setRightChild`] | Set the right child of this node to the specified `address`. If `address` is 0, then this node will not have a right child. | xref:BloombergLP/bslalg/RbTreeNode/toggleColor.adoc[`toggleColor`] | Set the color of this node to the alternative color. | xref:BloombergLP/bslstl/TreeNode/value-08.adoc[`value`] | `value` overloads |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#