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

ACE_RB_Tree_Iterator_Base Class Template Reference

Implements a common base class for iterators for a Red-Black Tree ADT. More...

#include <RB_Tree.h>

Inheritance diagram for ACE_RB_Tree_Iterator_Base:

Inheritance graph
[legend]
Collaboration diagram for ACE_RB_Tree_Iterator_Base:

Collaboration graph
[legend]
List of all members.

Public Methods

void operator= (const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &iter)
 Assignment operator: copies both the tree reference and the position in the tree. More...

int done (void) const
 Returns 1 when the iteration has completed, otherwise 0. More...

ACE_RB_Tree_Node< EXT_ID,
INT_ID > & 
operator * (void) const
 STL-like iterator dereference operator: returns a reference to the node underneath the iterator. More...

const ACE_RB_Tree< EXT_ID,
INT_ID, COMPARE_KEYS, ACE_LOCK > & 
tree (void)
 Returns a const reference to the tree over which we're iterating. More...

int operator== (const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &) const
 Comparison operator: returns 1 if both iterators point to the same position, otherwise 0. More...

int operator!= (const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &) const
 Comparison operator: returns 1 if the iterators point to different positions, otherwise 0. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Protected Methods

 ACE_RB_Tree_Iterator_Base (void)
 Create the singular iterator. No valid iterator can be equal to it, it is illegal to dereference a singular iterator, etc. etc. More...

 ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree, int set_first)
 Constructor. More...

 ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree, ACE_RB_Tree_Node< EXT_ID, INT_ID > *entry)
 Constructor. More...

 ACE_RB_Tree_Iterator_Base (const EXT_ID &key, ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree)
 Constructor. More...

 ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &iter)
 Copy constructor. More...

 ~ACE_RB_Tree_Iterator_Base (void)
 Destructor. More...

int forward_i (void)
 Move forward by one element in the tree. Returns 0 when there are no more elements in the tree, otherwise 1. More...

int reverse_i (void)
 Move back by one element in the tree. Returns 0 when there are no more elements in the tree, otherwise 1. More...

void dump_i (void) const
 Dump the state of an object. More...


Protected Attributes

const ACE_RB_Tree< EXT_ID,
INT_ID, COMPARE_KEYS, ACE_LOCK > * 
tree_
 Reference to the ACE_RB_Tree over which we're iterating. More...

ACE_RB_Tree_Node< EXT_ID,
INT_ID > * 
node_
 Pointer to the node currently under the iterator. More...


Detailed Description

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
class ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >

Implements a common base class for iterators for a Red-Black Tree ADT.


Constructor & Destructor Documentation

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Iterator_Base void    [protected]
 

Create the singular iterator. No valid iterator can be equal to it, it is illegal to dereference a singular iterator, etc. etc.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Iterator_Base const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    tree,
int    set_first
[protected]
 

Constructor.

Takes an ACE_RB_Tree over which to iterate, and an integer indicating (if non-zero) to position the iterator at the first element in the tree (if this integer is 0, the iterator is positioned at the last element in the tree).

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Iterator_Base const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    tree,
ACE_RB_Tree_Node< EXT_ID, INT_ID > *    entry
[protected]
 

Constructor.

Takes an ACE_RB_Tree over which to iterate, and a pointer to a node in the tree.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Iterator_Base const EXT_ID &    key,
ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    tree
[protected]
 

Constructor.

Takes an ACE_RB_Tree over which to iterate, and a key. The key must come first to distinguish the case of EXT_ID == int.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Iterator_Base const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    iter [protected]
 

Copy constructor.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::~ACE_RB_Tree_Iterator_Base void    [protected]
 

Destructor.


Member Function Documentation

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::done void    const
 

Returns 1 when the iteration has completed, otherwise 0.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE void ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::dump_i void    const [protected]
 

Dump the state of an object.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::forward_i void    [protected]
 

Move forward by one element in the tree. Returns 0 when there are no more elements in the tree, otherwise 1.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_RB_Tree_Node< EXT_ID, INT_ID > & ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator * void    const
 

STL-like iterator dereference operator: returns a reference to the node underneath the iterator.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator!= const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    rbt const
 

Comparison operator: returns 1 if the iterators point to different positions, otherwise 0.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
void ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator= const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    iter
 

Assignment operator: copies both the tree reference and the position in the tree.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator== const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    rbt const
 

Comparison operator: returns 1 if both iterators point to the same position, otherwise 0.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::reverse_i void    [protected]
 

Move back by one element in the tree. Returns 0 when there are no more elements in the tree, otherwise 1.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > & ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::tree void   
 

Returns a const reference to the tree over which we're iterating.


Member Data Documentation

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Iterator_Base::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented in ACE_RB_Tree_Iterator, and ACE_RB_Tree_Reverse_Iterator.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Node<EXT_ID, INT_ID>* ACE_RB_Tree_Iterator_Base::node_ [protected]
 

Pointer to the node currently under the iterator.

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
const ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>* ACE_RB_Tree_Iterator_Base::tree_ [protected]
 

Reference to the ACE_RB_Tree over which we're iterating.


The documentation for this class was generated from the following files:
Generated on Fri Nov 22 06:02:09 2002 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001