ACE
6.4.2
|
Implements a common base class for iterators for a Red-Black Tree ADT. More...
#include <RB_Tree.h>
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. 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... | |
Protected Member Functions | |
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 | |
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... | |
Implements a common base class for iterators for a Red-Black Tree ADT.
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.
|
inlineprotected |
Create the singular iterator. No valid iterator can be equal to it, it is illegal to dereference a singular iterator, etc. etc.
|
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).
|
protected |
Constructor. Takes an ACE_RB_Tree over which to iterate, and a pointer to a node in the 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.
|
protected |
Destructor.
|
inline |
Returns 1 when the iteration has completed, otherwise 0.
|
protected |
Dump the state of an object.
|
inlineprotected |
Move forward by one element in the tree. Returns 0 when there are no more elements in the tree, otherwise 1.
|
inline |
Comparison operator: returns 1 if the iterators point to different positions, otherwise 0.
|
inline |
STL-like iterator dereference operator: returns a reference to the node underneath the iterator.
|
inline |
STL-like iterator dereference operator: returns a pointer to the node underneath the iterator.
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.
|
inline |
Comparison operator: returns 1 if both iterators point to the same position, otherwise 0.
|
inlineprotected |
Move back by one element in the tree. Returns 0 when there are no more elements in the tree, otherwise 1.
|
inline |
Returns a const reference to the tree over which we're iterating.
ACE_RB_Tree_Iterator_Base< EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
|
protected |
Pointer to the node currently under the iterator.
|
protected |
Reference to the ACE_RB_Tree over which we're iterating.