ACE  6.3.3
Public Member Functions | Public Attributes | List of all members
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > Class Template Reference

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

#include <RB_Tree.h>

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

Public Member Functions

 ACE_RB_Tree_Iterator (void)
 
 ACE_RB_Tree_Iterator (const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree, int set_first=1)
 
 ACE_RB_Tree_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_Iterator (const EXT_ID &key, ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree)
 
 ~ACE_RB_Tree_Iterator (void)
 Destructor. More...
 
int advance (void)
 
void dump (void) const
 Dump the state of an object. More...
 
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > & operator++ (void)
 Prefix advance. More...
 
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > operator++ (int)
 Postfix advance. More...
 
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > & operator-- (void)
 Prefix reverse. More...
 
ACE_RB_Tree_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
 
EXT_ID * key (void)
 
INT_ID * item (void)
 
int first (void)
 
int last (void)
 
int next (void)
 
int previous (void)
 
int is_done (void)
 
- Public Member Functions inherited from 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)
 Copy constructor. More...
 
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
 
ACE_RB_Tree_Node< EXT_ID, INT_ID > * operator-> (void) const
 
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...
 
bool 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...
 
bool 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...
 
- Public Attributes inherited from ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >
 ACE_RB_Tree_Iterator_Base (void)
 
 ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree, int set_first)
 
 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)
 
 ACE_RB_Tree_Iterator_Base (const EXT_ID &key, ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &tree)
 
 ~ACE_RB_Tree_Iterator_Base (void)
 Destructor. More...
 
int forward_i (void)
 
int reverse_i (void)
 
void dump_i (void) const
 Dump the state of an object. More...
 
- Protected Attributes inherited from ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >
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< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >

Implements an iterator for a Red-Black Tree ADT.

Constructor & Destructor Documentation

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Iterator ( void  )
inline

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

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_Iterator ( const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &  tree,
int  set_first = 1 
)

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< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_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 pointer to a node in the tree.

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_RB_Tree_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.

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::~ACE_RB_Tree_Iterator ( void  )

Destructor.

Member Function Documentation

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::advance ( void  )
inline

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

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
void ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::dump ( void  ) const
inline

Dump the state of an object.

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::first ( void  )
inline
Deprecated:
Move to the first item in the iteration (and in the tree).
template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::is_done ( void  )
inline
Deprecated:
: use the base class <done> method instead. Returns 0 if the iterator is positioned over a valid ACE_RB_Tree node, returns 1 if not.
template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
INT_ID * ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::item ( void  )
inline
Deprecated:
Accessor for item of node under iterator (if any).
template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
EXT_ID * ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::key ( void  )
inline
Deprecated:
Accessor for key of node under iterator (if any).
template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::last ( void  )
inline
Deprecated:
Move to the last item in the iteration (and in the tree).
template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::next ( ACE_RB_Tree_Node< EXT_ID, INT_ID > *&  next_entry) const
inline

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.

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::next ( void  )
inline
Deprecated:
Move to the next item in the iteration (and in the tree).
template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > & ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator++ ( void  )
inline

Prefix advance.

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator++ ( int  )
inline

Postfix advance.

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > & ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator-- ( void  )
inline

Prefix reverse.

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::operator-- ( int  )
inline

Postfix reverse.

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::previous ( void  )
inline
Deprecated:
Move to the previous item in the iteration (and in the tree).

Member Data Documentation

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

Declare the dynamic allocation hooks.


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