ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > 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< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >:

Inheritance graph
[legend]
Collaboration diagram for ACE_RB_Tree_Reverse_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 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.
int advance (void)
void dump (void) const
 Dump the state of an object.
ACE_RB_Tree_Reverse_Iterator<
EXT_ID, INT_ID, COMPARE_KEYS,
ACE_LOCK > & 
operator++ (void)
 Prefix advance.
ACE_RB_Tree_Reverse_Iterator<
EXT_ID, INT_ID, COMPARE_KEYS,
ACE_LOCK > 
operator++ (int)
 Postfix advance.
ACE_RB_Tree_Reverse_Iterator<
EXT_ID, INT_ID, COMPARE_KEYS,
ACE_LOCK > & 
operator-- (void)
 Prefix reverse.
ACE_RB_Tree_Reverse_Iterator<
EXT_ID, INT_ID, COMPARE_KEYS,
ACE_LOCK > 
operator-- (int)
 Postfix reverse.
int next (ACE_RB_Tree_Node< EXT_ID, INT_ID > *&next_entry) const

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

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 809 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 1057 of file RB_Tree.inl.

References ACE_TRACE.

01058   : ACE_RB_Tree_Iterator_Base<EXT_ID,INT_ID,COMPARE_KEYS,ACE_LOCK> ()
01059 {
01060   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree_Reverse_Iterator (void)");
01061 }

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 1174 of file RB_Tree.cpp.

References ACE_TRACE.

01175   : ACE_RB_Tree_Iterator_Base<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> (tree, set_last ? 0 : 1)
01176 {
01177   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree_Reverse_Iterator");
01178 }

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 1181 of file RB_Tree.cpp.

References ACE_TRACE.

01182   : ACE_RB_Tree_Iterator_Base<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> (tree,entry)
01183 {
01184   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree_Reverse_Iterator");
01185 }

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 1188 of file RB_Tree.cpp.

References ACE_TRACE.

01189  : ACE_RB_Tree_Iterator_Base<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>(key,tree)
01190 {
01191   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree_Reverse_Iterator");
01192 }

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 1197 of file RB_Tree.cpp.

References ACE_TRACE.

01198 {
01199   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::~ACE_RB_Tree_Reverse_Iterator");
01200 }


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 1068 of file RB_Tree.inl.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::reverse_i().

01069 {
01070   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::advance");
01071 
01072   return this->reverse_i ();
01073 }

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 1080 of file RB_Tree.inl.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::dump_i().

01081 {
01082 #if defined (ACE_HAS_DUMP)
01083   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::dump");
01084 
01085   this->dump_i ();
01086 #endif /* ACE_HAS_DUMP */
01087 }

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 1156 of file RB_Tree.inl.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::node_.

01157 {
01158   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::next");
01159 
01160   if (this->node_)
01161     {
01162       next_entry = this->node_;
01163       return 1;
01164     }
01165 
01166   return 0;
01167 }

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 1107 of file RB_Tree.inl.

References ACE_TRACE.

01108 {
01109   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator++ (int)");
01110 
01111   ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> retv (*this);
01112   ++*this;
01113   return retv;
01114 }

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 1094 of file RB_Tree.inl.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::reverse_i().

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

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 1134 of file RB_Tree.inl.

References ACE_TRACE.

01135 {
01136   ACE_TRACE ("ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::operator-- (int)");
01137 
01138   ACE_RB_Tree_Reverse_Iterator<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> retv (*this);
01139   --*this;
01140   return retv;
01141 }

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 1121 of file RB_Tree.inl.

References ACE_TRACE, and ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::forward_i().

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


Member Data Documentation

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_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

Reimplemented from ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >.

Definition at line 872 of file RB_Tree.h.


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:35:29 2010 for ACE by  doxygen 1.4.7