[#BloombergLP-bslalg-RbTreeAnchor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::RbTreeAnchor
:relfileprefix: ../../
:mrdocs:

Hold the first&hyphen;node, root&hyphen;node, and node&hyphen;count of a binary search tree&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;rbtreeanchor&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class RbTreeAnchor;
----

== Description

An `RbTreeAnchor` provides the addresses of the first and root nodes of a binary search tree&period; An `RbTreeAnchor` is similar to an in&hyphen;core simply constrained (value&hyphen;semantic) attribute class, except that it does not supply equality&hyphen;comparison, copy&hyphen;construction, and copy&hyphen;assignment operations&period; Note that a node may not be copied because `sentinel` returns an address unique to each `RbTreeAnchor` object&period;

This class&colon; &ast; is _exception&hyphen;neutral_ &ast; is _alias&hyphen;safe_ &ast; is `const` _thread&hyphen;safe_ For terminology see `bsldoc&lowbar;glossary`&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/RbTreeAnchor/2constructor-01.adoc[`RbTreeAnchor`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslalg/RbTreeAnchor/2destructor.adoc[`&#126;RbTreeAnchor`] [.small]#[destructor]#
| Destroy this object&period;
| xref:BloombergLP/bslalg/RbTreeAnchor/decrementNumNodes.adoc[`decrementNumNodes`] 
| Decrement, by 1, the `numNodes` attribute of this object&period; The behavior is undefined unless `1 &lt;&equals; numNodes`&period;
| xref:BloombergLP/bslalg/RbTreeAnchor/firstNode-0c.adoc[`firstNode`] 
| `firstNode` overloads
| xref:BloombergLP/bslalg/RbTreeAnchor/incrementNumNodes.adoc[`incrementNumNodes`] 
| Increment, by 1, the `numNodes` attribute of this object&period; The behavior is undefined unless `numNodes &lt;&equals; INT&lowbar;MAX &hyphen; 1`&period;
| xref:BloombergLP/bslalg/RbTreeAnchor/numNodes.adoc[`numNodes`] 
| Return the `numNodes` attribute of this object&period;
| xref:BloombergLP/bslalg/RbTreeAnchor/reset.adoc[`reset`] 
| Set the `rootNode`, `firstNode`, and `numNodes` attributes to the specified `rootNode`, `firstNode`, and `numNodes` respectively&period;
| xref:BloombergLP/bslalg/RbTreeAnchor/rootNode-0b.adoc[`rootNode`] 
| `rootNode` overloads
| xref:BloombergLP/bslalg/RbTreeAnchor/sentinel-05.adoc[`sentinel`] 
| `sentinel` overloads
| xref:BloombergLP/bslalg/RbTreeAnchor/setFirstNode.adoc[`setFirstNode`] 
| Set the `firstNode` attribute of this object to the specified `value`&period;
| xref:BloombergLP/bslalg/RbTreeAnchor/setNumNodes.adoc[`setNumNodes`] 
| Set the `numNodes` attribute of this object to the specified `value`&period; The behavior is undefined unless `0 &lt;&equals; value`&period;
| xref:BloombergLP/bslalg/RbTreeAnchor/setRootNode.adoc[`setRootNode`] 
| Set the `rootNode` attribute of this object to the specified `value`&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
