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

ACE_RB_Tree_Reverse_Iterator Class Template Reference

Implements a reverse iterator for a Red-Black Tree ADT. More...

#include <RB_Tree.h>

Inheritance diagram for ACE_RB_Tree_Reverse_Iterator:

Inheritance graph
[legend]
Collaboration diagram for ACE_RB_Tree_Reverse_Iterator:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_RB_Tree_Reverse_Iterator (void)
 ACE_RB_Tree_Reverse_Iterator (const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree, int set_last=1)
 ACE_RB_Tree_Reverse_Iterator (const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree, ACE_RB_Tree_Node< EXT_ID, INT_ID > *entry)
 ACE_RB_Tree_Reverse_Iterator (const EXT_ID &key, ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree)
 ~ACE_RB_Tree_Reverse_Iterator (void)
 Destructor. More...

int advance (void)
 Move forward by one element in the tree. Returns 0 when all elements have been seen, else 1. More...

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

ACE_RB_Tree_Reverse_Iterator<
EXT_ID, INT_ID, COMPARE_KEYS,
ACE_LOCK > & 
operator++ (void)
 Prefix advance. More...

ACE_RB_Tree_Reverse_Iterator<
EXT_ID, INT_ID, COMPARE_KEYS,
ACE_LOCK > 
operator++ (int)
 Postfix advance. More...

ACE_RB_Tree_Reverse_Iterator<
EXT_ID, INT_ID, COMPARE_KEYS,
ACE_LOCK > & 
operator-- (void)
 Prefix reverse. More...

ACE_RB_Tree_Reverse_Iterator<
EXT_ID, INT_ID, COMPARE_KEYS,
ACE_LOCK > 
operator-- (int)
 Postfix reverse. More...

int next (ACE_RB_Tree_Node< EXT_ID, INT_ID > *&next_entry) const

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Detailed Description

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

Implements a reverse iterator for a Red-Black Tree ADT.

Definition at line 770 of file RB_Tree.h.


Constructor & Destructor Documentation

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Reverse_Iterator void   
 

Create the singular iterator. It is illegal to deference the iterator, no valid iterator is equal to a singular iterator, etc. etc.

Definition at line 1044 of file RB_Tree.i.

References ACE_TRACE.

01045   : ACE_RB_Tree_Iterator_Base<EXT_ID,INT_ID,COMPARE_KEYS,ACE_LOCK> ()
01046 {
01047   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree_Reverse_Iterator (void)");
01048 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Reverse_Iterator const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    tree,
int    set_last = 1
 

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

Definition at line 1097 of file RB_Tree.cpp.

References ACE_TRACE.

01098   : ACE_RB_Tree_Iterator_Base<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> (tree, set_last ? 0 : 1)
01099 {
01100   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree_Reverse_Iterator");
01101 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Reverse_Iterator const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    tree,
ACE_RB_Tree_Node< EXT_ID, INT_ID > *    entry
 

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

Definition at line 1104 of file RB_Tree.cpp.

References ACE_TRACE.

01105   : ACE_RB_Tree_Iterator_Base<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> (tree,entry)
01106 {
01107   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree_Reverse_Iterator");
01108 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Reverse_Iterator const EXT_ID &    key,
ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &    tree
 

Constructor. Takes an ACE_RB_Tree over which to iterate, and a key; the key comes first in order to distinguish the case of EXT_ID == int.

Definition at line 1111 of file RB_Tree.cpp.

References ACE_TRACE.

01112  : ACE_RB_Tree_Iterator_Base<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>(key,tree)
01113 {
01114   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree_Reverse_Iterator");
01115 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::~ACE_RB_Tree_Reverse_Iterator void   
 

Destructor.

Definition at line 1120 of file RB_Tree.cpp.

References ACE_TRACE.

01121 {
01122   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::~ACE_RB_Tree_Reverse_Iterator");
01123 }


Member Function Documentation

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::advance void   
 

Move forward by one element in the tree. Returns 0 when all elements have been seen, else 1.

Definition at line 1055 of file RB_Tree.i.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base::reverse_i.

01056 {
01057   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::advance");
01058 
01059   return this->reverse_i ();
01060 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE void ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::dump void    const
 

Dump the state of an object.

Definition at line 1067 of file RB_Tree.i.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base::dump_i.

01068 {
01069   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::dump");
01070 
01071   this->dump_i ();
01072 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::next ACE_RB_Tree_Node< EXT_ID, INT_ID > *&    next_entry const
 

Passes back the <entry> under the iterator. Returns 0 if the iteration has completed, otherwise 1. This method must be declared and defined in both the derived forward and reverse iterator classes rather than in the base iterator class because of a method signature resolution problem caused by the existence of the deprecated next (void) method in the derived forward iterator class. When that deprecated method is removed, this method should be removed from the derived classes and placed in the base class.

Definition at line 1141 of file RB_Tree.i.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base::node_.

01142 {
01143   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::next");
01144 
01145   if (this->node_)
01146     {
01147       next_entry = this->node_;
01148       return 1;
01149     }
01150 
01151   return 0;
01152 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator++ int   
 

Postfix advance.

Definition at line 1092 of file RB_Tree.i.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base::reverse_i.

01093 {
01094   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator++ (int)");
01095 
01096   ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> retv (*this);
01097   this->reverse_i ();
01098   return retv;
01099 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > & ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator++ void   
 

Prefix advance.

Definition at line 1079 of file RB_Tree.i.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base::reverse_i.

01080 {
01081   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator++ (void)");
01082 
01083   this->reverse_i ();
01084   return *this;
01085 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator-- int   
 

Postfix reverse.

Definition at line 1119 of file RB_Tree.i.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base::forward_i.

01120 {
01121   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator-- (int)");
01122 
01123   ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> retv (*this);
01124   this->forward_i ();
01125   return retv;
01126 }

template<class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > & ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator-- void   
 

Prefix reverse.

Definition at line 1106 of file RB_Tree.i.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base::forward_i.

01107 {
01108   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator-- (void)");
01109 
01110   this->forward_i ();
01111   return *this;
01112 }


Member Data Documentation

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

Declare the dynamic allocation hooks.

Reimplemented from ACE_RB_Tree_Iterator_Base.

Definition at line 833 of file RB_Tree.h.


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