BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslalg::RbTreeAnchor Class Reference

#include <bslalg_rbtreeanchor.h>

Detailed Description

An RbTreeAnchor provides the addresses of the first and root nodes of a binary search tree. An RbTreeAnchor is similar to an in-core simply constrained (value-semantic) attribute class, except that it does not supply equality-comparison, copy-construction, and copy-assignment operations.

Note
Note that a node may not be copied because sentinel returns an address unique to each RbTreeAnchor object.

This class:

  • is exception-neutral
  • is alias-safe
  • is const thread-safe For terminology see bsldoc_glossary .

See bslalg_rbtreeanchor

Public Member Functions

 RbTreeAnchor ()
 
 RbTreeAnchor (RbTreeNode *rootNode, RbTreeNode *firstNode, int numNodes)
 
 ~RbTreeAnchor ()
 
void reset (RbTreeNode *rootNode, RbTreeNode *firstNode, int numNodes)
 
void setFirstNode (RbTreeNode *value)
 
void setRootNode (RbTreeNode *value)
 
void setNumNodes (int value)
 
void incrementNumNodes ()
 
void decrementNumNodes ()
 
RbTreeNode * rootNode ()
 
RbTreeNode * firstNode ()
 
RbTreeNode * sentinel ()
 
const RbTreeNode * firstNode () const
 
const RbTreeNode * rootNode () const
 
const RbTreeNode * sentinel () const
 
int numNodes () const
 

Constructor & Destructor Documentation

◆ RbTreeAnchor() [1/2]

bslalg::RbTreeAnchor::RbTreeAnchor ( )
inline

Create a RbTree object having the (default) attribute values:

rootNode() == 0
numNodes() == 0
RbTreeNode * sentinel()
Definition bslalg_rbtreeanchor.h:537
RbTreeNode * firstNode()
Definition bslalg_rbtreeanchor.h:525
int numNodes() const
Return the numNodes attribute of this object.
Definition bslalg_rbtreeanchor.h:556
RbTreeNode * rootNode()
Definition bslalg_rbtreeanchor.h:531

◆ RbTreeAnchor() [2/2]

bslalg::RbTreeAnchor::RbTreeAnchor ( RbTreeNode *  rootNode,
RbTreeNode *  firstNode,
int  numNodes 
)
inline

Create a RbTreeAnchor object having the specified rootNode, firstNode, and numNodes attribute values.

◆ ~RbTreeAnchor()

bslalg::RbTreeAnchor::~RbTreeAnchor ( )
inline

Destroy this object.

Member Function Documentation

◆ decrementNumNodes()

void bslalg::RbTreeAnchor::decrementNumNodes ( )
inline

Decrement, by 1, the numNodes attribute of this object.

Precondition
The behavior is undefined unless 1 <= numNodes.

◆ firstNode() [1/2]

RbTreeNode * bslalg::RbTreeAnchor::firstNode ( )
inline

Return the address of the (modifiable) node referred to by the firstNode attribute of this object.

◆ firstNode() [2/2]

const RbTreeNode * bslalg::RbTreeAnchor::firstNode ( ) const
inline

Return the address referred to by the firstNode attribute of this object.

◆ incrementNumNodes()

void bslalg::RbTreeAnchor::incrementNumNodes ( )
inline

Increment, by 1, the numNodes attribute of this object.

Precondition
The behavior is undefined unless numNodes <= INT_MAX - 1.

◆ numNodes()

int bslalg::RbTreeAnchor::numNodes ( ) const
inline

Return the numNodes attribute of this object.

◆ reset()

void bslalg::RbTreeAnchor::reset ( RbTreeNode *  rootNode,
RbTreeNode *  firstNode,
int  numNodes 
)
inline

Set the rootNode, firstNode, and numNodes attributes to the specified rootNodeValue, firstNodeValue, and numNodes respectively.

◆ rootNode() [1/2]

RbTreeNode * bslalg::RbTreeAnchor::rootNode ( )
inline

Return the address of the (modifiable) node referred to by the rootNode attribute of this object.

◆ rootNode() [2/2]

const RbTreeNode * bslalg::RbTreeAnchor::rootNode ( ) const
inline

Return the address referred to by the rootNode attribute of this object.

◆ sentinel() [1/2]

RbTreeNode * bslalg::RbTreeAnchor::sentinel ( )
inline

Return the address of the (modifiable) node referred to by the sentinel node for this tree.

◆ sentinel() [2/2]

const RbTreeNode * bslalg::RbTreeAnchor::sentinel ( ) const
inline

Return the address referred to by the sentinel node for this tree.

◆ setFirstNode()

void bslalg::RbTreeAnchor::setFirstNode ( RbTreeNode *  value)
inline

Set the firstNode attribute of this object to the specified value.

◆ setNumNodes()

void bslalg::RbTreeAnchor::setNumNodes ( int  value)
inline

Set the numNodes attribute of this object to the specified value.

Precondition
The behavior is undefined unless 0 <= value.

◆ setRootNode()

void bslalg::RbTreeAnchor::setRootNode ( RbTreeNode *  value)
inline

Set the rootNode attribute of this object to the specified value.


The documentation for this class was generated from the following file: