BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslalg::RbTreeAnchor Class Reference

#include <bslalg_rbtreeanchor.h>

Public Member Functions

 RbTreeAnchor ()
 
 RbTreeAnchor (RbTreeNode *rootNode, RbTreeNode *firstNode, int numNodes)
 
 ~RbTreeAnchor ()
 Destroy this object.
 
void reset (RbTreeNode *rootNode, RbTreeNode *firstNode, int numNodes)
 
void setFirstNode (RbTreeNode *value)
 
void setRootNode (RbTreeNode *value)
 
void setNumNodes (int value)
 
void incrementNumNodes ()
 
void decrementNumNodes ()
 
RbTreeNoderootNode ()
 
RbTreeNodefirstNode ()
 
RbTreeNodesentinel ()
 
const RbTreeNodefirstNode () const
 
const RbTreeNoderootNode () const
 
const RbTreeNodesentinel () const
 Return the address referred to by the sentinel node for this tree.
 
int numNodes () const
 Return the numNodes attribute of this object.
 

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 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

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:533
RbTreeNode * firstNode()
Definition bslalg_rbtreeanchor.h:521
int numNodes() const
Return the numNodes attribute of this object.
Definition bslalg_rbtreeanchor.h:552
RbTreeNode * rootNode()
Definition bslalg_rbtreeanchor.h:527

◆ 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

Member Function Documentation

◆ decrementNumNodes()

void bslalg::RbTreeAnchor::decrementNumNodes ( )
inline

Decrement, by 1, the numNodes attribute of this object. 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. The behavior is undefined unless numNodes <= INT_MAX - 1.

◆ numNodes()

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

◆ 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

◆ 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. 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: