ACE 8.0.2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > 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< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >:
Inheritance graph
[legend]

Public Member Functions

 ACE_RB_Tree_Iterator_Base (const ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > &iter)
 Copy constructor.
 
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.
 
int done () const
 Returns 1 when the iteration has completed, otherwise 0.
 
ACE_RB_Tree_Node< EXT_ID, INT_ID > & operator* () const
 
ACE_RB_Tree_Node< EXT_ID, INT_ID > * operator-> () const
 
const ACE_RB_Tree< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK > & tree ()
 Returns a const reference to the tree over which we're iterating.
 
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.
 
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.
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Protected Member Functions

 ACE_RB_Tree_Iterator_Base ()
 
 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 ()
 Destructor.
 
int forward_i ()
 
int reverse_i ()
 
void dump_i () const
 Dump the state of an object.
 

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.
 
ACE_RB_Tree_Node< EXT_ID, INT_ID > * node_
 Pointer to the node currently under the iterator.
 

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

◆ ACE_RB_Tree_Iterator_Base() [1/5]

Copy constructor.

◆ ACE_RB_Tree_Iterator_Base() [2/5]

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

◆ ACE_RB_Tree_Iterator_Base() [3/5]

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).

◆ ACE_RB_Tree_Iterator_Base() [4/5]

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

◆ ACE_RB_Tree_Iterator_Base() [5/5]

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.

◆ ~ACE_RB_Tree_Iterator_Base()

Destructor.

Member Function Documentation

◆ done()

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::done ( ) const
inline

Returns 1 when the iteration has completed, otherwise 0.

◆ dump_i()

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 >::dump_i ( ) const
protected

Dump the state of an object.

◆ forward_i()

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::forward_i ( )
inlineprotected

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

◆ operator!=()

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
bool 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
inline

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

◆ operator*()

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

◆ operator->()

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

◆ operator=()

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

◆ operator==()

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

◆ reverse_i()

template<class EXT_ID , class INT_ID , class COMPARE_KEYS , class ACE_LOCK >
int ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::reverse_i ( )
inlineprotected

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

◆ tree()

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< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::tree ( )
inline

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

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

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_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ node_

Pointer to the node currently under the iterator.

◆ tree_

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

Reference to the ACE_RB_Tree over which we're iterating.


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