Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_RB_Tree_Node Class Template Reference

Implements a node in a Red-Black Tree ADT. More...

#include <RB_Tree.h>

Inheritance diagram for ACE_RB_Tree_Node:

Inheritance graph
[legend]
Collaboration diagram for ACE_RB_Tree_Node:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_RB_Tree_Node (const EXT_ID &k, const INT_ID &t)
 Constructor. More...

 ~ACE_RB_Tree_Node (void)
 Destructor. More...

EXT_ID & key (void)
 Key accessor. More...

INT_ID & item (void)
 Item accessor. More...

void color (RB_Tree_Node_Color c)
 Set color of the node. More...

RB_Tree_Node_Color color (void)
 Get color of the node. More...

ACE_RB_Tree_Node< EXT_ID,
INT_ID > * 
parent (void)
 Accessor for node's parent pointer. More...

void parent (ACE_RB_Tree_Node< EXT_ID, INT_ID > *p)
 Mutator for node's parent pointer. More...

ACE_RB_Tree_Node< EXT_ID,
INT_ID > * 
left (void)
 Accessor for node's left child pointer. More...

void left (ACE_RB_Tree_Node< EXT_ID, INT_ID > *l)
 Mutator for node's left child pointer. More...

ACE_RB_Tree_Node< EXT_ID,
INT_ID > * 
right (void)
 Accessor for node's right child pointer. More...

void right (ACE_RB_Tree_Node< EXT_ID, INT_ID > *r)
 Mutator for node's right child pointer. More...


Private Attributes

EXT_ID k_
 The key. More...

INT_ID t_
 The item. More...

RB_Tree_Node_Color color_
 Color of the node. More...

ACE_RB_Tree_Node< EXT_ID,
INT_ID > * 
parent_
 Pointer to node's parent. More...

ACE_RB_Tree_Node< EXT_ID,
INT_ID > * 
left_
 Pointer to node's left child. More...

ACE_RB_Tree_Node< EXT_ID,
INT_ID > * 
right_
 Pointer to node's right child. More...


Detailed Description

template<class EXT_ID, class INT_ID>
class ACE_RB_Tree_Node< EXT_ID, INT_ID >

Implements a node in a Red-Black Tree ADT.

Definition at line 52 of file RB_Tree.h.


Constructor & Destructor Documentation

template<class EXT_ID, class INT_ID>
ACE_RB_Tree_Node< EXT_ID, INT_ID >::ACE_RB_Tree_Node const EXT_ID &    k,
const INT_ID &    t
 

Constructor.

Definition at line 24 of file RB_Tree.cpp.

References ACE_TRACE.

00025   : k_ (k),
00026     t_ (t),
00027     color_ (RED),
00028     parent_ (0),
00029     left_ (0),
00030     right_ (0)
00031 {
00032   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::ACE_RB_Tree_Node (const EXT_ID &k, const INT_ID &t)");
00033 }

template<class EXT_ID, class INT_ID>
ACE_RB_Tree_Node< EXT_ID, INT_ID >::~ACE_RB_Tree_Node void   
 

Destructor.

Definition at line 39 of file RB_Tree.cpp.

References ACE_TRACE, left_, and right_.

00040 {
00041   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::~ACE_RB_Tree_Node");
00042 
00043   // Delete left sub-tree.
00044   delete left_;
00045 
00046   // Delete right sub_tree.
00047   delete right_;
00048 }


Member Function Documentation

template<class EXT_ID, class INT_ID>
ACE_INLINE ACE_RB_Tree_Node_Base::RB_Tree_Node_Color ACE_RB_Tree_Node< EXT_ID, INT_ID >::color void   
 

Get color of the node.

Definition at line 48 of file RB_Tree.i.

References ACE_TRACE, and color_.

00049 {
00050   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::color accessor");
00051   return color_;
00052 }

template<class EXT_ID, class INT_ID>
ACE_INLINE void ACE_RB_Tree_Node< EXT_ID, INT_ID >::color RB_Tree_Node_Color    c
 

Set color of the node.

Definition at line 37 of file RB_Tree.i.

References ACE_TRACE, color_, and ACE_RB_Tree_Node_Base::RB_Tree_Node_Color.

Referenced by ACE_RB_Tree::dump_node_i, ACE_RB_Tree::RB_delete_fixup, ACE_RB_Tree::RB_rebalance, ACE_RB_Tree::remove_i, and ACE_RB_Tree::test_invariant_recurse.

00038 {
00039   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::color mutator");
00040   color_ = c;
00041 }

template<class EXT_ID, class INT_ID>
ACE_INLINE INT_ID & ACE_RB_Tree_Node< EXT_ID, INT_ID >::item void   
 

Item accessor.

Definition at line 26 of file RB_Tree.i.

References ACE_TRACE, and t_.

Referenced by ACE_RB_Tree::find, ACE_RB_Tree::insert_i, ACE_RB_Tree::rebind, ACE_RB_Tree::remove_i, and ACE_RB_Tree::trybind.

00027 {
00028   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>:item");
00029   return t_;
00030 }

template<class EXT_ID, class INT_ID>
ACE_INLINE EXT_ID & ACE_RB_Tree_Node< EXT_ID, INT_ID >::key void   
 

Key accessor.

Definition at line 15 of file RB_Tree.i.

References ACE_TRACE, and k_.

Referenced by ACE_RB_Tree::find_node, ACE_RB_Tree::rebind, and ACE_RB_Tree::remove_i.

00016 {
00017   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::key");
00018   return k_;
00019 }

template<class EXT_ID, class INT_ID>
ACE_INLINE void ACE_RB_Tree_Node< EXT_ID, INT_ID >::left ACE_RB_Tree_Node< EXT_ID, INT_ID > *    l
 

Mutator for node's left child pointer.

Definition at line 93 of file RB_Tree.i.

References ACE_TRACE, and left_.

00094 {
00095   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::left mutator");
00096   left_ = l;
00097 }

template<class EXT_ID, class INT_ID>
ACE_INLINE ACE_RB_Tree_Node< EXT_ID, INT_ID > * ACE_RB_Tree_Node< EXT_ID, INT_ID >::left void   
 

Accessor for node's left child pointer.

Definition at line 82 of file RB_Tree.i.

References ACE_TRACE, and left_.

Referenced by ACE_RB_Tree::dump_i, ACE_RB_Tree::find_node, ACE_RB_Tree::insert_i, ACE_RB_Tree::RB_delete_fixup, ACE_RB_Tree::RB_rotate_left, ACE_RB_Tree::RB_rotate_right, ACE_RB_Tree::RB_tree_minimum, ACE_RB_Tree::RB_tree_predecessor, ACE_RB_Tree::remove_i, and ACE_RB_Tree::test_invariant_recurse.

00083 {
00084   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::left accessor");
00085   return left_;
00086 }

template<class EXT_ID, class INT_ID>
ACE_INLINE void ACE_RB_Tree_Node< EXT_ID, INT_ID >::parent ACE_RB_Tree_Node< EXT_ID, INT_ID > *    p
 

Mutator for node's parent pointer.

Definition at line 70 of file RB_Tree.i.

References ACE_TRACE, and parent_.

00071 {
00072   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::parent mutator");
00073   parent_ = p;
00074 }

template<class EXT_ID, class INT_ID>
ACE_INLINE ACE_RB_Tree_Node< EXT_ID, INT_ID > * ACE_RB_Tree_Node< EXT_ID, INT_ID >::parent void   
 

Accessor for node's parent pointer.

Definition at line 59 of file RB_Tree.i.

References ACE_TRACE, and parent_.

Referenced by ACE_RB_Tree::RB_delete_fixup, ACE_RB_Tree::RB_rebalance, ACE_RB_Tree::RB_rotate_left, ACE_RB_Tree::RB_rotate_right, ACE_RB_Tree::RB_tree_predecessor, ACE_RB_Tree::RB_tree_successor, and ACE_RB_Tree::remove_i.

00060 {
00061   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::parent accessor");
00062   return parent_;
00063 }

template<class EXT_ID, class INT_ID>
ACE_INLINE void ACE_RB_Tree_Node< EXT_ID, INT_ID >::right ACE_RB_Tree_Node< EXT_ID, INT_ID > *    r
 

Mutator for node's right child pointer.

Definition at line 115 of file RB_Tree.i.

References ACE_TRACE, and right_.

00116 {
00117   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::right mutator");
00118   right_ = r;
00119 }

template<class EXT_ID, class INT_ID>
ACE_INLINE ACE_RB_Tree_Node< EXT_ID, INT_ID > * ACE_RB_Tree_Node< EXT_ID, INT_ID >::right void   
 

Accessor for node's right child pointer.

Definition at line 104 of file RB_Tree.i.

References ACE_TRACE, and right_.

Referenced by ACE_RB_Tree::dump_i, ACE_RB_Tree::find_node, ACE_RB_Tree::insert_i, ACE_RB_Tree::RB_delete_fixup, ACE_RB_Tree::RB_rotate_left, ACE_RB_Tree::RB_rotate_right, ACE_RB_Tree::RB_tree_maximum, ACE_RB_Tree::RB_tree_successor, ACE_RB_Tree::remove_i, and ACE_RB_Tree::test_invariant_recurse.

00105 {
00106   ACE_TRACE ("ACE_RB_Tree_Node<EXT_ID, INT_ID>::right accessor");
00107   return right_;
00108 }


Member Data Documentation

template<class EXT_ID, class INT_ID>
RB_Tree_Node_Color ACE_RB_Tree_Node::color_ [private]
 

Color of the node.

Definition at line 102 of file RB_Tree.h.

Referenced by color.

template<class EXT_ID, class INT_ID>
EXT_ID ACE_RB_Tree_Node::k_ [private]
 

The key.

Definition at line 96 of file RB_Tree.h.

Referenced by key.

template<class EXT_ID, class INT_ID>
ACE_RB_Tree_Node<EXT_ID, INT_ID>* ACE_RB_Tree_Node::left_ [private]
 

Pointer to node's left child.

Definition at line 108 of file RB_Tree.h.

Referenced by left, and ~ACE_RB_Tree_Node.

template<class EXT_ID, class INT_ID>
ACE_RB_Tree_Node<EXT_ID, INT_ID>* ACE_RB_Tree_Node::parent_ [private]
 

Pointer to node's parent.

Definition at line 105 of file RB_Tree.h.

Referenced by parent.

template<class EXT_ID, class INT_ID>
ACE_RB_Tree_Node<EXT_ID, INT_ID>* ACE_RB_Tree_Node::right_ [private]
 

Pointer to node's right child.

Definition at line 111 of file RB_Tree.h.

Referenced by right, and ~ACE_RB_Tree_Node.

template<class EXT_ID, class INT_ID>
INT_ID ACE_RB_Tree_Node::t_ [private]
 

The item.

Definition at line 99 of file RB_Tree.h.

Referenced by item.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:54:45 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002