Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bslalg::RbTreeAnchor Class Reference

#include <bslalg_rbtreeanchor.h>

List of all members.

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 ()
RbTreeNoderootNode ()
RbTreeNodefirstNode ()
RbTreeNodesentinel ()
const RbTreeNodefirstNode () const
const RbTreeNoderootNode () const
const RbTreeNodesentinel () const
int numNodes () const

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:

For terminology see bsldoc_glossary.

See Component bslalg_rbtreeanchor


Constructor & Destructor Documentation

bslalg::RbTreeAnchor::RbTreeAnchor (  ) 

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

          rootNode()  == 0
          firstNode() == sentinel()
          numNodes()  == 0
bslalg::RbTreeAnchor::RbTreeAnchor ( RbTreeNode rootNode,
RbTreeNode firstNode,
int  numNodes 
)

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

bslalg::RbTreeAnchor::~RbTreeAnchor (  ) 

Destroy this object.


Member Function Documentation

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

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

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

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

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

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

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

Set the numNodes attribute of this object to the specified value. The behavior is undefined unless 0 <= value.

void bslalg::RbTreeAnchor::incrementNumNodes (  ) 

Increment, by 1, the numNodes attribute of this object. The behavior is undefined unless numNodes <= INT_MAX - 1.

void bslalg::RbTreeAnchor::decrementNumNodes (  ) 

Decrement, by 1, the numNodes attribute of this object. The behavior is undefined unless 1 <= numNodes.

RbTreeNode* bslalg::RbTreeAnchor::rootNode (  ) 

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

RbTreeNode* bslalg::RbTreeAnchor::firstNode (  ) 

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

RbTreeNode* bslalg::RbTreeAnchor::sentinel (  ) 

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

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

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

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

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

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

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

int bslalg::RbTreeAnchor::numNodes (  )  const

Return the numNodes attribute of this object.


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